OSDev.org

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

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Question: One memory access over two pages
PostPosted: Mon Feb 20, 2017 2:23 am 
Offline
Member
Member

Joined: Tue Aug 26, 2008 11:24 am
Posts: 159
Hello guys and girls,

As I read the last thread about paging, a question arises in my mind:
What happens, if you have paging with two pages not mapped to sequential physical memory, and then make one instruction that accesses both pages?

An Example:
Lets assume we have two 4kb-pages. In virtual memory the first page is from 0 to 0xFFF and the second page goes from 0x1000 to 0x1FFF.
But they are mapped not sequential. Lets assume the first page to map to address 0 and the second page to 0x4000.
What happens, if I make a dword (4 byte) access on virtual address 0xFFE? Will the MMU recognize, she has to split the access into two accesses - one word (2 byte) at physical 0xFFE and one word at physical 0x4000? Or will it access the wrong memory from 0xFFE to 0x1001? Will there be a GPF?

Best regards
Sebi


Top
 Profile  
 
 Post subject: Re: Question: One memory access over two pages
PostPosted: Mon Feb 20, 2017 2:32 am 
Offline
Member
Member

Joined: Tue Mar 04, 2014 5:27 am
Posts: 1108
Page translation must be (mostly) transparent or it would be problematic to use. The answer is that the CPU will figure it out for you.

However, at some point intel said that the TSS must lie in physically contiguous memory when page translation is enabled. They hadn't had such a limitation documented in their 80386 and 80486 documentation. Make of it what you will.


Top
 Profile  
 
 Post subject: Re: Question: One memory access over two pages
PostPosted: Mon Feb 20, 2017 4:38 am 
Offline
Member
Member

Joined: Sat Nov 10, 2012 1:16 pm
Posts: 62
To answer the question: there should not be a GPF. There probably will be a page fault. There may also be an alignment check fault if you've enabled that (if you have, you should get that immediately prior to the page fault, meaning you could potentially fix the issue in the alignment check handler).


Top
 Profile  
 
 Post subject: Re: Question: One memory access over two pages
PostPosted: Tue Feb 21, 2017 1:48 am 
Offline
Member
Member

Joined: Tue Aug 26, 2008 11:24 am
Posts: 159
Thank you! I think I will just try it.


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], FrankRay78, Google [Bot] and 49 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