delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/07/30/03:15:10

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: gohyongkwang AT hotmail DOT com (Goh, Yong Kwang)
Newsgroups: comp.os.msdos.djgpp
Subject: Read by sector or Read by track more efficient?
Date: 30 Jul 2004 00:14:39 -0700
Organization: http://groups.google.com
Lines: 25
Message-ID: <354933d6.0407292314.b48ea86@posting.google.com>
NNTP-Posting-Host: 137.132.3.9
X-Trace: posting.google.com 1091171680 15997 127.0.0.1 (30 Jul 2004 07:14:40 GMT)
X-Complaints-To: groups-abuse AT google DOT com
NNTP-Posting-Date: Fri, 30 Jul 2004 07:14:40 +0000 (UTC)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hi. I'm currently using _bios_disk function in a simple program to
explore raw floppy disk content.

To read an entire floppy disk, afaik, there's two way when calling the
_bios_disk function.

Method 1 is to read the entire track in a single call by specifying
the number of sectors to read as the number of sectors per track and
to loop thru all the tracks for an entire disk. Drawback is that it's
impossible to identify which sector of the track is bad/unreadable
when the function call fails.

Method 2 is more fine-grained by having an additional loop that loops
thru all the sector in a track one-by-one, reading in 1 sector per
function call. Appears to be slower but allows the program to identify
which specific sector is bad/unreadable.

Which would be faster and more efficient? Theoretrically, method 1
appears to be faster but given the slow mechanical speed of the floppy
drive, the boost in microseconds in terms or program execution may not
be prominent enough to rule overwhelmingly in favor of method 1
anyway.

Anyone tested out the speed difference using both methods? How
faster/slower does each one run compared to the other?

- Raw text -


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