summaryrefslogtreecommitdiff
path: root/sos-code-article3
diff options
context:
space:
mode:
Diffstat (limited to 'sos-code-article3')
-rw-r--r--sos-code-article3/Makefile20
-rw-r--r--sos-code-article3/cdrom/boot/grub/menu.lst3
-rw-r--r--sos-code-article3/cdrom/boot/grub/stage2_eltoritobin0 -> 147440 bytes
-rw-r--r--sos-code-article3/sos.map119
4 files changed, 138 insertions, 4 deletions
diff --git a/sos-code-article3/Makefile b/sos-code-article3/Makefile
index 8e15812..64ae955 100644
--- a/sos-code-article3/Makefile
+++ b/sos-code-article3/Makefile
@@ -1,4 +1,5 @@
-CC=gcc
+CC=i586-elf-gcc
+LD=i586-elf-ld
CFLAGS = -Wall -nostdlib -nostdinc -ffreestanding -DKERNEL_SOS
LDFLAGS = --warn-common
OBJECTS = bootstrap/multiboot.o \
@@ -9,14 +10,25 @@ OBJECTS = bootstrap/multiboot.o \
sos/physmem.o sos/klibc.o sos/main.o
KERNEL_OBJ = sos.elf
-MULTIBOOT_IMAGE = fd.img
+MULTIBOOT_IMAGE = sos.iso
PWD := $(shell pwd)
# Main target
all: $(MULTIBOOT_IMAGE)
$(MULTIBOOT_IMAGE): $(KERNEL_OBJ)
- ./support/build_image.sh $@ $<
+ # ./support/build_image.sh $@ $<
+ if [ ! -e cdrom/boot/grub/stage2_eltorito ]; then \
+ mkdir -p cdrom/boot/grub; \
+ echo "Please copy grub's stage2_eltorito to cdrom/boot/grub."; \
+ exit -1; \
+ fi
+ cp $(KERNEL_OBJ) cdrom
+ echo timeout 0 > cdrom/boot/grub/menu.lst
+ echo title Simple OS >> cdrom/boot/grub/menu.lst
+ echo kernel /$(KERNEL_OBJ) >> cdrom/boot/grub/menu.lst
+ genisoimage -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 \
+ -boot-info-table -input-charset ascii -A SOS -o $(MULTIBOOT_IMAGE) cdrom
$(KERNEL_OBJ): $(OBJECTS) ./support/sos.lds
$(LD) $(LDFLAGS) -T ./support/sos.lds -o $@ $(OBJECTS)
@@ -34,7 +46,7 @@ $(KERNEL_OBJ): $(OBJECTS) ./support/sos.lds
# Clean directory
clean:
- $(RM) *.img *.o mtoolsrc *~ menu.txt *.img *.elf *.bin *.map
+ $(RM) *.iso *.o mtoolsrc *~ menu.txt *.img *.elf *.bin *.map
$(RM) *.log *.out bochs*
$(RM) bootstrap/*.o bootstrap/*~
$(RM) drivers/*.o drivers/*~
diff --git a/sos-code-article3/cdrom/boot/grub/menu.lst b/sos-code-article3/cdrom/boot/grub/menu.lst
new file mode 100644
index 0000000..351100d
--- /dev/null
+++ b/sos-code-article3/cdrom/boot/grub/menu.lst
@@ -0,0 +1,3 @@
+timeout 0
+title Simple OS
+kernel /sos.elf
diff --git a/sos-code-article3/cdrom/boot/grub/stage2_eltorito b/sos-code-article3/cdrom/boot/grub/stage2_eltorito
new file mode 100644
index 0000000..6d82f08
--- /dev/null
+++ b/sos-code-article3/cdrom/boot/grub/stage2_eltorito
Binary files differ
diff --git a/sos-code-article3/sos.map b/sos-code-article3/sos.map
new file mode 100644
index 0000000..9be9ec7
--- /dev/null
+++ b/sos-code-article3/sos.map
@@ -0,0 +1,119 @@
+00201000 __b_kernel
+00200000 __b_load
+002034bf clk_it
+002045bc clock_count.1118
+00203434 display_bits
+002085c0 __e_kernel
+00203cd7 __e_load
+002045a4 free_ppage
+00203988 gdt
+00202ba9 get_page_descr_at_paddr
+00203ce0 idt
+00201011 loop
+00202edf memcmp
+00202e88 memcpy
+00202eb9 memset
+00201000 multiboot_entry
+00200000 multiboot_header
+002045a0 physical_page_descr_array
+002045ac physmem_base
+002045b0 physmem_top
+002045b4 physmem_total_pages
+002045b8 physmem_used_pages
+00203b08 __PRETTY_FUNCTION__.1070
+00203cca __PRETTY_FUNCTION__.1149
+002033ff snprintf
+00202629 sos_bochs_hexdump
+002026ee sos_bochs_printf
+0020244b sos_bochs_puthex
+00202426 sos_bochs_putstring
+0020241c sos_bochs_setup
+002012d0 sos_exception_get_routine
+002044e0 sos_exception_handler_array
+0020123d sos_exception_set_routine
+00201218 sos_exceptions_setup
+00201300 sos_exception_wrapper_0
+00201344 sos_exception_wrapper_1
+002019a4 sos_exception_wrapper_10
+002019e4 sos_exception_wrapper_11
+00201a24 sos_exception_wrapper_12
+00201a64 sos_exception_wrapper_13
+00201aa4 sos_exception_wrapper_14
+00201564 sos_exception_wrapper_15
+002015a8 sos_exception_wrapper_16
+00201ae4 sos_exception_wrapper_17
+002015ec sos_exception_wrapper_18
+00201630 sos_exception_wrapper_19
+00201388 sos_exception_wrapper_2
+00201674 sos_exception_wrapper_20
+002016b8 sos_exception_wrapper_21
+002016fc sos_exception_wrapper_22
+00201740 sos_exception_wrapper_23
+00201784 sos_exception_wrapper_24
+002017c8 sos_exception_wrapper_25
+0020180c sos_exception_wrapper_26
+00201850 sos_exception_wrapper_27
+00201894 sos_exception_wrapper_28
+002018d8 sos_exception_wrapper_29
+002013cc sos_exception_wrapper_3
+0020191c sos_exception_wrapper_30
+00201960 sos_exception_wrapper_31
+00201410 sos_exception_wrapper_4
+00201454 sos_exception_wrapper_5
+00201498 sos_exception_wrapper_6
+002014dc sos_exception_wrapper_7
+00201b24 sos_exception_wrapper_8
+00201520 sos_exception_wrapper_9
+002039c0 sos_exception_wrapper_array
+002011e4 sos_gdt_setup
+002021a8 sos_i8254_set_frequency
+0020214e sos_i8259_disable_irq_line
+002020f0 sos_i8259_enable_irq_line
+002020a0 sos_i8259_setup
+00201174 sos_idt_get_handler
+002010b9 sos_idt_set_handler
+00201014 sos_idt_setup
+00201bfe sos_irq_get_routine
+00204560 sos_irq_handler_array
+00201b35 sos_irq_set_routine
+00201b28 sos_irq_setup
+00201c20 sos_irq_wrapper_0
+00201c68 sos_irq_wrapper_1
+00201ef0 sos_irq_wrapper_10
+00201f38 sos_irq_wrapper_11
+00201f80 sos_irq_wrapper_12
+00201fc8 sos_irq_wrapper_13
+00202010 sos_irq_wrapper_14
+00202058 sos_irq_wrapper_15
+00201cb0 sos_irq_wrapper_2
+00201cf8 sos_irq_wrapper_3
+00201d40 sos_irq_wrapper_4
+00201d88 sos_irq_wrapper_5
+00201dd0 sos_irq_wrapper_6
+00201e18 sos_irq_wrapper_7
+00201e60 sos_irq_wrapper_8
+00201ea8 sos_irq_wrapper_9
+00203a40 sos_irq_wrapper_array
+0020384a sos_main
+00202bec sos_physmem_ref_physpage_at
+00202a06 sos_physmem_ref_physpage_new
+00202734 sos_physmem_setup
+00202d25 sos_physmem_unref_physpage
+00202240 sos_x86_videomem_cls
+0020238a sos_x86_videomem_printf
+00202313 sos_x86_videomem_putchar
+00202283 sos_x86_videomem_putstring
+00202220 sos_x86_videomem_setup
+002045c0 stack
+00201000 start
+00201000 _start
+0020302d strcmp
+00202f39 strlen
+0020306f strncmp
+00202f5e strnlen
+00202fe2 strzcat
+00202f91 strzcpy
+002034f7 test_physmem
+002045a8 used_ppage
+002039a0 video
+002030d0 vsnprintf