freebsd-skq/sys/boot/common
paul 36945c480b This fixes a bug in the bcache code whereby false cache hits occur
the first time block 0 is read. This fix initialises the block
numbers to -1 which isn't the most correct thing for a daddr_t but
it isn't likely to cause a problem in the boot blocks and it could
do with a more thought out fix later.

The bug is probably benign on the i386 but on the alpha it can
cause initial file opens to fail. This is the cause of the "can't
open /boot/boot.conf" errors.

It appears on the alpha because of a number of combining factors.
On the alpha the LABELSECTOR is 0 so block 0 needs to be read in
from the media. The first time this happens you get a false hit
because the bc_blkno field is zero initially. Also, the timestamp
check against this cache hit succeeds because on the alpha a hacked
getsecs() function can return 0 when it starts counting so that
the zero initial timestamp + BCACHE_TIMEOUT is greater than the
current time until getsecs() has counted passed BCACHE_TIMEOUT.

The overall effect is that the first open() that occurs gets a
false cache hit and returns garbage to the bd_strategy() function
which then fails the open() call. This false hit then stays in the
cache until BCACHE_TIMEOUT getsecs() ticks have passed; all open()
calls during this time fail.

This explains why you can generally access the media by the time
you get to interp() and start issuing commands but the earlier
attempts to run the boot scripts are failing.

It's possible that this is causing the problem switching to the
mfsroot floppy as well but I haven't confirmed that.
1998-11-19 18:12:03 +00:00
..
bcache.c This fixes a bug in the bcache code whereby false cache hits occur 1998-11-19 18:12:03 +00:00
boot.c Standardise on ';' as a component separator; it seems to be a little more 1998-11-02 16:55:57 +00:00
bootstrap.h Implement a simple LRU block cache. By default this is initialised to 16k, 1998-11-02 23:28:11 +00:00
commands.c - Add a new command 'lsdev' to list devices which might be likely to host 1998-10-31 02:53:12 +00:00
console.c - Add a new command 'lsdev' to list devices which might be likely to host 1998-10-31 02:53:12 +00:00
dev_net.c Make the alpha bootstrap build again, fix some warning and change sdboot to daboot. 1998-09-20 21:46:19 +00:00
dev_net.h This is the new unified bootstrap, sometimes known previously as the 1998-08-21 03:17:42 +00:00
devopen.c * Add old UFS compatibility code to alpha/boot1. 1998-09-26 10:51:38 +00:00
gensetdefs.c Initial integration of the i386 bootloader and BTX. 1998-09-17 23:52:16 +00:00
help.common Add documentation for $rootdev. 1998-11-13 23:53:02 +00:00
interp_backslash.c Allow quoted strings (single or double) for grouping whitespace separated 1998-09-03 06:14:41 +00:00
interp_forth.c Eliminate much code cruft by extending simple file I/O API to include 1998-11-07 06:18:00 +00:00
interp_parse.c Initial integration of the i386 bootloader and BTX. 1998-09-17 23:52:16 +00:00
interp.c Add BootForth hooks; if BOOT_FORTH is defined, pass every line read 1998-11-04 00:29:01 +00:00
isapnp.c Export an interface for presetting the ISA PnP read port address. 1998-10-22 20:20:51 +00:00
isapnp.h Make ISA PnP work. This successfully enumerates as many ISA devices as I 1998-10-21 20:07:05 +00:00
load_aout.c Only print filename and entry address for the kernel itself. The rest 1998-10-12 09:05:12 +00:00
load_elf.c Load the first page of the file and use the headers in it. This should 1998-10-17 03:06:38 +00:00
load.c This is the new unified bootstrap, sometimes known previously as the 1998-08-21 03:17:42 +00:00
ls.c Fix a warning 1998-10-11 10:28:51 +00:00
Makefile.inc Add BootForth hooks; if BOOT_FORTH is defined, pass every line read 1998-11-04 00:29:01 +00:00
misc.c Insert whitespace between unargv'd arguments. 1998-10-05 05:40:58 +00:00
module.c Use a consistant module search path (same as kernel will be). 1998-10-09 23:12:34 +00:00
panic.c console.c 1998-09-26 01:29:13 +00:00
pnp.c Export an interface for presetting the ISA PnP read port address. 1998-10-22 20:20:51 +00:00
pnpdata - Add a new command 'lsdev' to list devices which might be likely to host 1998-10-31 02:53:12 +00:00