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!!!
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
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