Getting into long mode without paging
Posted: Tue Oct 25, 2022 11:59 am
Can I get into 64 bit mode without paging? Too lazy to learn and deal with it
The Place to Start for Operating System Developers
http://f.osdev.org/
You can map a PML4 to a 512GB page if you enable 5-level paging, but pages aren't allowed to span memory type boundaries, so you wouldn't be able to use it to identity-map memory on most PCs unless you also set the page to uncacheable.AndrewAPrice wrote:I have not tried this but I wonder if you could identity map a PML4 to 512 GB pages. But it will be easy to identify map at the PML3 to 1GB pages. You'd only need 8KB of memory to map the bottom 512GB of virtual memory to physical memory.
Do you mean use the PS bit on PML4E's? I scanned the Intel manuals and it didn't say anything, so unless I'm missing something, I guess this isn't possible.AndrewAPrice wrote:I have not tried this but I wonder if you could identity map a PML4 to 512 GB pages.
You may have chosen the wrong hobby.cyao1234 wrote:Can I get into 64 bit mode without paging? Too lazy to learn and deal with it
Remember, you will always need to make paging support.align 0x1000
PageTable:
.Pml4:
dq .Pdp + 3 ; + 3 (or | 3 ) which set Present & R/W Bits
times 511 dq 0
.Pdp:
dq .Pd + 3
times 511 dq 0
.Pd: ; Identity Map low 1gb
%assign i 0
%rep 512
dq i + 0x83
%assign i i + 0x200000
%endrep
Ooo thx! I will eventually find some time to study it later, but ima go with this atmdevc1 wrote:This is a simple page table to start with, it identity maps 1gb of low memory using 2mb pages.
NASM Syntax,Remember, you will always need to make paging support.align 0x1000
PageTable:
.Pml4:
dq .Pdp + 3 ; + 3 (or | 3 ) which set Present & R/W Bits
times 511 dq 0
.Pdp:
dq .Pd + 3
times 511 dq 0
.Pd: ; Identity Map low 1gb
%assign i 0
%rep 512
dq i + 0x83
%assign i i + 0x200000
%endrep
So get up from your laziness and do it