From: ams AT ludd DOT luth DOT se (Martin Str|mberg) Newsgroups: comp.os.msdos.djgpp Subject: Re: Fixed stack size? Date: 5 Aug 1999 18:20:12 GMT Organization: University of Lulea, Sweden Lines: 28 Message-ID: <7ockks$hgf$1@news.luth.se> References: NNTP-Posting-Host: queeg.ludd.luth.se X-Newsreader: TIN [UNIX 1.3 950824BETA PL0] To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Eli Zaretskii (eliz AT is DOT elta DOT co DOT il) wrote: : On 25 Jul 1999, Martin Str|mberg wrote: : > Welllll... If the pages is unmapped shouldn't the DPMI server realise : > that a pointer that is outside the allocated amount of memory should : > result in SIGSEGV? : : I think you are confusing ``unmapped'' with ``paged in''. A page : whose address is inside the segment limits is ``mapped'', but not : ``paged in'' until you touch some address inside that page. When you : do touch that address, a page fault indeed happens, but it is handled : by the DPMI host which brings the page into memory and returns to the : client. If this were not how it works, you would have been hit by a : SIGSEGV each time you accessed another 4KB part of a large malloc'ed : block. No I don't think I do. Physically it would be mapped in but as the DPMI server hasn't given it to a client to use it's logically unmapped. So the server has to decide when page fault happens, if it's logically unmapped, to deliver a SIGSEGV; or if it _is_ mapped, swap in the page and let the client continue. In one sentence, the DPMI server will use page faults to generate SIGSEGVs. Shostakovich, String Quartet 14, MartinS