Mail Archives: djgpp/2002/01/27/04:48:48
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 -