Improved boot.s

This commit is contained in:
neviyn 2018-05-06 20:25:29 +01:00
parent 5f0b2ce33e
commit 908297007d

View File

@ -1,9 +1,8 @@
# http://wiki.osdev.org/Bare_Bones_with_NASM
.set MBALIGN, 1<<0 # align loaded modules on page boundaries .set MBALIGN, 1<<0 # align loaded modules on page boundaries
.set MEMINFO, 1<<1 # provide memory map .set MEMINFO, 1<<1 # provide memory map
.set FLAGS, MBALIGN | MEMINFO # this is the Multiboot 'flag' field .set FLAGS, MBALIGN | MEMINFO # this is the Multiboot 'flag' field
.set MAGIC, 0x1BADB002 # 'magic number' lets bootloader find the header .set MAGIC, 0x1BADB002 # 'magic number' lets bootloader find the header
.set CHECKSUM,-(MAGIC + FLAGS) # checksum of above, to prove we are multiboot .set CHECKSUM, -(MAGIC + FLAGS) # checksum of above, to prove we are multiboot
.section .multiboot .section .multiboot
.align 4 .align 4
@ -12,6 +11,7 @@
.long CHECKSUM .long CHECKSUM
.section .bss .section .bss
.align 16
stack_bottom: stack_bottom:
.skip 16384 # 16 KiB .skip 16384 # 16 KiB
stack_top: stack_top:
@ -26,3 +26,5 @@ _start:
.hang: hlt .hang: hlt
jmp .hang jmp .hang
.end: .end:
.size _start, . - _start