copying from addr@ 2GB to addr@ 6GB

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
sawdust
Member
Member
Posts: 51
Joined: Thu Dec 20, 2007 4:04 pm

copying from addr@ 2GB to addr@ 6GB

Post by sawdust »

I have PAE enabled paging and want to copy a buffer from addr 2GB to an addr at 6GB. To access 6GB, we need to load the respective PDPTR. If I switch the PDPTR, how can I access the code and data in lower 4GB range?
Thx
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: copying from addr@ 2GB to addr@ 6GB

Post by AJ »

Hi,

I only really have experience with PDPT's in long mode, but think it works the same, so here goes.

I think you are confusing physical and virtual memory. PAE lets you access > 4GiB of physical RAM, but you still have the same 4GiB linear address space (in Protected Mode - long mode gives you a wider Virtual space too). That means that you page in the 2GiB mark somewhere in your virtual address space, also page in the 6GiB mark anywhere in your virtual address space and away you go.

Alternatively, use long mode and you'll have plenty of virtual address space to page in your entire physical range.

Cheers,
Adam
Post Reply