OSDev.org

The Place to Start for Operating System Developers
It is currently Sun Nov 28, 2021 4:10 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: PAE How to map the specific address?
PostPosted: Wed Oct 27, 2021 10:03 am 
Offline
Member
Member

Joined: Tue Aug 17, 2021 10:40 am
Posts: 33
Location: CN
Hello! i want to implement PAE for my OS. and i read this article
https://wiki.osdev.org/Setting_Up_Paging_With_PAE

page_dir[0] = 0b10000011; //Address=0, 2MIB, RW and present

i wonder what does 0b10000011 mean.
and how i do i map the address like 0xFFFF_FFFF_FF00_0000 to 0xFFFF_FF00 ?


Top
 Profile  
 
 Post subject: Re: PAE How to map the specific address?
PostPosted: Wed Oct 27, 2021 10:33 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4272
Location: Chichester, UK
Have you read the chapter in the Intel (or AMD) Programmer's Manual on the subject?


Top
 Profile  
 
 Post subject: Re: PAE How to map the specific address?
PostPosted: Wed Oct 27, 2021 10:47 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 3484
nifanfa wrote:
i wonder what does 0b10000011 mean.

Are you asking about binary literals in C, or are you asking about how the CPU will interpret that value?

nifanfa wrote:
and how i do i map the address like 0xFFFF_FFFF_FF00_0000 to 0xFFFF_FF00 ?

You can't, 0xFFFF_FFFF_FF00_0000 is not a valid address.


Top
 Profile  
 
 Post subject: Re: PAE How to map the specific address?
PostPosted: Wed Oct 27, 2021 10:48 am 
Offline
Member
Member

Joined: Tue Aug 17, 2021 10:40 am
Posts: 33
Location: CN
iansjack wrote:
Have you read the chapter in the Intel (or AMD) Programmer's Manual on the subject?

no. where i can find them?


Top
 Profile  
 
 Post subject: Re: PAE How to map the specific address?
PostPosted: Wed Oct 27, 2021 10:49 am 
Offline
Member
Member

Joined: Tue Aug 17, 2021 10:40 am
Posts: 33
Location: CN
Octocontrabass wrote:
nifanfa wrote:
i wonder what does 0b10000011 mean.

Are you asking about binary literals in C, or are you asking about how the CPU will interpret that value?

nifanfa wrote:
and how i do i map the address like 0xFFFF_FFFF_FF00_0000 to 0xFFFF_FF00 ?

You can't, 0xFFFF_FFFF_FF00_0000 is not a valid address.


ahh. isn't PAE designed for use memory above 4gb?


Top
 Profile  
 
 Post subject: Re: PAE How to map the specific address?
PostPosted: Wed Oct 27, 2021 10:52 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4272
Location: Chichester, UK
nifanfa wrote:
iansjack wrote:
Have you read the chapter in the Intel (or AMD) Programmer's Manual on the subject?

no. where i can find them?

On the Intel and AMD websites. They are essential reading.


Top
 Profile  
 
 Post subject: Re: PAE How to map the specific address?
PostPosted: Wed Oct 27, 2021 10:55 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 3484
nifanfa wrote:
no. where i can find them?

The Intel SDM is here. The AMD APM is here (in the "AMD64 Architecture" section).

nifanfa wrote:
ahh. isn't PAE designed for use memory above 4gb?

Yes, you can use PAE to access physical addresses above 4GiB, but physical addresses are limited to 52 bits. The highest possible physical address is 0x000F_FFFF_FFFF_FFFF.


Top
 Profile  
 
 Post subject: Re: PAE How to map the specific address?
PostPosted: Wed Oct 27, 2021 10:57 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4272
Location: Chichester, UK
Octocontrabass wrote:
You can't, 0xFFFF_FFFF_FF00_0000 is not a valid address.

Why not (ignoring the underscores)? It's canonical.


Top
 Profile  
 
 Post subject: Re: PAE How to map the specific address?
PostPosted: Wed Oct 27, 2021 10:57 am 
Offline
Member
Member

Joined: Tue Aug 17, 2021 10:40 am
Posts: 33
Location: CN
Octocontrabass wrote:
nifanfa wrote:
no. where i can find them?

The Intel SDM is here. The AMD APM is here (in the "AMD64 Architecture" section).

nifanfa wrote:
ahh. isn't PAE designed for use memory above 4gb?

Yes, you can use PAE to access physical addresses above 4GiB, but physical addresses are limited to 52 bits. The highest possible physical address is 0x000F_FFFF_FFFF_FFFF.


got. but how do i map address like 0xFFFFFFFF1 to 0xE0000000


Top
 Profile  
 
 Post subject: Re: PAE How to map the specific address?
PostPosted: Wed Oct 27, 2021 10:58 am 
Offline
Member
Member

Joined: Tue Aug 17, 2021 10:40 am
Posts: 33
Location: CN
what i should do to page_dir


Top
 Profile  
 
 Post subject: Re: PAE How to map the specific address?
PostPosted: Wed Oct 27, 2021 10:59 am 
Offline
Member
Member

Joined: Tue Aug 17, 2021 10:40 am
Posts: 33
Location: CN
and i got General Protection Exception if i map the first 2mb


Top
 Profile  
 
 Post subject: Re: PAE How to map the specific address?
PostPosted: Wed Oct 27, 2021 11:00 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 3484
Do you understand how regular 32-bit paging works? The questions you're asking make it sound like you don't.


Top
 Profile  
 
 Post subject: Re: PAE How to map the specific address?
PostPosted: Wed Oct 27, 2021 11:01 am 
Offline
Member
Member

Joined: Tue Aug 17, 2021 10:40 am
Posts: 33
Location: CN
Octocontrabass wrote:
Do you understand how regular 32-bit paging works? The questions you're asking make it sound like you don't.

yes... i don't know about paging


Top
 Profile  
 
 Post subject: Re: PAE How to map the specific address?
PostPosted: Wed Oct 27, 2021 11:17 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4272
Location: Chichester, UK
nifanfa wrote:
got. but how do i map address like 0xFFFFFFFF1 to 0xE0000000
That you can't do, as you can only map a virtual page to a physical page. Both are aligned on 4K boundaries.


Top
 Profile  
 
 Post subject: Re: PAE How to map the specific address?
PostPosted: Wed Oct 27, 2021 11:31 am 
Offline
Member
Member
User avatar

Joined: Wed Sep 28, 2005 11:00 pm
Posts: 82
>and how i do i map the address like 0xFFFF_FFFF_FF00_0000 to 0xFFFF_FF00 ?

You'd translate the virtual address into its pml4e number, pdpte number, etc., and then set the entries appropriately.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 21 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