From 908297007de73ba032920b596397aa6b829041ef Mon Sep 17 00:00:00 2001 From: Nathan Cannon Date: Sun, 6 May 2018 20:25:29 +0100 Subject: [PATCH] Improved boot.s --- kernel/arch/i386/boot.s | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/kernel/arch/i386/boot.s b/kernel/arch/i386/boot.s index 8da6d9e..8d6a396 100644 --- a/kernel/arch/i386/boot.s +++ b/kernel/arch/i386/boot.s @@ -1,9 +1,8 @@ -# http://wiki.osdev.org/Bare_Bones_with_NASM -.set MBALIGN, 1<<0 # align loaded modules on page boundaries -.set MEMINFO, 1<<1 # provide memory map -.set FLAGS, MBALIGN | MEMINFO # this is the Multiboot 'flag' field -.set MAGIC, 0x1BADB002 # 'magic number' lets bootloader find the header -.set CHECKSUM,-(MAGIC + FLAGS) # checksum of above, to prove we are multiboot +.set MBALIGN, 1<<0 # align loaded modules on page boundaries +.set MEMINFO, 1<<1 # provide memory map +.set FLAGS, MBALIGN | MEMINFO # this is the Multiboot 'flag' field +.set MAGIC, 0x1BADB002 # 'magic number' lets bootloader find the header +.set CHECKSUM, -(MAGIC + FLAGS) # checksum of above, to prove we are multiboot .section .multiboot .align 4 @@ -12,6 +11,7 @@ .long CHECKSUM .section .bss +.align 16 stack_bottom: .skip 16384 # 16 KiB stack_top: @@ -26,3 +26,5 @@ _start: .hang: hlt jmp .hang .end: + +.size _start, . - _start