OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 1:32 pm

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: 104
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 ?

_________________
My github: https://github.com/nifanfa


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: 4591
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: 5100
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: 104
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?

_________________
My github: https://github.com/nifanfa


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: 104
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?

_________________
My github: https://github.com/nifanfa


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: 4591
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: 5100
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: 4591
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: 104
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

_________________
My github: https://github.com/nifanfa


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: 104
Location: CN
what i should do to page_dir

_________________
My github: https://github.com/nifanfa


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: 104
Location: CN
and i got General Protection Exception if i map the first 2mb

_________________
My github: https://github.com/nifanfa


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: 5100
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: 104
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

_________________
My github: https://github.com/nifanfa


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: 4591
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: 85
>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], Kamal123, MichaelPetch and 57 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