Xref: news-dnh.mv.net comp.os.msdos.djgpp:4310 From: Charles Sandmann Newsgroups: comp.os.msdos.djgpp Subject: Re: cwsdpmi beta9 - Disk protection! Date: Fri, 12 Jan 1996 20:17:07 CST Organization: Rice University, Houston, Texas Lines: 23 Message-ID: <30f71623.sandmann@clio.rice.edu> References: Reply-To: sandmann AT clio DOT rice DOT edu NNTP-Posting-Host: clio.rice.edu To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp > In the latest version of the cwsdpmi program (beta9), what is the correct > method of redirection the int24 interrupt vector. This is required so that > the program prints up a user friendly message box if the user tries to > access the drive, when there is no disk within the drive. The method I was > using, worked for the previous version, but now issues a page fault with > error=0006. The previous version did not force you to lock the code called in a real mode call back. This left the potential of destroying the structure of the hard disk in certain situations if the machine was tight on memory. Using the wrappers should lock most of the memory needed, but you will still need to lock the code, data (and register structure). The error message from CWSDPMI tells the EIP of the page fault (so you can track down the executable line) and the CR2 value (typically drop the first one and use a debugger to convert the address to a symbolic value to see what wasn't locked). This may be painful, but it's the only way to make sure code doesn't get distributed with my name on it that destroys someone's hard disk. You can either use the new crt0.h feature to lock all memory if you don't need virtual memory, or CWSDPR0 if ring 0 and no VM is OK.