The paging is done as
4 MB initial := identity mapped
3gb+1 (768th entry in the PDT) := mapped to 1 Mb
The kernel is loaded at 1MB using unreal mode and using GDT trick. (cs.base = 0x400000 ,ds.base=0x400000)
And kernel starts at 0xc00100000
Now , I want to reload the normal descriptors (zero base addresses)
I am trying to load the GDT (which I checked 10 times already and is correct) after enabling the paging. I keep running into a general protection fault. The info gdt in bochs says that something is wrong with the GDT .
As soon as the data segment gets loaded ,bochs generates the GPF due to wrong data segment. Please help solve this problem.
Code: Select all
lgdt [toc]
mov ax , 0x10
mov ds , ax
mov es , ax
; mov ss , ax
pop ebp
; jmp 0x08: return_cr0