OSDev.org

The Place to Start for Operating System Developers
It is currently Sat Jun 24, 2017 9:30 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: X86 Long Mode PML4E/PDPE question
PostPosted: Sun Mar 19, 2017 3:57 am 
Offline
Member
Member

Joined: Wed Mar 15, 2017 9:22 am
Posts: 40
Hi all.

I'm just setting up a 64 bit test in assembler so setting up the translation tables. I'm setting as 1GB tables and had a question on the structure. I've seen a few examples where say their PML4E table is at address 1000 and the PDPE is at 2000 etc. In the PML4E table they are setting the pointer to 2003 hence 2000 with two bits set for the switches. In the AMD docs, it shows the first 8 bits as switches and then 4 bits ignored so the address starts at bit 12. What I can't relate to is how the address they show is correct?

Bipman


Top
 Profile  
 
 Post subject: Re: X86 Long Mode PML4E/PDPE question
PostPosted: Mon Mar 20, 2017 3:09 am 
Offline
Member
Member

Joined: Wed Sep 19, 2012 3:43 am
Posts: 62
Location: The Netherlands
You're confusing bits and bytes. The difference between 0x2000 and 0x2003 is 2 bytes, not 2 bits


Top
 Profile  
 
 Post subject: Re: X86 Long Mode PML4E/PDPE question
PostPosted: Mon Mar 20, 2017 3:25 am 
Offline
Member
Member

Joined: Wed Mar 15, 2017 9:22 am
Posts: 40
Sorry I didn't mention is was ox2003 i.e. hex. Isn't ox2000 + 11b = ox2003? Anyway, what I am trying to say (I think) is do the first 12 bits of the field that make up the address also include the flags?

Bipman


Top
 Profile  
 
 Post subject: Re: X86 Long Mode PML4E/PDPE question
PostPosted: Mon Mar 20, 2017 6:57 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 27, 2004 11:00 pm
Posts: 814
Location: CA
Bipman wrote:
Sorry I didn't mention is was ox2003 i.e. hex. Isn't ox2000 + 11b = ox2003? Anyway, what I am trying to say (I think) is do the first 12 bits of the field that make up the address also include the flags?

Bipman

yes

basically, since the address must be aligned on a 4K boundary, the lower 12 bits of the address will always be 0, therefore, the CPU ignores those bits (assumes they are all 0) and those bits can then be re-used for various flags -- all versions of x86 paging do this

_________________
## ---- ----- ------ Intel Manuals
OSdev wiki


Top
 Profile  
 
 Post subject: Re: X86 Long Mode PML4E/PDPE question
PostPosted: Mon Mar 20, 2017 6:59 am 
Offline
Member
Member

Joined: Wed Mar 15, 2017 9:22 am
Posts: 40
Excellent thanks :D Just what I needed to know.

Bipman


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Google [Bot], underscoretanner and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group