freebsd-dev/sys/amd64/amd64
Luigi Rizzo 60cf2c1254 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
2002-03-10 20:08:44 +00:00
..
amd64_mem.c Overhaul of the SMP code. Several portions of the SMP kernel support have 2001-04-27 19:28:25 +00:00
amd64-gdbstub.c Backed out the main part of revs.1.14-16. Don't disable interrupts in 2002-01-30 18:51:24 +00:00
apic_vector.S Back out all the pmap related stuff I've touched over the last few days. 2002-02-27 09:51:33 +00:00
atomic.c Introduce atomic_cmpset_int() and atomic_cmpset_long() from SMPng a 2000-09-06 11:21:14 +00:00
autoconf.c Export a (machine dependent) kernel variable bootdev as 2002-03-10 20:08:44 +00:00
bios.c Re-fix a pointer/integer warning. 2002-02-27 09:58:06 +00:00
busdma_machdep.c Change the preemption code for software interrupt thread schedules and 2002-01-05 08:47:13 +00:00
cpu_switch.S revert last commit temporarily due to whining on the lists. 2002-02-26 20:33:41 +00:00
db_disasm.c Quiet a variable format-string warning. 2001-07-19 02:16:24 +00:00
db_interface.c Backed out the last vestiges of rev.1.51. Don't enter a critical 2002-01-30 18:23:31 +00:00
db_trace.c Pre-KSE/M3 commit. 2002-02-07 20:58:47 +00:00
elf_machdep.c Change incorrect NULLs to 0s 1999-12-21 11:14:12 +00:00
exception.s revert last commit temporarily due to whining on the lists. 2002-02-26 20:33:41 +00:00
exception.S revert last commit temporarily due to whining on the lists. 2002-02-26 20:33:41 +00:00
fpu.c revert last commit temporarily due to whining on the lists. 2002-02-26 20:33:41 +00:00
genassym.c revert last commit temporarily due to whining on the lists. 2002-02-26 20:33:41 +00:00
identcpu.c Add generalized power profile code. 2002-03-04 18:46:13 +00:00
in_cksum.c In in_cksumdata, len must be a signed type. 2001-10-05 18:58:22 +00:00
initcpu.c Add an option CPU_ATHLON_SSE_HACK which attempts to enable the SSE 2002-02-12 21:13:02 +00:00
legacy.c - Split the routine to initialize a bus_space_handle into the separate 2002-02-17 09:16:45 +00:00
locore.s Back out all the pmap related stuff I've touched over the last few days. 2002-02-27 09:51:33 +00:00
locore.S Back out all the pmap related stuff I've touched over the last few days. 2002-02-27 09:51:33 +00:00
machdep.c Export a (machine dependent) kernel variable bootdev as 2002-03-10 20:08:44 +00:00
mem.c Simple p_ucred -> td_ucred changes to start using the per-thread ucred 2002-02-27 18:32:23 +00:00
mp_machdep.c Add needed includes of machine/smp.h, remove nested include in sys/smp.h 2002-03-07 04:43:51 +00:00
mpboot.S Remove the leading underscore from all symbols defined in x86 asm 2001-02-25 06:29:04 +00:00
mptable.c Add needed includes of machine/smp.h, remove nested include in sys/smp.h 2002-03-07 04:43:51 +00:00
nexus.c - Split the routine to initialize a bus_space_handle into the separate 2002-02-17 09:16:45 +00:00
pmap.c Fix a minor swap leak. 2002-02-28 07:41:12 +00:00
prof_machdep.c Previous commit changing SYSCTL_HANDLER_ARGS violated KNF. 2000-07-04 11:25:35 +00:00
support.s Back out all the pmap related stuff I've touched over the last few days. 2002-02-27 09:51:33 +00:00
support.S Back out all the pmap related stuff I've touched over the last few days. 2002-02-27 09:51:33 +00:00
swtch.s revert last commit temporarily due to whining on the lists. 2002-02-26 20:33:41 +00:00
sys_machdep.c Simple p_ucred -> td_ucred changes to start using the per-thread ucred 2002-02-27 18:32:23 +00:00
trap.c Condition the compilation of trapwrite() on I386_CPU. 2002-03-10 02:11:38 +00:00
tsc.c revert last commit temporarily due to whining on the lists. 2002-02-26 20:33:41 +00:00
vm_machdep.c revert last commit temporarily due to whining on the lists. 2002-02-26 20:33:41 +00:00