Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

BIOS EDD doesn't update BlockCount field ?

0 views
Skip to first unread message

mElo

unread,
May 8, 2002, 3:56:03 PM5/8/02
to
hi all,
I'm coding a little tool to verify the sectors of my ZIP diskette using BIOS
enhanced disk drive functions (Int13h Fn41-48) but there is a thing that
doesn't seem to work as described in the specification.

I call Fn44h to verify sectors after having filled a device address packet.
I request it to read 10 sectors, but when an error is encountered (a bad
sector), carry is set (good), AH=error code 0A (bad sector code) BUT the
block count field in my address packet remains unchanged. I expect it to
hold the number of good sectors read until the error occurs!!!

mElo

unread,
May 8, 2002, 3:56:05 PM5/8/02
to

Because of this I must read one sector at a time, what is much much
slower...

The same thing appends with read and write functions.

Notes: I code it in assembly (NASM) and C (BC4).

Please help a little programmer who spent few nights on it yet.
mElo
bye&thanx

Lawrence

unread,
May 9, 2002, 3:55:59 AM5/9/02
to
Hi mElo,

Some BIOSes do not conform to the EDD spec beyond basic reading and
writing. Especially EDD 3.0. If you read several sectors at a time,
and there is an error, then some BIOSes will even return 0 in the sector
count field. Other BIOSes, as you have discovered, simply forget to
update it.

Fear not! Here's what to do: Go ahead and issue multisector reads (up
to 7Fh sectors is legal). If you get no carry, then proceed to the next
block. If you get a carry, then go back to the base of the block and
read one sector at a time, looking only for a carry. This will keep
your program fast because errors are very rare.

Tip: Make sure to start your reads on addresses which are multiples of
8 bytes ("ALIGN 8") or ideally 64KB.

Another tip: Do not rely on the "sector size" information returned by
AH=48h. Instead, fill 64K of memory with 12345678h, read 1 sector to
offset 0, then scan backwards from the end of the segment until you hit
the first non-12345678h.

Lawrence

0 new messages