Enable paging first before loading GDT.

This commit is contained in:
Nicolás Ortega Froysa 2018-04-12 16:42:15 +02:00
parent 003e3d9604
commit 0cc0abae35
No known key found for this signature in database
GPG Key ID: FEC70E3BAE2E69BF

View File

@ -61,12 +61,6 @@ _start:
mov $stack_top, %esp
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
call setup_paging # will return pointer to page directory
# load page directory
@ -76,6 +70,12 @@ _start:
orl $0x80000000, %eax
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:
# enter high-level kernel (C)
call kernel_main