Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Aug 1998 23:42:38 -0500 (EST)
From:      Alfred Perlstein <bright@www.hotjobs.com>
To:        hackers@FreeBSD.ORG
Subject:   fix for boot and possible problem with DEVFS
Message-ID:  <Pine.BSF.3.96.980819232401.305A-100000@bright.fx.genx.net>

next in thread | raw e-mail | index | archive | help

ok, here's the problem with booting off a second BSD partition:

the bootstrap has no notion of "where it was loaded from" it just blindly
picks the first BSD partition it finds to load the boot2 program or root
directory info.

a simple kludge would be to "brand" an area of this binary before it is
installed, or perhaps have the boot loader find out?  i'm unsure how to do
this right now. (PC intern is under a lotta stuff at home)

from file: /usr/src/sys/i386/boot/
"start.S" line 159 of 458

	/* find the first 386BSD partition */
	data32
	mov	$PARTSTART, %ebx
	data32
	mov	$NUMPART, %ecx
again:
	addr32
	movb	%es:4(%ebx), %al
	cmpb	$BSDPART, %al
	data32
	je	found
	data32
	add	$PARTSZ, %ebx
	data32
	loop	again
	data32
	mov	$enoboot, %esi
	data32
	jmp	err_stop

now here's where devfs comes in:

devfs probes the floppie to see if it is bootable, this isn't that great
and should have some flag to disable that as it sorta makes the machine
vulnerable to someone sticking a hacked PICObsd disk in (perhaps in a
public lab)

also, devfs checks each partition in order, this is urm, basically
an inconvient way to find a root partition, again, can't something be
passed though the boot -> kernel -> devfs to tell it where it's actually
booting from?

right now an icky thing i think i'm going to try is to do this:

partition table:
partition 1 (win95) HEY! it's boss says i need to keep it :P
partition 3 (freebsd) 
partition 2 (freebsd)

i'm going to fake the ordering by messing with start/stop addresses

one of the incentives to fix this problem (besideds the fact that it
irritates me a bit) is that someone my wish to have -current and -stable
on one box for development purposes.

my "fix" leaves me unable to boot from the true middle partition.

really really really pushing it today, sorry peoples.

Alfred Perlstein - Programmer, HotJobs Inc. - www.hotjobs.com
-- There are operating systems, and then there's BSD.
-- http://www.freebsd.org/


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.980819232401.305A-100000>