1; Kernel Entry Point
2; This is a small assembly wrapper that ensures the C kernel is started correctly.
3; Since C compilers don't guarantee the order of functions in the binary,
4; this stub is linked at the very beginning of the kernel image.
5
6[bits 32] ; We are in 32-bit Protected Mode at this point
7global _start
8[extern kmain] ; Inform the assembler that 'kmain' is defined elsewhere (in kmain.c)
9
10_start:
11 call kmain ; Transfer control to the main function of our C kernel
12 jmp $ ; If the kernel returns, halt the CPU in an infinite loop