From: "Ben Peddell" Newsgroups: comp.os.msdos.djgpp References: Subject: Re: call to 'open' causes all sleeping drives to awaken! Lines: 68 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Message-ID: Date: Fri, 21 Feb 2003 02:12:56 +1000 NNTP-Posting-Host: 144.139.175.47 X-Trace: newsfeeds.bigpond.com 1045756962 144.139.175.47 (Fri, 21 Feb 2003 03:02:42 EST) NNTP-Posting-Date: Fri, 21 Feb 2003 03:02:42 EST Organization: Telstra BigPond Internet Services (http://www.bigpond.com) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com I seem to have reproduced it under plain MS-DOS. I created a 32MB ramdrive, and put the necessary files (testopen.*, cws*.*, command.com) into it. I then waited for my harddrive to spin down. Then, I ran testopen. It would wake up my harddrive. So, I ran the program under FSDB. I then executed until main(), and then waited for my harddrive to spin down. I then continued execution. It did not wake up my harddrive. So, I ran it under MS-DOS Debug. I traced the waking-up to within CWSDPMI (before actually running the COFF image). There was also another wake-up when running the COFF image. So I ran the program under fsdb again. I then waited for my harddrive to spin down again. I then traced through the code before main(). The wakeup occurred when __crt0_load_environment_file() was called. I then ran cwsparam, and told it to put a swapfile cwsdpmi.swp of no greater than 4096 pages in the ramdrive. I also set the path, comspec, tmp and temp to a directory/file in the ramdrive. Upon running the program again, it did not wake up my harddrive. So, if you're running under MS-DOS, then ensure that cwsdpmi is in the same directory as your program (just like Quake), and that its swapfile is set to be on drive C:, or even disabled (just like the CWSDPMI.EXE that comes with Quake), and that, if it's enabled, it does not exceed the amount of free space of your harddrive (the default maximum is about 128MB). If you're running under Win9x or WinME, then I don't see how all of the drives would wake up, unless it's a bug in Windows. If you're actually running under WinNT, Win2k or WinXP, then it's possible that you've put part of the Windows swapfile on each of the drives, and this is why it's waking them up. Sander Pool wrote in message news:b30ki601hek AT enews1 DOT newsguy DOT com... > > "Ben Peddell" wrote in message > news:QqK4a.51044$jM5 DOT 127842 AT newsfeeds DOT bigpond DOT com... > >> Why not find out whether the drives are spinning-up before or after the > > open() is issued, by printing something before the open(), and waiting for > > user input. > > I could do that but I suspect that printf uses open() as well so it wouldn't > prove anything. It would be better to remove the open() call and see if the > same thing happens. > > > If it is occurring before the open(), then it is probably the stub loader > > searching for CWSDPMI.EXE on the path. If you don't want this to happen, > > then ensure that DPMI is active before running the program. > > I'll check it out but like I reported, MinGW doesn't have this problem so I > see no reason to change my system config to make DJGPP work. I know there > are probably a lot of good reasons to use DJGPP over MinGW but I don't want > to (re)start a religious war over that :-) I'm merely reporting a problem > that someone may want to reproduce and fix. > > Thanks, > > Sander > > >