FreeBSD boot manager customization for single-disk multiboot (4 x DOS)

Ian Smith smithi at exemail.com.au
Wed Oct 17 08:07:32 UTC 2018


On 15 October 2018 8:59:00 pm AEDT, Polytropon <freebsd at edvax.de> wrote:
 > On Mon, 15 Oct 2018 19:28:55 +1100, Ian Smith wrote:
 > > I've read the thread.  Manish is trying to help but his DOS
 > > familiarity doesn’t go back far enough.  I started at 2 and
 > > used 3.3 (with Desqview), later 5.0 for years running Fidonet
 > > mailer, BBS, message editor, DOS command space and other tasks
 > > in 6 MiB RAM .. so had to learn how to really squeeze things
 > > in - as did you, I gather. 
 > 
 > Correct. Started with DOS 3.3 (and its "foreign predecessors"
 > called SCP and DCP which aren't known outside former GDR), then
 > DOS 5.0 and 6.22 (with NDOS as COMMAND.COM replacement), and
 > I even used Novell DOS 7 for a short time (and its UNDELETE
 > program was really great). Oh, and I also know and still _have_
 > Desqview/X (with package, books, and floppies).
 > 
 > 
 > 
 > > Correct, you cannot boot DOS from a non-primary partition.
 > > Maybe you could use GRUB, it installs after the MBR on track
 > > 0 side 0 so shouldn't get in the way.
 > 
 > I think an older version of Grub might work - I don't assume
 > today's current version is up to the task on running on such
 > an old system.
 > 
 > 
 > 
 > > I dont think you need to install linux to install GRUB?
 > 
 > The smallest disk that I can use is 20 GB, so it would not
 > be a problem due to space limitation if I installed Linux.
 > For "logical space", it could even go into an extended
 > partition, for example like this
 > 
 > 	Whole disk:				20,000 MB
 > 
 > 	prim. part. 1 = DOS 5.0			    50 MB
 > 	prim. part. 2 = DOS 6.22		   500 MB
 > 	prim. part. 3 = data exchange (FAT)	 1,000 MB
 > 	ext. part = {
 > 		log. vol. 1 = Windows '95	 2,000 MB
 > 		log. vol. 2 = Windows '98	 2,000 MB
 > 		log. vol. 3 = Linux swap	 2,000 MB
 > 		log. vol. 4 = Linux ext2	12,000 MB
 > 	}
 > 
 > Disk space is not a problem. The replacement system does not
 > accept disks bigger than 20 GB, so when I say "smallest disk",
 > this is actually the only (!) disk I can use. :-)
 > 
 > 
 > 
 > > That said, I don't use it myself.  To add linux to the 4-DOS
 > > mix would need an extended partition, leaving only 3 primaries
 > > for 3 x DOS.  Same deal with OS/2, with its great boot manager.
 > 
 > Oh yes, OS/2... it wrecked my DOS installation and "shifted"
 > the partitions (3 became 2, 2 became 1, 1 disappeared) when
 > I tried to install it into partition 4. Luckily, with the
 > great Norton Disk Editor (run from DOS emergency floppy),
 > a handheld calculator, and pen & paper I could reconstruct
 > the partition table manually and "get my data back" (as it
 > was not overwritten, just not assigned to a partition anymore).
 > 
 > 
 > 
 > > boot0.s MBR code is VERY tight with about ZERO free space as
 > > I  recall .. however there's code there - still was at 9.x I
 > > think - for a 1Ķ (2 sector) version written by the same author
 > > (Robert Nordier IIRC, I don't have a system to hand).  That
 > > should have plenty of room for more lavish labels, and may
 > > in fact include such code?  If you have a spare system you
 > > could assemble that and test.
 > 
 > I haven't done assembly programming for many years. I can
 > generally understand how the boot manager works, but I don't
 > think I'm skilled enough for modifying it (and still get a
 > working version that can do what I expect). The detection
 > and labeling magic is quite powerful in there. :-)
 > 
 > 
 > 
 > > Of course you'll have a backup MBR (directed more at other readers
 > :)
 > 
 > Luckily, that is an easy task with dd. In DOS, C, you'd use
 > the famous biosdisk() (prototype in dos.h!) to get the 512
 > bytes from the disk and store it to a file.
 > 
 > That reminds me to one of my first exercises in lower-level
 > C programming: Wrote a program that would modify the MBR to
 > change the start address of the 1st active primary partition
 > to the MBR itself, so the system would "boot into a loop".
 > Yes, we did actually consider this both funny and educational
 > at that time... :-)
 > 
 > 
 > 
 > > One thing to watch is that esp.  earlier versions of DOS may
 > > want to use the first slice explicitly?  I'm not sure, but I'd
 > > start with earliest versions first, and test each as you go. 
 > 
 > Yes, I think DOS 3.3 and before specifically needed that.
 > I'll check how DOS 5.0 will react. From older experience,
 > I seem to remember that DOS 6.22 could be booted from a
 > primary partition 2, 3, or 4, and depending on the content
 > of the ramining partitions, "drive letters" would then be
 > re-arranged (as the boot disk would always be C: as assigned
 > by a boot manager).
 > 
 > 
 > 
 > Interestingly, I found out that I could _maybe_ fix the
 > power supply of the IBM Thinkpad 755C. Documentation says
 > that it needs 20 V DC (so no 10 V DC as written on the label
 > of the exploded power supply). I think I still have a PSU
 > "brick" that provides 20 V DC, and making a new cable from
 > the remains of the old PSU is not a problem.
 > 
 > 	      /-------\
 > 	+ --- | o   o | --- Signal
 > 	- --- | o   o | --- Ground
 > 	      +-------+
 > 
 > Documentation suggests that "+" and "-" are the ones that
 > should be used, and _not_ connected to "S" and "G" in any
 > way. In case you are curious, this is the relevant documentation
 > that gave me hope to revive the TP 755C that has served me
 > so well for decades:
 > 
 > http://www.thinkwiki.org/wiki/Power_Connector#4-Pin_hexagon
 > 
 > https://www.powerstream.com/lta-IBM.htm
 > 
 > It looks like this one:
 > 
 > http://www.thinkwiki.org/w/images/9/9f/ThinkPad755CD.jpg
 > 
 > But instead of the optical unit, mine has the floppy disk
 > unit installed. And as I said, having access to old-fashioned
 > things like parallel ports, serial ports, or floppy drives
 > sadly is _not_ optional in this special case. :-)

