OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Jan 17, 2019 7:20 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Page not present after TLB invalidation
PostPosted: Sat Jan 12, 2019 11:46 pm 
Offline

Joined: Sat Apr 04, 2015 9:35 am
Posts: 17
Location: Scarborough, UK
Hi,

I've been working on a new paging implementation for my kernel for a few days now but have been running into some problems when creating a new page table. I'll list out the scenario that is causing the issue.

  • The VMM is asked to acquire the page at 0x01000000. It asks for a physical frame and then talks to the paging implementation to get the frame mapped.
  • The paging implementation checks for the presence of a page table, doesn't find one...
  • A new page table is created and a full flush of the TLB occurs to ensure the page table is seen. (Debugging in BOCHs reveals that the page table that is created is correctly mapped in the linear address space).
  • The page entry is added into the new page table (debugging this shows the entry is correctly written into the table/memory). A invlpg instruction is then issued for the page.
  • Attempting to access the page results in a Page not present exception.

I have tested this behaviour in both BOCHS and QEMU and they both exhibit the same issue.

The paging implementation that I've got so far can be found at https://github.com/tjhancocks/vkernel/b ... 6/paging.c.

I'm not entirely sure why the linear address remains invalid after invalidating the page and/or updating CR3. But its probably something small that I'm missing and just not noticing.

Any help would be greatly appreciated, thanks!


Top
 Profile  
 
 Post subject: Re: Page not present after TLB invalidation
PostPosted: Sun Jan 13, 2019 2:18 am 
Offline

Joined: Sat Apr 04, 2015 9:35 am
Posts: 17
Location: Scarborough, UK
I've managed to solve the issue myself. I had managed to accidentally create a duplicate of the page directory that had almost identical contents, but ever so slightly different. Enough to make the whole thing not work correctly.


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: Google [Bot] and 8 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