boot.S (553B)
1 #define ASM 1 2 #include <multiboot.h> 3 .text 4 .globl start, _start 5 start: 6 _start: 7 jmp multiboot_entry 8 .align 4 9 .globl multiboot_header 10 multiboot_header: 11 .long MULTIBOOT_HEADER_MAGIC 12 .long MULTIBOOT_HEADER_FLAGS 13 .long -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS) 14 #ifndef __ELF__ 15 .long multiboot_header 16 .long _start 17 .long _edata 18 .long _end 19 .load multiboot_entry 20 #endif 21 multiboot_entry: 22 cli 23 movl $(stack + STACK_SIZE), %esp 24 pushl $0 25 popf 26 pushl %esp 27 pushl %ebx 28 pushl %eax 29 call EXT_C(init) 30 loop: 31 hlt 32 jmp loop 33 .comm stack, STACK_SIZE 34