delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/01/27/04:48:48

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 <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: dom <dcurran AT ti DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Can't read HDD sectors, why?
In-Reply-To: <a2vj7c$jje$1@tilde.csc.ti.com>
Message-ID: <Pine.SUN.3.91.1020127113826.14549Q-100000@is>
MIME-Version: 1.0
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

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.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019