Paul Stvber wrote: > If OpenBSD's MBR bootcode works for you (fdisk -u), you can hexedit > it so that it will boot a fixed MBR partition (instead of the > ``active'' one) if the user holds down either Alt key during boot. > > The marked byte at offset 0x35 tells the fixed MBR partition > (04=first, 01=last). > > Offset 0x2B > old: 03 > new: 08 > > Offset 0x2E > old: B0 07 E8 CB 00 80 0E B4 01 01 > new: E8 1A 01 EB 05 83 F9 01 EB 17 > ^^ > > Offset 0x148 > old: 6C 64 20 42 49 4F 53 0D 0A 00 > new: 0D 0A 00 C7 06 4D 00 EB E4 C3 > > Works with src/sys/arch/i386/stand/mbr/mbr.S revisions 1.19--1.21 > (OpenBSD 3.5--4.2). > > The patched MBR bootcode will print "MBR on floppy or o" instead > of "MBR on floppy or old BIOS", and the user cannot force CHS reads > by holding down Shift (biosboot(8)).
That's a neat trick, having done a lot of that kind of binary code modification back in the 1980s (in CP/M and DDT or DU) I gotta respect that, but I'm not putting that in the FAQ. :) It's a bit too "hack-ish" for the 21st. century. You are, however, on your way to a rather nifty boot selector. Finish it up (make your mod in source, write a maintenance program for it so you don't have to manually edit the sector and make the maintenance program open source and available for multiple platforms), and you have a nifty boot selector that works slicker than many "big name" ones for people who know what they are doing. (don't forget the logo, mascot, mail list and website. You are doing it in the wrong order, though -- you aren't supposed to do the coding first! :) Hint: Rather than using CTRL or ALT or SHIFT, try NumLock, CapsLock or ScrollLock. That way, you can tap the key and walk away if your machine takes an eternity to boot. Probably won't work for all systems (I suspect some will clear 'em all before the MBR is loaded) but beats waiting around for those that it does work with. I used to use this with a batch file that determined how an old DOS/Win3 machine I had would boot. Nick.