Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

EDIT: Protectmode handler called from realmode (Developers)

posted by bretjohn Homepage E-mail, Rio Rancho, NM, 13.08.2010, 19:25

> I don't think it makes any recursive INT 13h calls (I'll verify this before
> the next release).

I just checked, and USBDRIVE does, in fact, make a recursive INT 13h call in one place, which I believe is justified.

I make a recursive call in INT 13h, function 8 (Get Drive Parameters). One of the values this returns is the total number of INT 13h drive currently numbers in use (in the DL register). The only way I know of to test whether a specific INT 13h drive number is valid or not is to issue a different INT 13h request, function 10h (Check Ready).

Since there is the possibility that another INT 13h TSR driver could have been installed after USBDRIVE, at the time the "Get Drive Parameters" request is made to USBDRIVE, it does not know for certain how many INT 13h drives are currently in existence. The only way to calculate this is to issue an INT 13h "Check Ready" request for each possible INT 13h disk number, and count up how many appropriate responses are received. This is what USBDRIVE does.

The other possibility is to use the value stored in the BIOS Data Area (BDA) at 0040:0075, which is supposed to be the number of INT 13h drives (according to the BIOS). However, I have been told by what I consider to be reliable sources that this number cannot always be trusted for various reasons (i.e., SYS or TSR drivers do not always update this value when they should, or drivers that get uninstalled may leave "holes" in the INT 13h numbers that can cause problems in certain cases).

It's possible that INT 13h, function 8 simply expects the number from 0040:0075 to be copied into DL for the return, but that is not what USBDRIVE does.

Any suggestions or commentary?

 

Complete thread:

Back to the forum
Board view  Mix view
22755 Postings in 2121 Threads, 402 registered users (2 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum