Enable paging first before loading GDT.
This commit is contained in:
parent
003e3d9604
commit
0cc0abae35
@ -61,12 +61,6 @@ _start:
|
|||||||
mov $stack_top, %esp
|
mov $stack_top, %esp
|
||||||
mov %esp, %ebp
|
mov %esp, %ebp
|
||||||
|
|
||||||
# GDT, paging, and other features
|
|
||||||
call gdt_install
|
|
||||||
# load the TSS which is in the 6th entry of the GDT
|
|
||||||
movw $0x28, %ax
|
|
||||||
ltr %ax
|
|
||||||
|
|
||||||
# paging
|
# paging
|
||||||
call setup_paging # will return pointer to page directory
|
call setup_paging # will return pointer to page directory
|
||||||
# load page directory
|
# load page directory
|
||||||
@ -76,6 +70,12 @@ _start:
|
|||||||
orl $0x80000000, %eax
|
orl $0x80000000, %eax
|
||||||
movl %eax, %cr0
|
movl %eax, %cr0
|
||||||
|
|
||||||
|
# GDT, paging, and other features
|
||||||
|
call gdt_install
|
||||||
|
# load the TSS which is in the 6th entry of the GDT
|
||||||
|
movw $0x28, %ax
|
||||||
|
ltr %ax
|
||||||
|
|
||||||
boot_kernel:
|
boot_kernel:
|
||||||
# enter high-level kernel (C)
|
# enter high-level kernel (C)
|
||||||
call kernel_main
|
call kernel_main
|
||||||
|
Loading…
Reference in New Issue
Block a user