Commit Graph

178 Commits

Author SHA1 Message Date
msmith
8c52bcabbc Add required parts for BootForth building (currently disabled and
untested).  Only suitable for i386 at the moment, as we are missing
setjmp/longjmp on the Alpha.
1998-11-04 00:30:47 +00:00
msmith
e8cf5aa8c5 Make this work in the libstand environment; don't use stdio/stdlib headers. 1998-11-04 00:29:33 +00:00
msmith
155c4cb295 Add BootForth hooks; if BOOT_FORTH is defined, pass every line read
to the Forth interpreter.  Instantiate all of our inbuilt commands
as Forth words, and handle them being called from there.

Add my copyright to the bcache module (oops).
1998-11-04 00:29:01 +00:00
msmith
6043fe8061 Include "bootstrap.h" to get a definition for bcache_devdata.
Submitted by:	jkh
1998-11-03 23:44:49 +00:00
msmith
fe1c6b5af2 Add the Ficl (Forth Inspired Command Language) interpreter. If all goes well,
this will allow us to manage bloat in the loader by using a bytecoded HLL
rather than lots of C code.  It also offers an opportunity for vendors
or others with special applications to significantly customise the boot
process without having to commit to a divergent code branch.

This early commit is to allow others to experiment with the most effective
mechanisms for integrating FICL with the loader as it currently stands.

Ficl is distributed with the following license conditions:

"Ficl is freeware.  Use it in any way that you like, with the understanding
 that the code is not supported."

All source files contain authorship attributions.

Obtained from:	John Sadler (john_sadler@alum.mit.edu)
1998-11-03 06:11:35 +00:00
msmith
e79304233b Ok, the entry aging algorithm sucked; 1s time resolution is not enough for
LRU.  Use a 31-bit counter instead.  If we decide to do heavy I/O through
the bootloader this will have to be revisited.
1998-11-02 23:50:59 +00:00
msmith
7ff854a690 Implement a simple LRU block cache. By default this is initialised to 16k,
and will bypass transfers for more than 8k.  Blocks are invalidated after
2 seconds, so removable media should not confuse the cache.

The 8k threshold is a compromise; all UFS transfers performed by
libstand are 8k or less, so large file reads thrash the cache.
However many filesystem metadata operations are also performed using
8k blocks, so using a lower threshold gives poor performance.

Those of you with an eye for cache algorithms are welcome to tell me
how badly this one sucks; you can start with the 'bcachestats' command
which will print the contents of the cache and access statistics.
1998-11-02 23:28:11 +00:00
rnordier
459dfe3332 Revise a few comments. 1998-11-02 17:53:08 +00:00
msmith
fed03efc4e Standardise on ';' as a component separator; it seems to be a little more
common than ','.
1998-11-02 16:55:57 +00:00
rnordier
19bbd56b97 Ignore, rather than emulate, an i386 'hlt' instruction (though for
most practical purposes, this should be indistinguishable from a
more strictly correct approach).

Feedback and testing: msmith
1998-11-01 13:52:52 +00:00
dfr
29a470890d * Extend the memory available for the heap from 256k to 512k.
* Embed the stack into the bss section for loader and netboot.  This
  is required for netboot since otherwise the stack would be inside our
  heap.
* Install loader and netboot in /boot by default.
* Fix getbootfile so that it searches for a ',' instead of a ';'
  when terminating the filename.
1998-10-31 17:12:32 +00:00
msmith
27a325f105 - Add a new command 'lsdev' to list devices which might be likely to host
filesystems.
 - New 'help' command and data in the help.* files (not yet installed),
   provides topic and subtopic help, indexes, etc.
 - Don't crash if the user tries to set an invalid console.  Be helpful
   instead.
 - Expand tabs (badly) on the i386 video console.
 - Some minor cosmetic changes.
