Fixed passing of memory map from GRUB

This commit is contained in:
neviyn 2018-05-16 01:47:52 +01:00
parent 6e481f72aa
commit e3eac48353
2 changed files with 5 additions and 4 deletions

View File

@ -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

View File

@ -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()