diff --git a/kernel/arch/i386/boot.s b/kernel/arch/i386/boot.s index eaaae2a..132f602 100644 --- a/kernel/arch/i386/boot.s +++ b/kernel/arch/i386/boot.s @@ -33,7 +33,8 @@ _start: 1: cmp $(_kernel_start - 0xC0000000), %esi jl 2f - cmp $(_kernel_end - 0xC0000000), %esi + # + 0x1000 for the GRUB memory map + cmp $(_kernel_end - 0xC0000000 + 0x1000), %esi jge 3f mov %esi, %edx or $0x003, %edx diff --git a/kernel/kernel.nim b/kernel/kernel.nim index 2dc79e2..9752ffe 100644 --- a/kernel/kernel.nim +++ b/kernel/kernel.nim @@ -23,13 +23,13 @@ proc memset*(dest: ByteAddress, value: char, count: int){.exportc.} = proc getMemoryMap(mbd: multiboot_info) = discard # Use this if we need to do anything with the GRUB memory map -#proc kernelMain(mbd: multiboot_info, magic: uint) {.exportc: "kernel_main"}= -proc kernelMain() {.exportc: "kernel_main"}= +proc kernelMain(mbd: multiboot_info, magic: uint) {.exportc: "kernel_main"}= +#proc kernelMain() {.exportc: "kernel_main"}= + getMemoryMap(mbd) paging.init() serial.init() serial.writeLine("Version:" & (version)) serial.writeLine("Booting OS") - #getMemoryMap(mbd) gdt.gdtInstall() serial.writeLine("GDT installed") interrupts.idtInstall()