Hi,
Czernobyl wrote:Brendan, with all due respect, ... it IS an emulation. There is no reason not to call it as such, and indeed it is analogous in many respects to BIOS El torito CD/DVD booting : BIOS has a USB stack, most of the lower level routines being in SMM protected RAM (for no special technical reason except there might not be enough room in regular "visible" BIOS ROM space). The int 13 "high level" API calls down to the appropriate hardware routines according to the medium type, like you say. I don't see why on earth it couldn't be called an "emulation" when flash RAM thru USB is "disguised" by the BIOS as a floppy (or hard disk) with some unusual parameters nut... that's me, and it's only a matter of wording.
It's analogous to "no emulation El Torito". The only reason for SMM to be involved would be to avoid "split brain" problems caused by both PS/2 emulation and the "int 0x13" trying to use the same USB controller (for different USB devices) at the same time.
Czernobyl wrote:There's no BIOS function to "release" the USB storage device
Yet the BIOS
will release it as part a reboot sequence (be it "warm"). there evidently IS a routine that does the orderly release, including the flushing of buffers (and YES the BIOS must maintain at least one sector buffer, just stop to think a minute ! I've LOCATED such buffer in BIOS-managed RAM on this machine I'm now at ...
If you remove a SATA hard drive and do a warm boot does that mean the hard drive was "released"?
Please note that I never said there wasn't any sector buffer, and only said that if there is a sector buffer it doesn't require flushing, because the transfer must complete before the BIOS can determine if the read/write succeeded, which must happen before the BIOS can return status back to the caller.
The only reason I can think of for a sector buffer to be needed is if the USB controller's DMA transfers require some sort of alignment, where the hardware can't transfer sectors directly to/from the address the caller specified if that address doesn't meet the USB controller's alignment requirements. There are no such alignment restrictions for OHCI, UHCI, EHCI or xHCI USB controllers.
It's far more likely that what you think you saw is actually an area that the USB controller uses to store "transfer descriptors" that are used to arrange DMA transfers between the device and RAM. All USB controllers (that I know of) require something like that.
Note: "transfer descriptors" is a massive oversimplification and it's typically more like an elaborate system of lists containing many different type of entries where only some of those are for data transfers.
Czernobyl wrote:So, what you said can only have one sensible meaning, id est, there is no public, BIOS independent, interface for USER to ask BIOS to release the USB emulation.
Sadly this is a possibility : are you CERTAIN or just guessing ?
Unfortunately for the last 10 or 15 years more and more interfaces have gone opaque, as in : reserved to industry comity members.
If you asked me if unicorns actually exist, I'd tell you "no" and I'd be certain, but I would also be guessing (it's impossible to prove that unicorns don't exist somewhere in the universe). In the same way, I'm both certain and guessing that what you're hoping for doesn't exist - there's no evidence to suggest it exists and no reason for it to exist, but it's impossible to prove that (e.g.) some strange Compaq machine didn't have it as an obscure and undocumented feature back in 1992.
Cheers,
Brendan