Date: Thu, 25 May 95 03:04:14 -0400 From: Wonkoo Kim To: "Junaid A. Walker" , Charles Sandmann Reply-To: Wonkoo Kim Cc: mat AT ardi DOT com, DJGPP Mailing List Subject: Re: Compiling gdb, dpmi DS:VRAM hack. > Date: Thu, 25 May 95 12:27:27 +1000 > From: "Junaid A. Walker" > /* Well here it is; how to access video ram at 0xa0000 without using > a segment overide (ie using the current process's DS). Works well > under MS Windows 3.1 in a full screen DOS box. Try running this app > in the background (DOS settings 'Runs in Background' crossed).Then > switch away from this app (CTRL-ESC) and run any other program. > Windows will remap the video ram at 0xa0000 to a temporary system > ram buffer while this app runs minimized; hence this app will > run faster when minimized. The screen will be correctly restored > when we switch back to this app. > This program works by removing the segment limit on DS and > using 32-bit wrap around in the linear address space to access > memory at linear address 0xa0000. In fact we now have access to > all memory including DOS conventional memory. This circumvents > all memory protection (except unmapped memory), so best to save > the original DS for normal use, and use the new unlimited DS for > the duration that video memory access is needed. > Compile with 'gcc prog.c -lpc' and then 'go32 prog'. You > should see some blue lines more down the screen for a while, after > that it will display the 16-bit speed of your video card. > > Al-Junaid Walker 22/5/95. > */ I tested on P90/16MB, ATI Graphics Ultra+/2MB, in a DOS box under OS/2 Warp: ---------------------------- initial ds segment limit=0005FFFF USING DPMI. DPMI VERSION=95 Current DS linear base address=00400000 Remapped Video RAM process virtual address=FFCA0000 New DS linear address limit=FFFFFFFF PRESS ANY KEY TO CONTINUE [I selected another window after a key, to put into background.] 1000 blits took 2911ms. Blit rate=10992KBytes/s ----- No crash. BTW, in full-screen DOS box, upper part of screen was drawing down something like staircases, but middle and bottom parts were flashing with many blue stripes. Was it normal? //-------------------------------------------------------------------- // Wonkoo Kim // wkim+@pitt.edu