Can someone help me figure out how to do it correctly?
I've came up with the following algorithm for setting up the structures:
Code: Select all
;[pd + VIRT_BASE >> 22] = pt | flags
;[pd] = pt_low | flags
;while i < ro_end
; [pt_low + i >> 12 & 0x03FF] = i | flags
; i += 0x1000
;end
;while i < rw_end
; [pt_low + i >> 12 & 0x03FF] = i | flags
; i += 0x1000
;end
;i = 0
;while i < ro_end
; [pt_high + (VIRT_BASE + i) >> 12 & 0x03FF] = i | flags
; i += 0x1000
;end
;while i < rw_end
; [pt_high + (VIRT_BASE + i) >> 12 & 0x03FF] = i | flags
; i += 0x1000
;end
My code is here: https://github.com/the-sushi/os
And the relevant parts are here: https://github.com/the-sushi/os/blob/ma ... 6/boot.asm
I'm not exactly aiming for the most efficient code here yet, I'll try cleaning it up and making it into routines after I can get it working at all.
Can someone please help get me onto the right path? Also, what is the PAT bit of a page directory table entry supposed to be? Intel's manual was a bit confusing in this regard.
Thanks,
~Ender