From bright@bright.fx.genx.net Wed Aug 19 20:54:42 1998 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 UAA06600 for ; Wed, 19 Aug 1998 20:54:41 -0700 (PDT) (envelope-from bright@bright.fx.genx.net) Received: (from bright@localhost) by bright.fx.genx.net (8.9.1/8.8.8) id XAA00444; Wed, 19 Aug 1998 23:54:46 -0500 (EST) (envelope-from bright) Message-Id: <199808200454.XAA00444@bright.fx.genx.net> Date: Wed, 19 Aug 1998 23:54:46 -0500 (EST) From: bright@www.hotjobs.com Reply-To: bright@bright.fx.genx.net To: FreeBSD-gnats-submit@freebsd.org Subject: need fix for how freebsd boots itself. X-Send-Pr-Version: 3.2 >Number: 7688 >Category: kern >Synopsis: FreeBSD will NOT boot itself if it's not the first BSD partition >Confidential: no >Severity: serious >Priority: medium >Responsible: rnordier >State: closed >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Aug 19 21:00:00 PDT 1998 >Closed-Date: Thu Oct 29 10:46:51 PST 1998 >Last-Modified: Thu Oct 29 10:49:37 PST 1998 >Originator: Alfred Perlstein >Release: FreeBSD 3.0-CURRENT i386 >Organization: HotJobs Inc. >Environment: 3.0-current i386 WD disk as my master disk >Description: 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. >How-To-Repeat: simple: have a setup like so: partition table: 1-DOS 2-DOS 3-FreeBSD change to: 1-DOS 2-FreeBSD (empty) 3-FreeBSD (your old stuff) cannot boot, only way to salvage is to make the 2nd partition non-BSD again. >Fix: suggest that somehow the boot section see if it can ID itself where it was loaded from. brand the boot sector with a hint of which partition it came from. this info should be passed along through the kernel and made available to DEVFS to prevent "floppy disk machine hijacking" ie. sticking a bootable BSD diskette in a machine with the BIOS floppy boot turned off. ALSO this way you can have 2 seperate root partitions for stable & current perhaps. btw, this is a REAL zinger for a newbie and i think i spent one day ripping my hair out for hours when trying to do an install to a secondary disk on a machine about a year ago. thank you. Alfred. >Release-Note: >Audit-Trail: State-Changed-From-To: open->feedback State-Changed-By: rnordier State-Changed-When: Wed Oct 28 16:02:07 PST 1998 State-Changed-Why: The new boot code /sys/boot/i386/boot2 will boot from the active, rather than first, BSD slice. Can you confirm this is a workable solution for you? Responsible-Changed-From-To: freebsd-bugs->rnordier Responsible-Changed-By: rnordier Responsible-Changed-When: Wed Oct 28 16:02:07 PST 1998 Responsible-Changed-Why: I'm handling this. State-Changed-From-To: feedback->closed State-Changed-By: rnordier State-Changed-When: Thu Oct 29 10:46:51 PST 1998 State-Changed-Why: The new boot code has been designed to resolve this issue. >Unformatted: