From owner-cvs-all Sun Mar 10 12: 8:48 2002 Delivered-To: cvs-all@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 590A537B400; Sun, 10 Mar 2002 12:08:44 -0800 (PST) Received: (from luigi@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g2AK8ic50180; Sun, 10 Mar 2002 12:08:44 -0800 (PST) (envelope-from luigi) Message-Id: <200203102008.g2AK8ic50180@freefall.freebsd.org> From: Luigi Rizzo Date: Sun, 10 Mar 2002 12:08:44 -0800 (PST) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/i386/i386 autoconf.c machdep.c src/sbin/sysctl sysctl.c X-FreeBSD-CVS-Branch: HEAD Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG luigi 2002/03/10 12:08:44 PST Modified files: sys/i386/i386 autoconf.c machdep.c sbin/sysctl sysctl.c Log: Export a (machine dependent) kernel variable bootdev as machdep.guessed_bootdev, and add code to sysctl to parse its value and give a (not necessarily correct) name to the device we booted from (the main motivation for this code is to use the info in the PicoBSD boot scripts, and the impact on the kernel is minimal). NOTE: the information available in bootdev is not always reliable, so you should not trust it too much. The parsing code is the same as in boot2.c, and cannot cover all cases -- as it is, it seems to work fine with floppies and IDE disks recognised by the BIOS. It _should_ work as well with SCSI disks recognised by the BIOS. Booting from a CDROM in floppy emulation will return /dev/fd0 (because this is what the BIOS tells us). Booting off the network (e.g. with etherboot) leaves bootdev unset so the value will be printed as "invalid (0xffffffff)". Finally, this feature might go away at some point, hopefully when we have a more reliable way to get the same information. MFC-after: 5 days Revision Changes Path 1.42 +51 -0 src/sbin/sysctl/sysctl.c 1.162 +0 -2 src/sys/i386/i386/autoconf.c 1.502 +4 -0 src/sys/i386/i386/machdep.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message