Hrm... I thought it was a standard left over from the PC/AT days at least that the bios would pass the device number in to the boot loader. Otherwise it has no clue from where it is being loaded. For instance, one person could format the disk in their A drive, and the boot sector would get 0 written for the device number, then you try to boot it in the B drive and the boot sector erroneously tries to access the A drive. Likewise for hard disks 80, or 81 and so on, and even when booting from no emulation cdroms, the bios passes in C0 for the first cdrom iirc.
If there are some bioses that do not pass the device number, then setting it to 0xff in freeldr.asm would not fix the problem either, as it would still expect the number from the bios. You would have to manually set it to the right device number for the drive in your system, and only use it in that drive.
Brian Palmer wrote:
I don't agree with this fix. It removes (valuable) functionality from the boot code and possibly breaks booting on some machines.
There is no spec for how a machine should boot, and the value passed in DL is not standard for all BIOSes. It is basically a left over register value from the MSDOS MBR code. You can't guarantee that it will always be there. I am in charge of the MBR boot code at my day job and I have seen BIOSes which do not pass this value in DL.
Could you please revert the change and fix your value to be either 0xFF or your boot device number (probably 0x80)?
-Brian