I'd have replied interspersed in my usual manner, but it's just too tedious on this little phone; please excuse.  At least K9 can bottom-post .. trim at will ..

As mentioned, I have no access to a system currently - except I remembered having ssh access to an ancient but still working 5.5-stable (cough) with src, so I reviewed (from /usr/src):

./usr.sbin/boot0cfg/boot0cfg.c

./sys/boot/i386/boot0/boot0.S
./sys/boot/i386/boot0/boot0ext.S
./sys/boot/i386/boot0/Makefile

You'll note that adding longer labels for more OS types is the significant difference between the two and that boot0cfg(8) -b option can choose between (eg) boot0, boot0sio and, while not mentioned explicitly, boot0ext if accessible. 

Check out the boot0ext code.  On 5.5 it's not assembled, or at least not copied into /boot.  Not sure if this is still in 10.x and up.

Some here and certainly many on hackers@ could advise on having it also built to /boot (or anywhere) for boot0cfg access.  I assume you could dd it from a memstick into place, that is if the machine can boot from USB memstick?  Or floppy!?

Now, even then you won't get distinctions like between DOS or windows versions, have a look at the table in boot0ext.  It looks easy enough to change the strings if adjusting relative offsets.

boot0 doesn't even distinguish between DOS and windows, not at FreeBSD 8.2 anyway; I have a win98 on one, labeled as DOS (only for BIOS updates in the past).

Are you sure w95 and w98 can boot from an extended partition? XP can - it's an NT or OS/2 filesystem -  but w95/98 is 'DOS 7' so I'd test that assumption unless you're sure.

US$67.50 is a lot for an external P/S brick.  I bought 2 broken thinkpad T23s for AU$60 (~US$45) posted, off ebay years ago, with 2 working 65W P/S, 1 good screen, 2 good 60G disks, 2 good keyboards (albeit one GB/UK) and importantly for T23s, 2 working CPU fans :)

I bet you'd find a 755C, broken or not, for 50DM or less with a working P/S and maybe other useful spares?

Otherwise you have the plug, so wiring up another P/S brick should be ok with care.  Looks like going for 50W or more would be safest. 

 "it's the options that drive ya crazy"

cheers, Ian


More information about the freebsd-questions mailing list