delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/07/28/06:30:19

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: Paul Wilkins <disk AT paradise DOT net DOT nz>
User-Agent: Mozilla Thunderbird 0.6 (Windows/20040502)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Interpreting return value from _bios_disk
References: <354933d6 DOT 0407280136 DOT 42e3b0e2 AT posting DOT google DOT com>
In-Reply-To: <354933d6.0407280136.42e3b0e2@posting.google.com>
Lines: 38
Message-ID: <g3LNc.838$zS6.103809@news02.tsnz.net>
Date: Wed, 28 Jul 2004 22:15:32 +1200
NNTP-Posting-Host: 218.101.50.29
X-Complaints-To: abuse AT tsnz DOT net
X-Trace: news02.tsnz.net 1091009868 218.101.50.29 (Wed, 28 Jul 2004 22:17:48 NZST)
NNTP-Posting-Date: Wed, 28 Jul 2004 22:17:48 NZST
Organization: TelstraClear
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Goh, Yong Kwang wrote:
> Hi.
> 
> I'm writing a simple program to read read a floppy at the sector
> level, so I'm using _bios_disk.
> 
> Apparently, there are some bugs in the documentation and example for
> _bios_disk.
> After reading some previous postings by other users, it appears to me
> that
> 
> the line in the example:
> 
> di.buffer = &record_buffer;
> 
> ought to be changed to:
> 
> di.buffer = record_buffer;
> 
> since record_buffer is declared as: 
> 
> char record_buffer[512];

That makes good sense.

> Secondly, the way of interpreting the return value is not just
> comparing it to zero for success and non-zero otherwise. Since AL also
> contains the number of sectors read (I'm only currently experimenting
> with _DISK_READ so far),
<snip>

If it helps here's some example code of biosdisk()

Code to probe floppy geometry. For Turbo C, DJGPP, or Watcom C.
http://my.execpc.com/~geezer/osd/boot/size.c

-- 
Paul Wilkins

- Raw text -


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