X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Paul Wilkins 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> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Lines: 38 Message-ID: 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), 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