Question on paging

All development related issues welcome

Moderator: Moderator Team

Post Reply
reminton
Posts: 2
Joined: Tue Dec 09, 2008 4:15 am

Question on paging

Post by reminton » Tue Dec 09, 2008 4:26 am

I am a new reader on ReactOS. I am learning 0.3.6. I found some questions on paging for i386.
In freeldr.sys, function FrLdrStartup will set up the PDE and PTE for ntoskrnl.exe. The PDE for
0xc0000000 is point to startup_pagedirectory. But an entry of PDE should point to a PTE, not a PDE
itself, is it a bug? Or we should set this PDE entry to 4M pages?
Another problem is for paging of APIC. This function set PDE for 0xffc00000 to apic_pagetable, but
the base physical address for local APIC should be 0xfee00000, how it works?

vicmarcal
Test Team
Posts: 2732
Joined: Mon Jul 07, 2008 12:35 pm

Re: Question on paging

Post by vicmarcal » Tue Dec 09, 2008 11:58 am

Hi remington,nice to see coding questions.. ;)

Well,as u can see we have launched 0.3.7 version and we are in half way to 0.3.8. So 0.3.6 is old.
More than 3000 commits has been done since 0.3.6... ;)

Give a look to the new code...maybe u will find the question there.
Also join us in reactos channel. All the Devs are there waiting ur code doubts.
To join us, just install Chatzilla Firefox addon and click here: [url=irc://irc.freenode.net/reactos]#reactos[/url]
Or use Mirc (or Mibbit) with: irc.freenode.net channel: #reactos
Image

arty
Developer
Posts: 19
Joined: Tue Nov 30, 2004 10:39 pm
Location: Chicago, IL

Re: Question on paging

Post by arty » Tue Dec 09, 2008 12:04 pm

I can answer your question at least about startup_pagedirectory. Since the PDE and PTE format is similar, you can use that to map a page table at the same address in phyiscal and logical spaces. We use startup_pagedirectory to be able to modify the page table in place in early kernel startup.

reminton
Posts: 2
Joined: Tue Dec 09, 2008 4:15 am

Re: Question on paging

Post by reminton » Wed Dec 10, 2008 6:03 am

Though the structure of PDE and PTE are similar, but the meaning is different. I had check an address according to the PDE and PTE as follow:
When I want to use linear addres 0xc0000000, accoding to PDE, we get the physical address of startup_pagedirectory(PDE), and the remain part of
linear address are all 0s. Then CPU will regard the PDE as PTE, and find the first entry of PDE as PTE entry, that should point to lowmem_pagetable.
Therefore when I use linear address 0xc000000, I accutually get the first byte in lomem_pagetable, not PDE. Is this the goal of design?

arty
Developer
Posts: 19
Joined: Tue Nov 30, 2004 10:39 pm
Location: Chicago, IL

Re: Question on paging

Post by arty » Wed Dec 10, 2008 7:42 am

Yes that's it.

Post Reply

Who is online

Users browsing this forum: Julcar and 1 guest