watlers_world wrote:I've always heard the word BIOS used for the system BIOS-ROM.
I've never really heard anyone call software interrupt hooks "BIOS functions".
I think the reason is because you can hook interrupts for the sole purpose of software functions.
The BIOS is in ROM (or something like an EPROM or EEPROM), but as the computer boots it is loaded into RAM. The same thing happens with your Operating System and other applications, though they are stored on a hard drive or floppy instead of ROM. As your computer boots, things get extracted from the disks and ROMs and stored in RAM. That's why even though in DOS you start out with 640k of conventional memory, after you boot you have somewhat less than 640k. Part of what is stored there is the software associated with the BIOS and DOS interrupts.
The way it originally worked was that the first 32 interrupts (0-1Fh) were reserved for BIOS and hardware/CPU functions (e.g., INT 0 is issued when the CPU detects a divide-by-zero error). Interrupts 20h-FFh were allowed to be used by the Operating system. E.g., the main DOS interrupt is 21h. Also, as things progressed, things got a little fuzzier. E.g., the original PC only had 8 hardware interrupts (IRQ's 0-7) which were assigned to software Interrupts 08-0Fh. In the later computers, they added 8 more hardware interrupts (8-15) which were assigned to software interrupts 70-77h. The processing of the hardware interrupts (IRQ's) is considered a low-level (hardware/BIOS) function, not an OS function, even though half of the IRQ's are processed with software interrupts above 1Fh. You can blame that on a lack of planning from Intel and IBM.
Also, just so you know, the difference between a hardware interrupt (IRQ) and a software interrupt (INT) is simply in what causes it to occur. An IRQ is initiated by a piece of hardware inside the computer (like a key being pressed or released on the keyboard or a clock counting down to zero), while a software interrupt is initiated (usually) by an INT call from software. What happens when the interrupt is generated is stored in RAM in both cases, so you can modify or look at what happens when the IRQ or INT is generated. E.g., you can modify what happens when you press or release a key on the keyboard by modifying the software code of INT 09, which is called whenever a key is pressed or released. You can also call INT 09 directly from software if you want, but that is not a good idea. Part of the software code associated with IRQ's (like INT 09) interacts with the hardware that initiated the IRQ (the keyboard), so if you call INT 09 from software the INT 09 code will try to interact with the keyboard when the keyboard isn't expecting anything to happen and you can end up with a big mess (this will often cause crashes).
watlers_world wrote:Do you plan to place your code within a piece of hardware such as the BIOS-ROM?
No, that would make what my programs do part of the BIOS (which is stored in ROM). In my opinion, what my USB programs do should be included in modern computer BIOS's, but that is never going to happen. I consider what the programs do to be essentially a BIOS-level function (theoretically could by used by any Operating System), which is why I chose INT 14h as the interface for the functions (INT 14h is the BIOS Serial interrupt and USB is a Serial Bus).
watlers_world wrote:If the USB controller is a USB 2.0 controller will each of it's UHCI have a separate 12mb?
Sort of. The USB 2.0 (EHCI) controller controls the entire (480 Mbps bus). The EHCI controller only handles the USB 2.0 (high-speed) devices attached to the bus, though. To handle the low-speed (1.5 Mbps) and full-speed (12 Mbps) devices, the EHCI controller passes control to another device. In older USB 2.0 hardware, this was done through UHCI or OHCI companion controllers. When a device was plugged in to the bus, the device is queried to see what its maximum speed is, and if it's high-speed the EHCI controller manages the device and if it's not high-speed the EHCI controller passes control to the UHCI or OHCI controller. Each companion controller manages its own 12 Mbps bus, but the busses all share the same 480 Mbps provided by the EHCI controller. In EHCI, each 12 Mbps bus is "managed" by a separate USB 1.0 controller but it is not really a separate bus like it is when you don't have USB 2.0.
In more modern implementations, they have gotten rid of the companion controllers and just use a Hub that can handle all three speeds. So, instead of an EHCI controller and several UHCI or OHCI controllers, you just have an EHCI controller and a Hub.