From: Charles Sandmann Subject: Re: Compiling gdb, dpmi DS:VRAM hack. To: mat AT ardi DOT com, djgpp AT sun DOT soe DOT clarkson DOT edu (DJGPP Mailing List) Date: Wed, 24 May 1995 15:11:35 -0500 (CDT) Forwarded message: To: junaid AT barney DOT eng DOT monash DOT edu DOT AU (Junaid A. Walker) Date: Tue, 23 May 1995 19:49:16 -0500 (CDT) Cc: djgpp AT sun DOT soe DOT clarkson DOT edu (DJGPP Mailing List) > Finally here's a hack to make conventional memory accessible > to DS under dpmi - Sure hope that the V2.0 cswdpmi emulator supports > this hack.... use 'gcc f.c -lpc' to compile. Yes, this should work just fine under cwsdpmi or V2 as it works under Win 3.1 *BUT*: 1) This code will work in certain circumstances but not others. The algorithm is bugged in that it assumes the base of DS will not change. This may not be true if you call malloc() or any libc routine which calls malloc(). You must recompute the address if sbrk() gets called, and reset the limit. 2) Not all DPMI providers allow you to set limits which span memory you do not own. In this case this algorithm does not work at all. 3) As noted, this bypassses all memory protection under Windows, so a bad pointer will crash Win instead of giving a GPF traceback.