Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Jul 1996 03:38:51 +0200
From:      Andries.Brouwer@cwi.nl
To:        bde@zeta.org.au, dwhite@riley-net170-164.uoregon.edu, freebsd-bugs@FreeBSD.org, j@uriah.heep.sax.de, jkh@time.cdrom.com, questions@FreeBSD.org
Subject:   Re: installation fails
Message-ID:  <9607250138.AA15970=aeb@zeus-184.cwi.nl>

next in thread | raw e-mail | index | archive | help
<
 It took me some time to figure things out, but also the
 small boot partition does work.
 Now that I spent four more hours to get to this point,
 let me detail the problems. Maybe they can be corrected in some way.
 Or perhaps they have been corrected already?

 Andries
>

Problem: I have a FreeBSD system on my fifth disk, but my BIOS
	knows only about disks 0 and 1.  How do I boot FreeBSD?

Remark: I do not think the FreeBSD Boot Managers do this, since
	they use the BIOS.  But I have not looked at them since
	I already use OS/2 Boot Manager and LILO.

Solution:
	<All this is starting from an 2.1.5-RELEASE installation.>

	Boot Linux, move partitions a little bit on disk 0 or 1,
	so that there is enough room for one tiny additional
	partition, and create it with type a5.
	2MB should suffice - mine ended up being about 4MB.
	Make sure that this partition is primary: the FreeBSD
	boot code doesn't understand extended partitions.

	Boot the Install floppy, go to Custom Install, select
	the menu item that starts the Disklabel Editor, and
	make a filesystem on this small partition.
	It called the partition wd0s4e (0 for the disk number,
	4 for the primary partition number).

	[I have been told that bootable partitions should be called
	e.g., wd0s4a with final a, but have not been able to convince
	the installation procedure to do so, and have not yet
	discovered docs or source for the Disklabel Editor.]

	Boot FreeBSD, using a boot floppy, and go to
	/usr/src/sys/i386/boot/biosboot.
	Of course the user-compiled kernel knows already what
	the root device should be, but the boot loader overrides
	this. Insert a line

		loadflags |= RS_DFLTROOT;

	before the call to getbootdev() in boot.c to make sure
	the compiled-in root device is used.
	In sys.c:find() the boot code divides by 0, causing a loop of reboots,
	and one way of preventing that is to replace the lines

		/* This little trick is for OnTrack DiskManager disks */
		boff = dl->d_partitions[part].p_offset -
			dl->d_partitions[2].p_offset + sector;

	in disk.c by

		boff = sector;

	Then "make; make install; disklabel -B /dev/wd0s4"
	"mkdir /kern; mount /dev/wd0s4 /kern; cp kernel /kern"
	and you are set: both OS/2 BM and LILO are willing
	to boot this FreeBSD system, and no boot floppies
	are required anymore.

Discussion:
	The above patches work entirely satisfactorily,
	but the real problem is that this Disklabel Editor
	did not write anything in partition[0], while the
	disk.c code assumes that there would be something.	
	Moreover, the variable `part' is never set.
	(That is a bad bug, but is not seen when the partition
	that is booted is the `a' partition.)
	The bootstrap code could be much more robust.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9607250138.AA15970=aeb>