• Please review our updated Terms and Rules here

Sergey's 8-Bit FDC + XT-IDE

2. "change the Boot Settings -> Number of Floppy Drives from Auto to 4". My guess is that during the XUP initialization, Multi-Floppy BIOS was not yet installed, and therefore by default XUP was using 2 drives. Setting that to 4 makes XUP to boot from the 4th drive (counting from zero)
Oh - I hadn't thought of that - I'm not sure which was initializing first.

Does the one with a lower ROM address initialize first?

Thanks for the info!
 
Does the one with a lower ROM address initialize first?
Technically speaking, yes, however, according to the first paragraph within post #15 at [here], the XUB (later versions, not early versions) employs a "late initialization" mechanism in which the vast bulk of initialisation gets put off until later. So, in effect, the Multi-Floppy BIOS will always initialise before the XUB.

You can see that in example #1 at [here]. The XUB is sitting at a lower address than the Multi-Floppy BIOS, but the Multi-Floppy BIOS' banner/splash text appears before that of the XUB.
 
This behavior seems to happen due to the way XUP enumerates the drives for the IPL (initial program loader/boot) purposes is different from the way DOS enumerates drives. It might be a bug or a feature... I'll let Krille decide ;)

The MS-DOS (at least version 6.22 of it), assigns drive letters as follows:
  • A: and B: to the first two floppy drives. If only one drive present, it will be assigned both A: and B: letters... so that it is possible to emulate working with two floppy drives, e.g. copying files from floppy to another floppy
  • Next come HDD primary partitions - of the first HDD, second HDD, etc.
  • After that follow logical drives in extended partitions
  • Next, DOS puts remaining floppy drives
  • CD/DVD ROMs come after that
  • And the rest of the letters can be used for network drives, e.g., if using Microsoft Network client
XUP has a different approach. It assigns the drive letters for the boot menu sequentially, starting from floppy drives, and followed by the hard drives. XUP also does not care about HDD partitions, obviously (expected).
That is if you have 4 floppy drives, XUP will use letters A: - D: for the floppy drives, and the first HDD will have letter E:.
It does seem to skip the "Number of Floppy Drives", before it considers a drive to be an HDD. That is, for example, if you have 2 floppy drives and an HDD, and the "Number of Floppy Drives" is configured to 4, it will still "allocate" letter A: - D: for floppy drives, and your HDD will have letter E:, with letters C: and D: being unused.

Regardless, looking at the code (FloppyDrive.asm, FloppyDrive_GetCountToAX) should correctly detect the number of floppy drives in the system. It will help, of course, if the floppy BIOS would be initialized prior to XUP, so it will return the correct number of floppy drives...

As to your observations:
1. "press E when the XUB header appears - then it boots the CF "E" drive as C:" - With the default settings (I assume the default of "Number of Floppy Drives" is 2), XUP IPL thinks that A: and B: are floppy drives, and the rest are HDDs... and as a result it tries to boot from drive C:, which is actually your floppy drive 2, and then from the floppy drive 0:. Hitting E:, would cause it to boot from the 4th drive (counting from 0), that is your HDD.
2. "change the Boot Settings -> Number of Floppy Drives from Auto to 4". My guess is that during the XUP initialization, Multi-Floppy BIOS was not yet installed, and therefore by default XUP was using 2 drives. Setting that to 4 makes XUP to boot from the 4th drive (counting from zero)
3. "Boot Settings -> Default boot drive - change from 80h to 82h". This is a rather weird... But perhaps XUP tries to reconstruct the BIOS drive number from the letter, and still assumes that C: will be the first HDD.

Without looking to much at XUP code, I don't know why it cares that much about floppy drive numbers at all. I'd think, all it has to do is to add more hard drives, that would use drive numbers 80h and above.
For the boot purpose, it is probably OK to assume that C: is the first HDD, D: is the second HDD, and A: and B: are the first and the second floppy drives respectively. If there is a need to support booting from more floppy drives, it could enumerate these after the hard drives. Not sure how much of the code modification that would entail.
I just wanted to chime in and thank you for the awesome explanation. I'm a big fan of your work.
 
Back
Top