mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-17 08:37:17 -04:00
Verify if the e820 call is valid
This commit is contained in:
parent
aa747b988f
commit
ca5c11023c
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user