delorie.com/archives/browse.cgi | search |
X-Authentication-Warning: | delorie.com: mailnull set sender to djgpp-bounces using -f |
From: | "dom" <dcurran AT ti DOT com> |
Newsgroups: | comp.os.msdos.djgpp |
Subject: | Re: Can't read HDD sectors, why? |
Date: | Mon, 28 Jan 2002 12:53:07 -0600 |
Organization: | Texas Instruments |
Lines: | 55 |
Message-ID: | <a346d6$q8d$1@tilde.csc.ti.com> |
References: | <Pine DOT SUN DOT 3 DOT 91 DOT 1020127113826 DOT 14549Q-100000 AT is> |
NNTP-Posting-Host: | mspc0615.sc.ti.com |
X-Trace: | tilde.csc.ti.com 1012243686 26893 128.247.9.2 (28 Jan 2002 18:48:06 GMT) |
X-Complaints-To: | usenet AT news DOT ti DOT com |
NNTP-Posting-Date: | 28 Jan 2002 18:48:06 GMT |
X-Newsreader: | Microsoft Outlook Express 5.00.2314.1300 |
X-MimeOLE: | Produced By Microsoft MimeOLE V5.00.2314.1300 |
To: | djgpp AT delorie DOT com |
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
Reply-To: | djgpp AT delorie DOT com |
How do i go about locking the volume ? Your right I should have been reading sectors starting from 1, but even if I changed this _bios_disk(..) still returned the same errors as before. I also found that calling biosdisk(..) *did* work and I could read sectors. I wonder if this perhaps does a lock on the volume for you, documentation doesn't say, I guess I could download source code and look. Anyway since I can read sectors now with biosdisk(..) I'm happy enough. thanks dom Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> wrote in message news:Pine DOT SUN DOT 3 DOT 91 DOT 1020127113826 DOT 14549Q-100000 AT is... > > 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.
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |