I started testing Sergey's new BIOS on my prototype XT-FDC card
Thanks!
One thing I discovered early is that if the PC or XT computer has a hard disk controller, the address of the BIOS chip in that controller needs to be lower than the address of the BIOS chip in the XT-FDC (so that the hard drive controller BIOS is called first).
Well, this is due to the deficiencies in BIOS's handling of extension ROM initialization.
By default (this could be changed), the Multi-Floppy BIOS extension is initialized as follows:
1. BIOS POST does the extension ROM scan and calls Multi-Floppy BIOS extension's initialization procedure.
2. The initialization procedure:
- Prints the copyright message
- Prints the current configuration
- Sets floppy bits the BIOS equipment word according to the number of configured floppy drives.
- Hooks up to the following interrupts:
* Int 13h or Int 40h depending on the presence of the hard drive BIOS. (Int 40h if hard drive BIOS is installed, Int 13h otherwise). The previous vector (hopefully the BIOS floppy disk service) is overwritten and won't be ever called again during this session.
* IRQ6 (Int 0Eh) - hardware interrupt used by the primary FDC
* IRQx (Int 08h + x) - hardware interrupt configured for the secondary FDC (only if secondary FDC is configured)
* INT 8 (IRQ0 - timer) (only if secondary FDC is configured). This is needed to turn of motors of the drives on the secondary FDC (system's INT 8 should be taking care of the primary FDC drives). The previous vector is stored, and Multi-Floppy BIOS basically chains to it.
* INT 19h - boot. BIOS calls this interrupt to boot the system. Multi-Floppy BIOS doesn't use it to boot the system (yet, but perhaps it should, or at least it might be a configuration option in the future). See INT 19h ISR below. The initial vector is preserved...
- Unmask IRQ6 and IRQX (one for the secondary FDC) on 8259 PIC.
3. BIOS continues with the BIOS extension scan and other initialization stuff
4. BIOS calls Int 19h to boot the system
5. Multi Floppy BIOS extension Int 19h handler does the following:
- Displays the configuration prompt (press F2...)
- If F2 is pressed - runs the configuration utility
- Sets floppy bits the BIOS equipment word according to the number of configured floppy drives (again)
- Control is passed to the previous (before Multi-Floppy BIOS) Int 19h vector, which finally boots the system.
It is possible to configure BIOS (not from the configuration utility, but by hacking config bits) so it will be showing the configuration prompt and update the equipment word either during the BIOS extension initialization (step 2), in Int 19h (step 5), or in both cases. The current configuration is a tradeoff that works on 3 systems I tested the BIOS on (an XT clone, an 386 AT clone, Xi 8088).
Initially I didn't use Int 19h at all, and the configuration prompt was shown during the BIOS extension scan. Unfortunately my XT clone BIOS has two issues with this:
1. Keyboard is not enabled (and looking at an XT clone BIOS listing, it is not even configured). So while the prompt is displayed, nothing happens then F2 is pressed (well, not exactly nothing - you get a keyboard error later)
2. It overwrites the floppy equipment bits probably according to the jumpers settings on the motherboard.
The problem with hard drive BIOS extension / Multi-Floppy BIOS extension address order happens because if the hard drive BIOS extension is initialized after the Multi-Floppy BIOS, it will hook up to the Int 19h, and will not call the original vector (Multi-Floppy BIOS Int19 ISR). Still the floppy BIOS should be working. It just the configuration utility can't be accessed in this case.
I want to do some more testing (e.g. 2.88M drive), but presently, I don't see any reason to hold off on production of the next batch of PCBs.
I tested the BIOS with IBM PS/2 2.88M drives, the only weird thing that I've noticed is that disk change detection seems not to work with them.