1998-10-31 02:53:12 +00:00
luoqi
d53d7e4461 Fix an uninitialized variable in the `dangerously dedicated disk' case. 1998-10-30 07:15:52 +00:00
msmith
b7cb0214c9 Make the BTX loader much more quiet about what it's doing. This removes
most of the "what the (*^&%(*^ was that?" stuff that normally flies by.
1998-10-30 00:11:35 +00:00
msmith
45c6ebc96d Simplify the "is a character ready" test, so that we don't return a false
negative for keypresses with zero ascii values.  This is in line with the
comconsole test, rather than being more ambitious.

Submitted by:	rnordier
1998-10-28 19:24:15 +00:00
rnordier
25598ad6e0 Avoid interruptions while talking to keyboard controller. 1998-10-27 20:19:24 +00:00
rnordier
b845950ce7 biosboot compatibility fix: change behavior of backspace in getstr().
Noticed by: abial

Optimize away a few bytes to make space for the above.
1998-10-27 20:16:36 +00:00
msmith
2dd69edc85 Reserve some space for the stack in the region we recover from the initial
bootloader.
Submitted by:	dfr
1998-10-24 00:31:21 +00:00
msmith
2ca24369c0 Clean the ${BASE}.sym file as well. 1998-10-23 22:32:27 +00:00
msmith
15fb469d2d Remove a debugging copy of offsetof() that snuck in. 1998-10-23 22:30:52 +00:00
msmith
0fc1f23a6a Enable the PCI BIOS PnP enumerator. 1998-10-23 22:29:19 +00:00
msmith
186b62dab2 PnP enumerator using the PCI BIOS. This is needlessly complex due to the
lack of a simple "enumerate all PCI devices" function.
1998-10-23 22:29:08 +00:00
msmith
6149131893 PnP BIOS enumerator; mostly useful for hunting PnP devices that are supported
by the system BIOS rather than supporting ISA PnP.
1998-10-22 20:25:06 +00:00
msmith
2cb346f288 Add a dependancy on the BTX crt0 object
Add the biospnp handler to the pnp handler array
Drop some old debugging code
1998-10-22 20:23:58 +00:00
msmith
0d28177be8 Add biospnp.c 1998-10-22 20:23:15 +00:00
msmith
472b37dea8 Pop the return address off the stack before making a V86_CALLF call;
this allows us to implement what look like C function calls from user
space "directly" to v86 mode code.  (Used for calling the PnP BIOS)
1998-10-22 20:22:07 +00:00
msmith
973bf97487 Export an interface for presetting the ISA PnP read port address.
Make the EISA ID formatter generally available
1998-10-22 20:20:51 +00:00
msmith
238c591219 Bye-bye setdefs. 1998-10-21 20:11:03 +00:00
msmith
edf2081f84 - Enable PnP and ISA PnP code.
- Use the ISA PnP enumerator.
 - Use the new linker set code, throw out the gensetdefs stuff.
 - Produce an intermediate loader image that has symbols stripped, to aid
 - in debugging.
 - Supply ISA port access functions required for ISA PnP
1998-10-21 20:10:33 +00:00
msmith
702529216c Don't depend on being part of the kernel tree. If we are, use the kernel's
<machine> includes rather than the system's.
1998-10-21 20:07:57 +00:00
msmith
880061ca43 Make ISA PnP work. This successfully enumerates as many ISA devices as I
can fit into my test machine.

 - Move to using STAILQs rather than ad-hoc singly-linked lists.
 - Use a mostly procedural interface to the PnP information.  This
   improves data-hiding.

Implement a new linker-set technique (currently on i386 only but should work
on Alpha as well).  This is a good candidate for replacing the current
gensetdefs cruft completely.
1998-10-21 20:07:05 +00:00
rnordier
f8807b8fc1 Make serial port, data format, and bps configurable. 1998-10-20 20:20:48 +00:00
msmith
387d413043 Hex constants should only have one '0x' prefix. 1998-10-20 02:43:28 +00:00
rnordier
59abe72c15 Make configurable (a) whether to use int 0x13 extensions; (b) timeout
value.  Ignore failure to update mbr sector.  Disable interrupts while
using extended registers.  Default to F1 not F2.
1998-10-19 19:13:53 +00:00
dfr
5e48f3a376 Reclaim the 48k used by the first bootstrap stage by adding it to the malloc
pool.
1998-10-19 09:12:41 +00:00
dfr
11bd3a0836 Rename boot2 to loader. 1998-10-18 19:05:07 +00:00
rnordier
d3a9e969df Set BINMODE to 444. 1998-10-17 14:20:25 +00:00
rnordier
8671c8b39b Fix some glitches in the input routine:
Don't display a \b if not acting on it.
Don't process binary zero chars (which result from pressing function
keys, etc. on the PC).
1998-10-17 11:25:05 +00:00
rnordier
ce63af0fef Having probed the keyboard, turn off the -P flag. 1998-10-17 10:35:15 +00:00
rnordier
638a858945 Treat all options as toggles (ie. -c -c is the same no -c). Since
the boot.config settings are persistent, this seems to provide a
useful override capability, and should break only on broken
boot.config's.

Output a cosmetic newline if booting with no input.
1998-10-17 09:50:09 +00:00
rnordier
19b83af292 biosboot compatibility fix:
If we have a boot.config command, display it.
1998-10-17 09:16:01 +00:00
rnordier
ebcd17d6c6 biosboot compatibility fix:
Read boot.help before parsing boot.config.  We were parsing
boot.config first, which could result in boot.help being read
from a different location (or not found), which would probably
just cause surprise, without being useful.
1998-10-17 09:01:13 +00:00
peter
37e9ac7609 Load the first page of the file and use the headers in it. This should
avoid the need to seek back to offset zero which is causing trouble on
the Alpha with a gzipped kernel.
1998-10-17 03:06:38 +00:00
msmith
0250d0a60a Turn of disk debugging by default (suppress annoying "partition marked as
unused" diagnostic on floppies).
1998-10-16 19:26:11 +00:00
peter
a8354e7057 "fix" the gzipped kernel load problem by having the loader check that it
can seek back to the first PT_LOAD and doing a close/reopen if it cannot.
This is because the first PT_LOAD section includes the ELF headers.
This fixes gzipped kernels on the i386, it should solve mike's problem
for the Alpha.
1998-10-16 03:04:15 +00:00
rnordier
764f911a88 Fix path to sio.s 1998-10-15 22:08:13 +00:00
dfr
69efe6cf4e Change some printfs so that ELF_VERBOSE prints meaningful values on the alpha. 1998-10-15 21:56:47 +00:00
dfr
8c5d5288fb Fix the bootinfo so that the right values actual make it into the kernel. 1998-10-15 21:55:58 +00:00
rnordier
0b71e4f0b7 Add serial, dual, and probe-keyboard support. 1998-10-15 20:04:21 +00:00
peter
d1bde99276 Get the last used address via a more conservative method, don't depend
on the module chain being in increasing address order.
1998-10-15 17:06:36 +00:00