X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f Date: Sun, 27 Jan 2002 11:47:30 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: dom cc: djgpp AT delorie DOT com Subject: Re: Can't read HDD sectors, why? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Sat, 26 Jan 2002, dom wrote: > I want to read sectors from my HDD. > I am using the following code (which is almost identical to the help code > for _bios_disk). > > If I run this code from a Win98 dosbox then it returns a status of 0x50 > (Data read error && Seek error). IIRC, Windows 9X requires that you lock the volume before it allows direct access on the sector level. > If I run this code after booting to the dos prompt using a Win98 boot disk > it returns a status of 0x01 (Invalid request or a bad command). > > Can anyone tell me why ? Here's why: > di.sector = 0; The first sector on a disk is number 1, not zero. > I thought that when booting to the DOS prompt using a Win98 boot disk, I > would be in a 16-bit enviroment. Is this true ? I don't understand what do you mean by ``16-bit environment''. DJGPP programs always run in 32-bit protected mode, even on plain DOS (the DJGPP startup code switches the CPU into protected mode). > Might this have something to do with it ? No.