It seems, FreeBSD can't BIOS-boot boxes with too many drives. Is this a known issue in the FreeBSD bootloader? I kinda have to "hide" drives from the BIOS in order to make FreeBSD boot. Trying to boot with 36 disks looks like this: https://ln.tc/s/20260409-105240_2026-04-09-105233_786x456_scrot.png #FreeBSD #bootloader
@FiLiS I’m guessing there’s a good reason why UEFI can’t be used here? because a drive called ] or ‘ is a recipe for future trouble

@dch but UEFI doesn't use drive letters, i'd expect that to work fine here.

@FiLiS

@lw yeah that’s what I meant but apparently I can’t communicate in my native language before midday :-(
@FiLiS
@dch @lw yes, UEFI can't be used, for some reason. I think it's also the controller's fault.

@FiLiS @lw so without really knowing what I'm doing I grepped for 'BIOS drive.+: is' and 'Can not get information' and found bd_int13probe()

https://cgit.freebsd.org/src/tree/stand/i386/libi386/biosdisk.c#n604

/*
* Try to detect a device supported by the legacy int13 BIOS
*/
static bool
bd_int13probe(bdinfo_t *bd)
{

which is called from bd_init()

https://cgit.freebsd.org/src/tree/stand/i386/libi386/biosdisk.c#n336

which does for(.., PTOV(BIOS_NUMDRIVES))

which is 0x475 which appears to be a Magic Number pointing into the BIOS memory space which I guess returns more Magic Numbers from the BIOS already.

AFAICT the bd_int13probe() trucks along until it find a device# that doesn't return a response and then stops.

So device 36 appears to be listed in the PTOV(BIOS_NUMDRIVES) data, but on querying, doesn't have the info that the loader expects https://cgit.freebsd.org/src/tree/stand/i386/libi386/biosdisk.c#n661 so we return false to bd_init() and stop.

Rummaging around there the number of enumerable drives appears to be between 0x80 -> 0xff so 128 drives total, but who knows.

Also, I don't know what character it would try for 0xa7 (base of 0x80 + 37) in bd_init(), it's not even printable ASCII...

Toomas or Warner probably knows what actually happens here.

biosdisk.c « libi386 « i386 « stand - src - FreeBSD source tree

@FiLiS so I would see if it is willing to boot with 1 drive missing, and also see if the boot fails if you re-order the devices (does the device without correct data cause the failure to move around, or maybe it is the firmware returning garbage).

Maybe you need to flash firmware on everything in sight, and hope somewhere this enumeration problem is fixed.

@dch as this was a live machine, I didn't really have time to play around. Exposing only 4 drives to the bios made it boot. I think it already broke at 6, but surely broke at 12 drives.
@FiLiS @dch

Sorry - that makes no sense. We've been running maxxed out 24 bay chassis' without an issue. IIRC even 36 bays, but not 100% sure. Have to verify the latter.
@laylo @dch yeah. I know. I’m pretty sure we have other boxes in similar configs that boot just fine. Do you boot UEFI or BIOS though?

@FiLiS @dch @lw There is a SeaBIOS output, not UEFI. I use SeaBIOS on my laptop and see these drive letters every day 

BTW, there should be some rotating symbol (like - \ | / -) in the console from the stage1 loader, but I don't see it. Possibly, SeaBIOS failed to load stage0 loader from MBR?

SeaBIOS doesn't use UEFI, IIRC