# cannot do that and have GRUB find it because GRUB only searches the first␊ |
# 8k of the binary. Since __TEXT,__const follows __TEXT,__text (the code␊ |
# section) and since the code is well over 8k long, it doesn't work.␊ |
.align 2, 0x90 # Make sure we're on a 4-byte boundary. Required by Multiboot.␊ |
.align 4, 0x90 # Make sure we're on a 4-byte boundary. Required by Multiboot.␊ |
_multiboot_header:␊ |
# magic (NOTE: this shows up as 02b0 ad1b in a hex dump)␊ |
.long MULTIBOOT_HEADER_MAGIC␊ |
|
nop␊ |
nop␊ |
nop␊ |
.align 3, 0x90 # Align to 8 byte boundary which should be enough nops␊ |
.align 8, 0x90 # Align to 8 byte boundary which should be enough nops␊ |
␊ |
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -␊ |
_multiboot_entry:␊ |
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -␊ |
# _continue_at_low_address does some trickery to get the caller running from the low address with the right selector␊ |
.globl _continue_at_low_address␊ |
.align 2, 0x90␊ |
.align 4, 0x90␊ |
_continue_at_low_address:␊ |
# Our stack frame has been set up with the return address on top␊ |
# First, fix that to be 1 MB lower␊ |
|
# We aren't using it right now so it's in an if 0 block.␊ |
#if 0␊ |
.globl _cause_crash␊ |
.align 2, 0x90␊ |
.align 4, 0x90␊ |
_cause_crash:␊ |
# Cause a crash, there is no GDT selector f0␊ |
jmp $0xf0,$0␊ |
|
# See the comments above as to why we have OFFSET_1MEG.␊ |
//.data␊ |
.section __INIT,__data␉// turbo␊ |
.align 2, 0x90␊ |
.align 4, 0x90␊ |
_Gdtr_high:␊ |
.word GDTLIMIT␊ |
.long vtop(_Gdt + OFFSET_1MEG)␊ |