Verify if the e820 call is valid

This commit is contained in:
Baptiste Wicht 2013-10-31 13:44:11 +01:00
parent aa747b988f
commit ca5c11023c

View File

@ -53,13 +53,14 @@ e820_mmap:
.e820f:
mov [e820_entry_count], bp
clc
popa
ret
.failed:
stc
popa
ret
_start:
@ -72,6 +73,8 @@ _start:
cli
call e820_mmap
setc al
mov [e820_failed], al
; Load GDT
lgdt [GDTR64]
@ -145,10 +148,12 @@ pm_start:
[BITS 64]
lm_start:
movzx r8, word [e820_entry_count]
movzx r8, byte [e820_failed]
call set_current_position
call print_int_normal
jmp $
; Install IDT
call install_idt
@ -212,12 +217,15 @@ GDTR64:
dw 4 * 8 - 1 ; Length of GDT
dd GDT64
e820_memory_map:
times 32 dq 0, 0, 0
e820_failed:
db 0
e820_entry_count:
dw 0
e820_memory_map:
times 32 dq 0, 0, 0
; Fill the sector (not necessary, but cleaner)
times 16384-($-$$) db 0