From owner-freebsd-hackers Wed Aug 19 20:42:33 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id UAA04728 for freebsd-hackers-outgoing; Wed, 19 Aug 1998 20:42:33 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from bright.fx.genx.net (bright.fx.genx.net [206.64.4.154]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id UAA04723 for ; Wed, 19 Aug 1998 20:42:31 -0700 (PDT) (envelope-from bright@www.hotjobs.com) Received: from localhost (bright@localhost) by bright.fx.genx.net (8.9.1/8.8.8) with SMTP id XAA00329 for ; Wed, 19 Aug 1998 23:42:38 -0500 (EST) (envelope-from bright@hotjobs.com) X-Authentication-Warning: bright.fx.genx.net: bright owned process doing -bs Date: Wed, 19 Aug 1998 23:42:38 -0500 (EST) From: Alfred Perlstein X-Sender: bright@bright.fx.genx.net To: hackers@FreeBSD.ORG Subject: fix for boot and possible problem with DEVFS Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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