diff options
Diffstat (limited to 'sos-code-article4')
-rw-r--r-- | sos-code-article4/Makefile | 21 | ||||
-rw-r--r-- | sos-code-article4/cdrom/boot/grub/stage2_eltorito | bin | 0 -> 147440 bytes | |||
-rw-r--r-- | sos-code-article4/sos.map | 127 |
3 files changed, 144 insertions, 4 deletions
diff --git a/sos-code-article4/Makefile b/sos-code-article4/Makefile index 3a2282a..3bca9d6 100644 --- a/sos-code-article4/Makefile +++ b/sos-code-article4/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 \ @@ -10,14 +11,26 @@ 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) @@ -35,7 +48,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-article4/cdrom/boot/grub/stage2_eltorito b/sos-code-article4/cdrom/boot/grub/stage2_eltorito Binary files differnew file mode 100644 index 0000000..6d82f08 --- /dev/null +++ b/sos-code-article4/cdrom/boot/grub/stage2_eltorito diff --git a/sos-code-article4/sos.map b/sos-code-article4/sos.map new file mode 100644 index 0000000..026be3c --- /dev/null +++ b/sos-code-article4/sos.map @@ -0,0 +1,127 @@ +00201000 __b_kernel +00200000 __b_load +00203f1f clk_it +0020511c clock_count.1132 +00203e94 display_bits +00209120 __e_kernel +0020482b __e_load +00205104 free_ppage +00204388 gdt +00203609 get_page_descr_at_paddr +00204840 idt +00201011 loop +0020393f memcmp +002038e8 memcpy +00203919 memset +00201000 multiboot_entry +00200000 multiboot_header +002021a8 paging_setup_map_helper +00203f57 pgflt_ex +00205100 physical_page_descr_array +0020510c physmem_base +00205110 physmem_top +00205114 physmem_total_pages +00205118 physmem_used_pages +002045e4 __PRETTY_FUNCTION__.1070 +00204533 __PRETTY_FUNCTION__.1072 +0020454b __PRETTY_FUNCTION__.1107 +00203e5f snprintf +00203089 sos_bochs_hexdump +0020314e sos_bochs_printf +00202eab sos_bochs_puthex +00202e86 sos_bochs_putstring +00202e7c sos_bochs_setup +002012d0 sos_exception_get_routine +00205040 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 +002043c0 sos_exception_wrapper_array +002011e4 sos_gdt_setup +00202c08 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 +002050c0 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 +00204440 sos_irq_wrapper_array +00204203 sos_main +00202b4d sos_paging_get_paddr +00202a9d sos_paging_get_prot +002025ad sos_paging_map +00202421 sos_paging_setup +002028a9 sos_paging_unmap +0020364c sos_physmem_ref_physpage_at +00203466 sos_physmem_ref_physpage_new +00203194 sos_physmem_setup +00203785 sos_physmem_unref_physpage +00202ca0 sos_x86_videomem_cls +00202dea sos_x86_videomem_printf +00202d73 sos_x86_videomem_putchar +00202ce3 sos_x86_videomem_putstring +00202c80 sos_x86_videomem_setup +00205120 stack +00201000 start +00201000 _start +00203a8d strcmp +00203999 strlen +00203acf strncmp +002039be strnlen +00203a42 strzcat +002039f1 strzcpy +00203f8f test_paging +00205108 used_ppage +002043a0 video +00203b30 vsnprintf |