X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Charles Sandmann Newsgroups: comp.os.msdos.djgpp Subject: Re: HELP with DPMI under DOS - Part II Date: Tue, 21 Oct 2003 16:18:29 CDT Organization: Rice University, Houston, TX Lines: 24 Message-ID: <3f95a2a5.sandmann@clio.rice.edu> References: <3f944c94 DOT sandmann AT clio DOT rice DOT edu> <8N6lb.684$947 DOT 530 AT nntpserver DOT swip DOT net> <3f953833 DOT sandmann AT clio DOT rice DOT edu> NNTP-Posting-Host: clio.rice.edu X-Trace: joe.rice.edu 1066771964 15276 128.42.105.3 (21 Oct 2003 21:32:44 GMT) X-Complaints-To: abuse AT rice DOT edu NNTP-Posting-Date: Tue, 21 Oct 2003 21:32:44 +0000 (UTC) X-NewsEditor: ED-1.5.9 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com > Why are 4MB pages or swapping the 4KB page tables necessary? Can't you > just allocate some memory above 1.1MB and put the page tables that > won't fit in conventional memory there? Due to the size of a 1GB-4GB address space, you will get sub-optimal performance using 4KB pages since the address lookups can't all be cached. So using 4MB pages improves performance vs. 4KB pages. Performance testing shows improvements on a 500MB random memory array using 4MB pages. Putting all the page tables into extended address space would require a mode switch redesign - the initial page fault handler would need to run in PM to look at the tables, switch to real mode to extract a buffer from disk, then copy data from the RM buffer. This is uglier than it seems, since all the table initialization code also needs to visit protected mode (so it's multi-pass aware, first visit doesn't have page tables all set up and in right place). For these reasons, I decided implementing 4MB pages was a better way to spend time than supporting 4MB worth of 4KB page tables. PMODE avoids the issue completely by not turning on paging at all unless it must to deal with VCPI.