share a pitfall on int13h extend

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
miaowei
Member
Member
Posts: 84
Joined: Wed Dec 18, 2013 9:10 am

share a pitfall on int13h extend

Post 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.
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: share a pitfall on int13h extend

Post 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
Last edited by bluemoon on Sat Jun 06, 2015 11:36 am, edited 2 times in total.
mikegonta
Member
Member
Posts: 229
Joined: Thu May 19, 2011 5:13 am
Contact:

Re: share a pitfall on int13h extend

Post 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.
Mike Gonta
look and see - many look but few see

https://mikegonta.com
miaowei
Member
Member
Posts: 84
Joined: Wed Dec 18, 2013 9:10 am

Re: share a pitfall on int13h extend

Post 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.
miaowei
Member
Member
Posts: 84
Joined: Wed Dec 18, 2013 9:10 am

Re: share a pitfall on int13h extend

Post 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...~.~
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Re: share a pitfall on int13h extend

Post by JAAman »

if that number sounds odd to you, perhaps you missed that it is a multiple of 63
Post Reply