PAE How to map the specific address?
-
- Member
- Posts: 104
- Joined: Tue Aug 17, 2021 10:40 am
- Libera.chat IRC: visitor
- Location: CN
- Contact:
PAE How to map the specific address?
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 ?
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
Re: PAE How to map the specific address?
Have you read the chapter in the Intel (or AMD) Programmer's Manual on the subject?
-
- Member
- Posts: 5563
- Joined: Mon Mar 25, 2013 7:01 pm
Re: PAE How to map the specific address?
Are you asking about binary literals in C, or are you asking about how the CPU will interpret that value?nifanfa wrote:i wonder what does 0b10000011 mean.
You can't, 0xFFFF_FFFF_FF00_0000 is not a valid address.nifanfa wrote:and how i do i map the address like 0xFFFF_FFFF_FF00_0000 to 0xFFFF_FF00 ?
-
- Member
- Posts: 104
- Joined: Tue Aug 17, 2021 10:40 am
- Libera.chat IRC: visitor
- Location: CN
- Contact:
Re: PAE How to map the specific address?
no. where i can find them?iansjack wrote:Have you read the chapter in the Intel (or AMD) Programmer's Manual on the subject?
My github: https://github.com/nifanfa
-
- Member
- Posts: 104
- Joined: Tue Aug 17, 2021 10:40 am
- Libera.chat IRC: visitor
- Location: CN
- Contact:
Re: PAE How to map the specific address?
ahh. isn't PAE designed for use memory above 4gb?Octocontrabass wrote:Are you asking about binary literals in C, or are you asking about how the CPU will interpret that value?nifanfa wrote:i wonder what does 0b10000011 mean.
You can't, 0xFFFF_FFFF_FF00_0000 is not a valid address.nifanfa wrote:and how i do i map the address like 0xFFFF_FFFF_FF00_0000 to 0xFFFF_FF00 ?
My github: https://github.com/nifanfa
Re: PAE How to map the specific address?
On the Intel and AMD websites. They are essential reading.nifanfa wrote:no. where i can find them?iansjack wrote:Have you read the chapter in the Intel (or AMD) Programmer's Manual on the subject?
-
- Member
- Posts: 5563
- Joined: Mon Mar 25, 2013 7:01 pm
Re: PAE How to map the specific address?
The Intel SDM is here. The AMD APM is here (in the "AMD64 Architecture" section).nifanfa wrote:no. where i can find them?
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.nifanfa wrote:ahh. isn't PAE designed for use memory above 4gb?
Re: PAE How to map the specific address?
Why not (ignoring the underscores)? It's canonical.Octocontrabass wrote: You can't, 0xFFFF_FFFF_FF00_0000 is not a valid address.
-
- Member
- Posts: 104
- Joined: Tue Aug 17, 2021 10:40 am
- Libera.chat IRC: visitor
- Location: CN
- Contact:
Re: PAE How to map the specific address?
got. but how do i map address like 0xFFFFFFFF1 to 0xE0000000Octocontrabass wrote:The Intel SDM is here. The AMD APM is here (in the "AMD64 Architecture" section).nifanfa wrote:no. where i can find them?
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.nifanfa wrote:ahh. isn't PAE designed for use memory above 4gb?
My github: https://github.com/nifanfa
-
- Member
- Posts: 104
- Joined: Tue Aug 17, 2021 10:40 am
- Libera.chat IRC: visitor
- Location: CN
- Contact:
Re: PAE How to map the specific address?
what i should do to page_dir
My github: https://github.com/nifanfa
-
- Member
- Posts: 104
- Joined: Tue Aug 17, 2021 10:40 am
- Libera.chat IRC: visitor
- Location: CN
- Contact:
Re: PAE How to map the specific address?
and i got General Protection Exception if i map the first 2mb
My github: https://github.com/nifanfa
-
- Member
- Posts: 5563
- Joined: Mon Mar 25, 2013 7:01 pm
Re: PAE How to map the specific address?
Do you understand how regular 32-bit paging works? The questions you're asking make it sound like you don't.
-
- Member
- Posts: 104
- Joined: Tue Aug 17, 2021 10:40 am
- Libera.chat IRC: visitor
- Location: CN
- Contact:
Re: PAE How to map the specific address?
yes... i don't know about pagingOctocontrabass wrote:Do you understand how regular 32-bit paging works? The questions you're asking make it sound like you don't.
My github: https://github.com/nifanfa
Re: PAE How to map the specific address?
That you can't do, as you can only map a virtual page to a physical page. Both are aligned on 4K boundaries.nifanfa wrote: got. but how do i map address like 0xFFFFFFFF1 to 0xE0000000
Re: PAE How to map the specific address?
>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.
You'd translate the virtual address into its pml4e number, pdpte number, etc., and then set the entries appropriately.