/* boot.S - bootstrap the kernel */ #define ASM 1 #include "multiboot.h" .text /* Align 32 bits boundary. */ .align 4 /* Multiboot header. */ multiboot_header: /* magic */ .long MULTIBOOT_HEADER_MAGIC /* flags */ .long MULTIBOOT_HEADER_FLAGS /* checksum */ .long -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS) /* .space 20 .long 0 .long 100 .long 30 .long 16 */ .globl start, _start start: _start: /* Initialize the stack pointer. */ //movl $(stack + STACK_SIZE), %esp /* Place the stack from 0, since the lower memory is unused */ movl $STACK_SIZE, %esp /* Reset EFLAGS. */ pushl $0 popf /* Push the pointer to the Multiboot information structure. */ pushl %ebx /* Push the magic value. */ pushl %eax /* Now enter the C main function... */ call main /* Halt. */ pushl $halt_message call printf hlt /* Not going to be executed. */ pushl $halt_message call printf halt_message: .asciz "Halted." /* Our stack area. In BSS .comm stack, STACK_SIZE */