From: ovek AT arcticnet DOT no (Ove Kaaven) Newsgroups: comp.os.msdos.djgpp Subject: Re: DPMI and Page swapping Date: Fri, 25 Apr 1997 01:05:16 GMT Organization: Vplan Programvare AS Lines: 36 Message-ID: <5jonoc$n00$1@troll.powertech.no> References: NNTP-Posting-Host: alwayscold.darkness.arcticnet.no To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk "Gurunandan R. Bhat" wrote: >On Tue, 22 Apr 1997, Eduard Ralph wrote: >> When you try to access a page of memory (beign 4k big) which is >> currently swapped to disk, the processor generates an exception. From >> there the handler takes over. It chooses a page which was accessed the >> least, though it can choose any one, swaps that to disk and then loads >> the page from disk. It then proceeds to change the GDT or IDT what That's the Page Table. (GDT is Global Descriptor Table, IDT is Interrupt Descriptor Table.) >> ever to correct the info and then calls up the instruction which >> caused this fault. Generally it work fine and the software continues >> as if it had never been interrupted. >> The DPMI Server, which takes over this job, must know which are >> swapped out and which are not, because a flag in the Table tells him >> of the status. >yes that is correct. there is a bit in the descriptor "p" (for present >i think, check the libc.a docs for __dpmi_get_descriptor(...)) which >tells whether the segment is present in ram or paged. in fact i just >discovered that virtual memory managers use this bit for their jobs. No, that's a different kind of memory management, probably used by Windows/286 to implement "discardable" segments, and such. Segments can have arbitrary base addresses and lengths, and so have no relation to pages at all. Pages were introduced in the 386, and segment-swapping is now obsolete. But yes, page tables also have a "Present" bit. When this bit is clear, everything else in this entry is ignored, and is frequently used by the memory manager to store the position on disk where the page is saved.