LONG MODE MULTIBOOT WORKS gsp!
This commit is contained in:
parent
33d68464b2
commit
cdcb306839
|
@ -108,6 +108,7 @@ lnext:
|
||||||
%include "boot/loader/mem/structures.inc"
|
%include "boot/loader/mem/structures.inc"
|
||||||
lnext2:
|
lnext2:
|
||||||
call Setup_paging
|
call Setup_paging
|
||||||
|
call Go64
|
||||||
jmp lnext3
|
jmp lnext3
|
||||||
%include "boot/loader/mem/management.inc"
|
%include "boot/loader/mem/management.inc"
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,8 @@ Setup_paging:
|
||||||
; Enable long mode and paging ;
|
; Enable long mode and paging ;
|
||||||
; ---------------------------------------------------------------------------- ;
|
; ---------------------------------------------------------------------------- ;
|
||||||
Go64:
|
Go64:
|
||||||
|
pusha
|
||||||
|
|
||||||
;; Registering paging
|
;; Registering paging
|
||||||
mov eax, PML4_table
|
mov eax, PML4_table
|
||||||
mov cr3, eax ; Load PML4 to cr3
|
mov cr3, eax ; Load PML4 to cr3
|
||||||
|
@ -78,5 +80,10 @@ Go64:
|
||||||
; |
|
; |
|
||||||
; `------ Paging bit
|
; `------ Paging bit
|
||||||
mov cr0, eax
|
mov cr0, eax
|
||||||
|
jmp .end
|
||||||
|
nop
|
||||||
|
nop
|
||||||
|
.end:
|
||||||
|
|
||||||
|
popa
|
||||||
ret
|
ret
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
[BITS 32]
|
[BITS 32]
|
||||||
|
|
||||||
;; GDT WITH DOC
|
;; GDT WITH DOC
|
||||||
ALIGN 4
|
ALIGN 4096
|
||||||
GDT64:
|
GDT64:
|
||||||
NULL_SELECTOR: ;; null selector within 64 bits
|
NULL_SELECTOR: ;; null selector within 64 bits
|
||||||
dw GDT_LENGTH ; limit of GDT
|
dw GDT_LENGTH ; limit of GDT
|
||||||
|
@ -104,7 +104,7 @@ GDT64:
|
||||||
GDT_LENGTH:
|
GDT_LENGTH:
|
||||||
|
|
||||||
;; EMPTY PAGE TABLES (identity of the first 1GiB)
|
;; EMPTY PAGE TABLES (identity of the first 1GiB)
|
||||||
ALIGN 4
|
ALIGN 4096
|
||||||
PML4_table:
|
PML4_table:
|
||||||
resb 4096
|
resb 4096
|
||||||
PDP_table:
|
PDP_table:
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue