######## ENTRY SECTION START # This section is placed at the start of the .text section. # See the linker script. .section .entry # GRUB Multiboot Header .align 4 .long MULTIBOOT_HEADER_MAGIC .long MULTIBOOT_HEADER_FLAGS .long CHECKSUM # 32bit code start .code32 .globl entry entry: # boot/loader jumps to here in real-address mode test $0xF9F9F9F9,%eax # (test;stc;stc in 16bit mode) jc 1f # must be short jump for 16bit & 32bit shl %al inc %eax # (rex prefix in 64bit mode) rcr %al # undo %al jnc uefi64_entry jmp multiboot_entry