Page 1 of 1

share a pitfall on int13h extend

Posted: Sat Jun 06, 2015 8:38 am
by miaowei
In a word:don't read more than 256 sectors using one 'DAP', set your 'si' point to another 'dap' to read more.

------------------------------------------------
this pitfall cost me about 3 hours tonight.
In fact, I ever heared about that some BIOS limits 'SECTOR COUNT' to 127. I just thougt that we can fill the 'SECTOR COUNT' field of 'DAP' with a digit smaller than 127 but can call int 13h with a same 'DAP' many times(increment the 'LBA' and 'BUF ADDR' field). However, my understanding is wrong. we have to switch 'si' to another 'DAP' if we want to read more.

Re: share a pitfall on int13h extend

Posted: Sat Jun 06, 2015 9:23 am
by bluemoon
Don't assume the magical 256. Check the actual read count set by BIOS service (in the DAP).

Also, setting sector count more than 128 require crossing a segment boundary, which I believe some ancient BIOS may go crazy.

http://www.ctyme.com/intr/rb-0708.htm

Re: share a pitfall on int13h extend

Posted: Sat Jun 06, 2015 10:19 am
by mikegonta
miaowei wrote:In a word:don't read more than 256 sectors using one 'DAP', set your 'si' point to another 'dap' to read more.
this pitfall cost me about 3 hours tonight.
In fact, I ever heared about that some BIOS limits 'SECTOR COUNT' to 127. I just thougt that we can fill the 'SECTOR COUNT' field of
'DAP' with a digit smaller than 127 but can call int 13h with a same 'DAP' many times(increment the 'LBA' and 'BUF ADDR' field).
However, my understanding is wrong. we have to switch 'si' to another 'DAP' if we want to read more.
One "DAP" should work fine for multiple BIOS function calls.
SudoBIOS uses one low memory global "DAP" (the users high memory "DAP" is copied to it and the input/output is re-buffered using a
low memory buffer).
There must be something else involved.

Re: share a pitfall on int13h extend

Posted: Sun Jun 07, 2015 7:12 pm
by miaowei
There must be something else involved.
I am afraid so.
I gave another try when I got up from bed the next morning。I called int13h two times, and read 250 sectors each times, it worked fine.

Re: share a pitfall on int13h extend

Posted: Sun Jun 07, 2015 7:13 pm
by miaowei
bluemoon wrote:Don't assume the magical 256. Check the actual read count set by BIOS service (in the DAP).

http://www.ctyme.com/intr/rb-0708.htm
Really.
It's not 256, and even not 255, about 252...~.~

Re: share a pitfall on int13h extend

Posted: Mon Jun 08, 2015 7:56 am
by JAAman
if that number sounds odd to you, perhaps you missed that it is a multiple of 63