mirror of
https://github.com/hermitcore/libhermit.git
synced 2025-03-16 00:00:06 +01:00
enable PGE and PAE, remove label Linvalid
This commit is contained in:
parent
8ec49a3582
commit
51927e7e6d
1 changed files with 8 additions and 9 deletions
|
@ -269,19 +269,19 @@ Lno_remap:
|
|||
push ecx
|
||||
popfd
|
||||
xor eax, ecx
|
||||
jz short Linvalid
|
||||
jz $ ; there is no long mode
|
||||
|
||||
; cpuid > 0x80000000?
|
||||
mov eax, 0x80000000
|
||||
cpuid
|
||||
cmp eax, 0x80000001
|
||||
jb short Linvalid ; It is less, there is no long mode.
|
||||
jb $ ; It is less, there is no long mode.
|
||||
|
||||
; do we have a long mode?
|
||||
mov eax, 0x80000001
|
||||
cpuid
|
||||
test edx, 1 << 29 ; Test if the LM-bit, which is bit 29, is set in the D-register.
|
||||
jz short Linvalid ; They aren't, there is no long mode.
|
||||
jz $ ; They aren't, there is no long mode.
|
||||
|
||||
|
||||
; we need to enable PAE modus
|
||||
|
@ -299,12 +299,15 @@ Lno_remap:
|
|||
mov eax, boot_pml4
|
||||
sub eax, kernel_start
|
||||
add eax, ebp
|
||||
or eax, (1 << 0) ; set present bit
|
||||
mov cr3, eax
|
||||
|
||||
; Set CR4
|
||||
mov eax, cr4
|
||||
and eax, 0xfffbf9ff ; disable SSE
|
||||
or eax, (1 << 4) ; enable PSE
|
||||
or eax, (1 << 5) ; enable PAE
|
||||
or eax, (1 << 7) ; enable PGE
|
||||
mov cr4, eax
|
||||
|
||||
; Set CR0
|
||||
|
@ -318,10 +321,6 @@ Lno_remap:
|
|||
lgdt [GDT64.Pointer] ; Load the 64-bit global descriptor table.
|
||||
jmp GDT64.Code:start64 ; Set the code segment and enter 64-bit long mode.
|
||||
|
||||
; there is no long mode
|
||||
Linvalid:
|
||||
jmp $
|
||||
|
||||
[BITS 64]
|
||||
start64:
|
||||
; initialize segment registers
|
||||
|
|
Loading…
Add table
Reference in a new issue