Can you spot the difference between 106000000 and 106000?PML4: 0x0000000106000003
// 0x106000 is pml4e->PhysAddr
Paging - strange(?) problem
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Paging - strange(?) problem
Re: Paging - strange(?) problem
But
So PhysAddr = 0x106000, Present-bit = 1, RW-bit = 1, everything else = 0... ?
is the whole struct isn´t it?0x0000000106000003
So PhysAddr = 0x106000, Present-bit = 1, RW-bit = 1, everything else = 0... ?
- Marionumber1
- Member
- Posts: 56
- Joined: Sun May 08, 2011 9:03 am
Re: Paging - strange(?) problem
An entry in the 64-bit paging structures has the lower 12-bits represent the page flags, and the upper 52-bits represent the physical page number.
Programmer and security enthusiast
DarkSide OS Kernel
Those who do not understand Windows NT are doomed to criticize it, poorly.
DarkSide OS Kernel
Those who do not understand Windows NT are doomed to criticize it, poorly.
Re: Paging - strange(?) problem
It's not a struct; it's the physical address with the proviso that the last 12 bits of that address are always 0. Because of this they can be used as flags piggy-backed onto the address. So to get the address you take the number in the control register or page table entry and mask the last 12 bits to 0 .begin wrote:Butis the whole struct isn´t it?0x0000000106000003
So PhysAddr = 0x106000, Present-bit = 1, RW-bit = 1, everything else = 0... ?
Get that wrong and your page table is going to be invalid.
Re: Paging - strange(?) problem
Holy **** it works now...
I think I should avoid bit fields from now... this was the real problem. I threw my struct away and used a uint64_t instead. And yes, I know bit fields should be avoided and I dont know why I used them....
Thank you guys
I think I should avoid bit fields from now... this was the real problem. I threw my struct away and used a uint64_t instead. And yes, I know bit fields should be avoided and I dont know why I used them....
Thank you guys