OSDev.org

The Place to Start for Operating System Developers
It is currently Tue Apr 23, 2024 1:09 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Can user mode access high memory?
PostPosted: Fri Jul 31, 2020 11:07 am 
Offline
Member
Member

Joined: Tue Feb 18, 2020 3:29 pm
Posts: 1071
Hello,
While I was working on shared memory, it appears that user mode can't access memory above 0xFFFFFFFFFFF in long mode. It page faults when I do so. Is that so?
Thanks,
nexos

_________________
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg


Top
 Profile  
 
 Post subject: Re: Can user mode access high memory?
PostPosted: Fri Jul 31, 2020 11:21 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4594
Location: Chichester, UK
That's determined by your page table. You are trying to access a canonical address?


Top
 Profile  
 
 Post subject: Re: Can user mode access high memory?
PostPosted: Fri Jul 31, 2020 12:09 pm 
Offline
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 1604
No, that does work. Linux maps stack and VDSO and VVAR to very high addresses, usually just below the canonical end at 0x7fff_ffff_ffff. In case you mistyped and meant that address: Yes, under normal circumstances there is no way to map the memory between 0x8000_0000_0000 and 0xffff_7fff_ffff_ffff. Therefore this is called the canonical memory hole. Usually accessing that area should net you a general protection fault, not a page fault. I don't know what is going on with that problem for you.

_________________
Carpe diem!


Top
 Profile  
 
 Post subject: Re: Can user mode access high memory?
PostPosted: Fri Jul 31, 2020 12:58 pm 
Offline
Member
Member

Joined: Tue Feb 18, 2020 3:29 pm
Posts: 1071
nullplan, you were right. I was actually assuming it was a PF as the exception occurred in user mode. After digging a little deeper, it was a GPF and the problem is fixed now.

_________________
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg


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

All times are UTC - 6 hours


Who is online

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