Commit Graph

558 Commits

Author SHA1 Message Date
kato
58b7c74807 Sync with sys/boot/i386/libi386/bootinfo.c revision 1.17. 1999-03-10 13:40:29 +00:00
dcs
313dc063d0 Install new loader.rc stuff. 1999-03-10 03:34:14 +00:00
dcs
08f08b7ab7 New loader.rc stuff.
Reviewed by:	jkh
1999-03-09 14:06:55 +00:00
dcs
526581a289 Add MODINFO_ARGS, parameters passed to a module at load time.
VS: ----------------------------------------------------------------------
1999-03-08 11:05:52 +00:00
dcs
b92a330050 Increase ficl's dictionary size, in preparation for the newer loader.rc. 1999-03-08 11:00:02 +00:00
dcs
304195a177 Fix a number of memory leaks and other memory-related disorders.
Also, unbreak the breakage introduced at the last revision of module.c.
This changes the semantics of mod_searchfile() (and mod_searchmodule())
to make the caller's responsibility freeing the buffer returned. This
is different from other functions in loader's code, and was done as a
fix for kern/9631. If someone wants to revert this to the original
behavior, don't forget to fix kern/9631 in another way.

This should also fix bin/10462, which was introduced as a result of the
first try at kern/9631 (module.c last revision).

PR:		bin/10462
Submitted by:	Takanori Saneto <sanewo@ba2.so-net.ne.jp>
1999-03-08 10:32:39 +00:00
kato
f14d10621f Make loader be able to load 1.2MB fd on machines w/ 1.44MB fdd.
Sumbmitted by:	IMAI Takeshi <take-i@ceres.dti.ne.jp>
1999-03-04 16:38:12 +00:00
kato
6edc8e8149 Added an entry for 1.44MB fd.
Submitted by:	IMAI Takeshi <take-i@ceres.dti.ne.jp>
1999-03-04 16:34:52 +00:00
kato
f7d44adef4 Oops, forgot to read boot.config file.
Submitted by:	IMAI Takeshi <take-i@ceres.dti.ne.jp>
1999-03-04 16:31:55 +00:00
kato
ee59945a67 When SCSI IDs are not contiguous, the loader could not find correct
unit number for da device.  This commit fixes this problem.

Submitted by:	IMAI Takeshi <take-i@ceres.dti.ne.jp>
1999-03-04 10:48:14 +00:00
kato
1c22dee1f8 boot2 doesn't need to say 'Can't find file boot.config.'
Submitted by:	IMAI Takeshi <take-i@ceres.dti.ne.jp>
1999-03-04 10:45:06 +00:00
kato
f87c1161fe Fix character code of backslash. PC98 should use 0xfc instead of 0x5c.
Submitted by:	IMAI Takeshi <take-i@ceres.dti.ne.jp>
1999-03-04 10:44:01 +00:00
dcs
ca008db062 Don't treat empty lines as end-of-file in include(). (I can't
believe this bug is still here... :-( )
1999-03-02 16:16:57 +00:00
kato
c7f6e24ca8 Sync with sys/boot/i386/btx/btx/btx.s revision 1.10. 1999-03-01 10:02:45 +00:00
rnordier
c74450fa3d Save option, rather than slice, selected. This permits unattended
booting from other than drive 0, as the F5 keypress is saved and
"replayed."

Requested (some time ago) by: archie
1999-03-01 02:42:47 +00:00
dcs
827ffa0722 Make $ print different lines in, well, different lines. 1999-02-28 02:10:14 +00:00
rnordier
c17b4c476c Implement "setdrv" option 1999-02-26 14:51:14 +00:00
rnordier
a3fa9785d0 Emulate a V86 "movl %cr0,%eax" instruction.
Feedback and testing: Kurt Hopfensperger <kjhmdjd@ix.netcom.com>
1999-02-25 16:27:41 +00:00
kato
c5a1921180 Sync with sys/boot/i386/loader/Makefile revision 1.29. 1999-02-25 11:01:54 +00:00
msmith
7648580bdb Don't try protecting page 0; it seems that BIOS writers now feel it's
appropriate to check for Windows95 by polling for state in low
memory, with fatal results.

Submitted by:	rnordier@freebsd.org
1999-02-24 01:37:23 +00:00
dcs
3b2e9c970d Fix assorted memory leak/buffer reuse problems.
Not restricted to, but including:

PR:		kern/9631
Submitted by:	Bill Fenner <fenner@parc.xerox.com>
1999-02-22 13:12:37 +00:00
tegge
86c0720b63 Enable load of i386 ELF kernels with larger KVA range (e.g. starting at
0xe0100000u or 0xc0100000u instead of the usual 0xf0100000u).
1999-02-15 17:36:58 +00:00
jkh
1dd8a295ca Remove dictHashSummary internal function; it used doubles.
Submitted by:		Daniel C. Sobral <dcs@newsguy.com>
1999-02-09 16:04:19 +00:00
kato
6dbbed98d7 Sync with sys/boot/i386/loader/version revision 1.3. 1999-02-08 09:59:38 +00:00
dcs
ea6b709336 Bumb up loader's version.
Reviewed by:	Michael Smith <msmith@freebsd.org>
1999-02-08 04:14:31 +00:00
dcs
422db1f2b1 Remove strange-looking quotes. This part of the code is #if'ed out,
and the variable doesn't even exist (though it is referenced elsewhere).
Just make sure it produces error messages when Mike get back to it.

PR:		kern/9934
Submitted by:	Adrian Filipi-Martin
1999-02-07 12:12:29 +00:00
dcs
72ab07e9db Make FICL_TRACE default.
Add freebsd.fr, for FreeBSD specific forth source. Add $ and %, to
replace the lost @ and - functionality of include. $ has the opposite
behavior of @ though, since the default behavior was inverted.
1999-02-04 17:13:49 +00:00
dcs
755c131c9f Make use of prototypes to silence warnings.
Change include() so it will be able to load files with forth code,
instead of just builtins. Remove #@- from the include section of the
help file, since they don't work in the new version of include, unless
BOOT_FORTH is not defined.

Change bf_run() so it will return the result returned by ficlExec(). Also,
make bf_run() push "interpret" to be executed by ficlExec(), since ficlExec()
doesn't do it by itself. (Things worked previously because nothing
recursed through ficlExec() by the way of bf_run()).

Change/extend comments on builtin behavior.

Search for "interpret" at the end of bf_init(), so /boot/boot.4th can
provide it's own version.

Remove dead code.
1999-02-04 17:06:46 +00:00
dcs
60ace12c39 Make ficlExec recursive. This removes vmReset and vmQuit from the
error cases, but the replacement should be doing everything they
did, except what did shouldn't be doing, and might do a little more
they ought to be doing.
1999-02-04 16:53:47 +00:00
dcs
90242e0822 Fix ficlExecFD to take kern/9412 changes into account. Also modify it
not to vmThrow errors. This is not what the comments say it does, and
it doesn't work when there is no ficlExec environment (like it's only
use in sys/boot/common/interp_forth.c).

PR:		bin/9772
1999-02-04 13:28:56 +00:00
dcs
0fa743a353 The trace facility was full of bugs. Correct that by using the
right variable.

PR:		bin/9756
1999-02-04 13:20:30 +00:00
dcs
a68d5c9544 Silence a warning.
PR:		bin/9754
1999-02-04 13:16:21 +00:00
dcs
028fe6b9d1 The previous fix for "type" was absolutely lousy. Not only the buffer
allocated was not big enough, but it ended up to being used where it
was supposed to be used. The person who did that ought to be shot, but
since I'm a good person, I'll forgive myself...

PR:		bin/9743
1999-02-04 13:06:47 +00:00
dcs
0ebff7e4fd Add conditional compilation facilities to ficl. This had been previously
committed to RELENG_3 instead of HEAD, so let's HEAD catch up.

PR:		bin/9662
1999-02-04 12:57:56 +00:00
msmith
95a45fc122 Mention the net.inet.tcp.tcbhashsize tunable. 1999-02-03 09:07:33 +00:00
kato
c40db6cc73 PC98 version of new boot loader. Because boot2 has not yet ported,
files in boot2 directory are copies from legacy biosboot.

Submitted by:	IMAI Takeshi <take-i@ceres.dti.ne.jp>
1999-02-03 08:39:09 +00:00
jkh
d02485ce0b Whoops! Forgot to include Mr. Sobray's more command in the last set
of commits.

Submitted by:	Daniel C. Sobral <dcs@newsguy.com>
1999-02-01 06:08:21 +00:00
rnordier
c84955e100 Check size of partition before using it. 1999-01-29 03:36:42 +00:00
msmith
fa6b76178f Document the machdep.pccard.pcic_irq tunable, which allows the user to tune
the interrupt which will be given to the PCIC.  If the value supplied is
illegal or not available, interrupts will be turned off and polled mode
used instead.
1999-01-29 01:16:50 +00:00
jkh
5e7aaad42f Make builtin's state-aware in loader.
Submitted by:	Daniel C. Sobral
PR:		9663
1999-01-28 06:33:03 +00:00
rnordier
7332041031 Fix a couple of further bugs: missing argument to sprintf() and
"==" used for "=".
1999-01-25 23:07:02 +00:00
rnordier
e3cbd0c0a2 Correctly record the end of the a.out symbol table. In practice, a
bootinfo structure where bi_esymtab < bi_symtab was being passed
to the kernel.  In the case of older 2.x kernels, this was causing
garbage to be printed to the video console, followed by an exception.

This should resolve a problem reported on -current by Peter Jeremy
<peter.jeremy@auss2.alcatel.com.au>.
1999-01-25 10:34:35 +00:00
msmith
e106763b92 From the PR:
I added a FICL_TRACE-conditioned trace facility based on "see".
It is ugly because words' functions are almost all static, and ficlExec,
where the trace has to be located, can't get their pointers. So, #ifdef
this staticization, and add most of see's body into ficlExec. Duplication
of code, uglyness, etc. But it is cleanly #ifdef'ed, and works like a
charm.

	It does not provide "step" facility, though, just trace. It is
tunable at run-time through "trace!". If anyone (most likely me :) ever
wants a step facility, I'll add it. Should be easy.

PR:		bin/9652
Submitted by:	"Daniel C. Sobral" <dcs@newsguy.com>
1999-01-24 06:06:21 +00:00
msmith
6f8753800c Bleh. Missing 'unit =' doesn't help legacy num_ide_disks code.
PR:		bin/9651
Submitted by:	"Daniel C. Sobral" <dcs@newsguy.com>
1999-01-24 06:03:44 +00:00
msmith
2aa626e3ff From the PR:
FICL's TYPE copies the counted string to HERE, as abial has
remarked. Answering to abial's question, this is NOT garanteed to have
enough space.
...
	We have dynamic memory. Even before memory-alloc got in, we
already had dynamic memory. Use it, then! (ficlMalloc is sysdep, so I
suppose that's why it was not used for TYPE; ficl is probably designed
to work without a working ficlFree).

Submitted by:	"Daniel C. Sobral" <dcs@newsguy.com>
1999-01-24 05:58:18 +00:00
msmith
d0d15b4eb8 Document root_disk_unit 1999-01-24 00:12:17 +00:00
msmith
1e566c5505 biosdisk.c
Implement a new variable 'root_disk_unit' which supersedes
	'num_ide_disks' and makes it possible to explicitly set the
	root device unit number regardless of type considerations.

bootinfo.c
	If we can't calculate a dev_t for the root disk, complain and
	don't proceed to boot with an invalid boot device.
1999-01-24 00:12:04 +00:00
msmith
13b06fbe36 Fill in the bi_bios_dev field in the bootinfo struct; the loader doesn't
guess this value well in anything other than the simplest of situations.
1999-01-24 00:10:10 +00:00
msmith
355b55c282 Add EXCEPTION word set.
Make TIB handling use buffer size to conform with ANS Forth.

Add ANS MEMORY-ALLOC word set.

See the PRs for extensive details.

PR:		kern/9412 kern/9442 kern/9514
Submitted by:	PRs from Daniel Sobral <dcs@newsguy.com>
1999-01-22 23:52:59 +00:00
msmith
1ebf60a806 bootstrap.h
help.common
interp.c
	Rename the 'source' command to 'include' in order to avoid conflict
	with the ANS Forth command of the same name. (kern/9473)

interp_forth.c:
	Changes from kern/9412 (EXCEPTION word), kern/9442 (TIB buffer
	sizing) and an improved version of kern/9460 (set
	version numbers).

load_aout.c:
	Trim some obsolete #if 0'ed cruft.

pnp.c:
	Tidy the pnpscan output, turn off the module scanning until we
	sort out how to do it right.

PR:		kern/9412 kern/9442 kern/9460 kern/9473
Submitted by:	PRs from Daniel Sobral <dcs@newsguy.com>
1999-01-22 23:50:14 +00:00
rnordier
e345acf488 Fix extraneous free() on error. 1999-01-22 21:33:52 +00:00
rnordier
8603959049 Fix read error not being detected. 1999-01-22 18:32:52 +00:00
rnordier
aa2df6372b Push version numbers up to 1.00. This is just intended to reflect
that the BTX code can be regarded as stable: there are no associated
code changes.

Suggested by: obrien
1999-01-22 13:07:17 +00:00
msmith
d6db5cac76 Add 'set tunables' help, list the kernel tunable values that can currently
be overridden.
1999-01-21 22:03:16 +00:00
msmith
488523664e Transition from using Perl to using awk for our text-manipulation
needs.  This removes the dependancy on Perl for the generation of the
loader, allowing the world to be built on a perl-free system.

Submitted by:	Joe Abley <jabley@clear.co.nz>
1999-01-18 19:05:27 +00:00
jdp
7144bbc986 Replace duplicated "old" linker set definitions with an include of
<sys/linker_set.h>.  Note, this isn't used on the i386.
1999-01-16 03:25:24 +00:00
abial
cb4a248c7e Fall back to /boot/boot.conf, if /boot/loader.rc was not fount. This is
to cover the transition period.

Suggested by:	msmith
1999-01-15 00:31:45 +00:00
abial
010f76153c Change counter-intuitive pc@ and pc! to inb and outb.
Submitted by:	jkh
1999-01-14 23:48:03 +00:00
rnordier
6edc8726f9 In the event of a disk error, boot2 is expecting an error
code to be returned: give it one
1999-01-13 23:30:07 +00:00
abial
e7c0e116e6 Change /boot/boot.conf to /boot/loader.rc - this name reflects what it
really is.

Agreed upon by:	jkh, msmith and many others
1999-01-13 21:59:58 +00:00
abial
741d3b95c6 Add words "pc!" and "pc@" which allow to manipulate I/O ports. This can
be helpful when directly fiddling with PC hardware.

Also, define "arch-i386" appropriately, as suggested by Daniel C. Sobral.
1999-01-13 21:31:50 +00:00
msmith
edc692a016 Typo in patch application.
PR:		kern/9459
Submitted by:	"Daniel C. Sobral" <dcs@newsguy.com>
1999-01-13 08:11:41 +00:00
rnordier
192bb84877 Drop boot.help support. 1999-01-11 11:36:03 +00:00
msmith
d141889ddd No builtin command resets getopt before using it, causing
problems in case a wrong option was given previously, and no option
is given to the next command.

PR:		kern/9371
Submitted by:	"Daniel C. Sobral" <dcs@newsguy.com>
1999-01-11 06:41:32 +00:00
msmith
527d380042 Preserve the previous loader as loader.old.
Note no matching commit for the Alpha, as the alpha boot0 stage does
not have the ability to prompt for user input.

PR:		kern/9406
Submitted by:	 "Daniel C. Sobral" <dcs@newsguy.com>
1999-01-11 05:52:28 +00:00
msmith
ea810b3ebb Disable kzipping the loader; it seems to be breaking the aout-to-elf build 1999-01-10 20:20:27 +00:00
steve
01f82cbb96 Remove redundant line of code.
PR:		9364
Submitted by:	Daniel C. Sobral <dcs@newsguy.com>
1999-01-10 18:22:23 +00:00
rnordier
7f3d245232 Use etc/make.conf settings for serial port and speed.
Submitted by: rvb
Reviewed by: bde
1999-01-10 14:48:05 +00:00
peter
6f74dc01b4 Damn, I thought I had committed this already, but it seems not.
Move the relocated boot1 and arg transfer space from 0x600/0x800 to
0x700/0x900.  In theory this should make no difference, apart from the fact
that Buslogic controllers happen to use a few bytes at 0x600 for some sort
of scratch space for it's int 0x13 hook (!!!), causing the machine to crash
badly when the boot2 code makes it's callbacks into boot1 for disk IO.

Submitted by:	Robert Nordier <rnordier@freebsd.org>
1999-01-10 13:29:52 +00:00
msmith
e50aa55751 Enable escapes for $ to make it possible to insert variable names into
other variable values.
1999-01-10 05:08:12 +00:00
msmith
48d88654f8 Explicitly look for kzip in /usr/bin, again this is a stopgap, to avoid
making kzip a build tool.
1999-01-09 20:14:46 +00:00
msmith
dc29b5609b kzip the loader, this shrinks it to about 60% of its original size.
Note that this is a stopgap with dependancies on the a.out tools.
1999-01-09 02:38:40 +00:00
msmith
6ed8cbf467 Extend bd_print() so that it displays slices and partitions on disks. 1999-01-09 02:36:19 +00:00
msmith
4077891a70 Add a description for 'lsdev' so that it shows up in the '?' display 1999-01-09 02:34:48 +00:00
msmith
e6452a0522 Alpha-specific help topics (currently empty) 1999-01-05 20:44:26 +00:00
peter
46c636cd84 Fix a potential sign extension bug on 8-bit chars.
Outputting a backspace isn't supposed to be destructive..  It isn't on
most terminals, nor on the standard bios output (vs. TERM_EMU mode)
1999-01-04 18:45:08 +00:00
peter
6a8415504a Fix variable initialization.. It was written with '==' instead of '-'.
#include <string.h> for string prototypes.
1999-01-04 18:39:24 +00:00
peter
0e973448d5 Clean some unused variables lint 1999-01-04 18:38:23 +00:00
peter
2304ebab76 Don't forget a trailing \n when loading a kernel that has been stripped.
(This might make ELF_VERBOSE look funny, but I'm tempted to delete that
 anyway)
1999-01-04 18:37:41 +00:00
msmith
18c1130833 Restore dependancy to build loader.help here 1999-01-04 01:28:46 +00:00
msmith
eec8f14ee3 Add dependancy to build loader.help here 1999-01-04 01:28:39 +00:00
msmith
b4c6624855 First cut at generating loader.help for the alpha 1999-01-03 20:54:05 +00:00
msmith
a344fa1d6d Reenable generation of the loader.help file 1999-01-03 20:50:35 +00:00
jkh
a8ac3175ba Update for new boot block location. 1999-01-02 23:22:12 +00:00
abial
25196ce9dd Add support for some FACILITY words:
key? ( -- flag)  \ check to see if there's a key to be read from input
ms   ( u -- )    \ wait that many milliseconds
seconds ( -- u ) \ get number of seconds from midnight.

'words' now outputs the list page by page - this probably should go
through libstand's pager, but will have to wait for closer integration of
built-ins with Forth...

Submitted partially by:	W Gerald Hicks <wghicks@bellsouth.net>
1998-12-31 14:03:28 +00:00
abial
b3642b0f23 Add back ability to make beeps when using new TERM_EMU.
Submitted by:	W Gerald Hicks <wghicks@bellsouth.net>
1998-12-31 13:44:04 +00:00
abial
75069f671c Add simple terminal emulator, compatible with cons25. Currently supported
capabilities are: AF, AB, cm, ho, me, cd. The code is hidden behind
-DTERM_EMU - should it cause any problems, you can remove this define
to get back the old behaviour.

You'll find some examples how to use it in src/share/examples/bootforth.

Reviewed by:	jkh
1998-12-22 11:51:25 +00:00
abial
866889d236 Add new word ".#" which acts like "." but doesn't output a space separator.
I found it impossible to output parametrized strings like "\033[%d;%dH"
without building them first in pad area.
1998-12-22 11:46:27 +00:00
abial
524f060924 * Begin integration of built-ins with Forth: leave the exit code from
a built-in command on Forth stack.
* Fix a bug which was causing a panic when loading stripped aout kernels.

Reviewed by:	jkh
1998-12-22 11:41:51 +00:00
n_hibma
0dfe97f554 Removed dynamic loading of FileHandle 1998-12-16 09:09:09 +00:00
msmith
fca47ff171 Disable build/install of boot.help until we sort out how to construct it
in the makeworld environment.
1998-12-16 02:27:15 +00:00
msmith
8b77bf750a Reformat help to improve subtopic display appearance, other minor
cleaning.  The 'help' command in the loader should now be usable and
hopefully informative.
1998-12-15 14:32:17 +00:00
msmith
98e8c7d522 Build the composite help file from the generic and architecture-specific
help files, sorting topics and subtopics to allow maximum flexibility.
1998-12-15 14:21:30 +00:00
msmith
bd4b286939 unlocalise build date (merge from i386) 1998-12-15 04:27:15 +00:00
ache
c46111d079 unlocalize date
Submitted by: Cejka Rudolf <cejkar@dcse.fee.vutbr.cz>
1998-12-07 16:17:41 +00:00
rnordier
e625ce3562 Revise some comments and labels. 1998-12-05 11:58:33 +00:00
rnordier
3b5f1e1ac9 Drop EDD support detection, though retain configurable use of disk
packet interface.  Add booteasy-style F5 support.  Add no-update
option. Implement various space optimizations and consistency fixes.
1998-11-29 14:09:00 +00:00
rnordier
2b7d69a8df Drop use of BIOS int 0x14 services in favor of direct port I/O.
Feedback and testing: Adrian Filipi-Martin <adrian@ubergeeks.com>
1998-11-22 07:59:16 +00:00
archie
fe1c18e2d4 Fix misallocation of buffer bug (too short) 1998-11-20 02:57:41 +00:00
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
msmith
70b71c8c7a Add documentation for $rootdev. 1998-11-13 23:53:02 +00:00
msmith
20e409b11b Add a new variable $num_ide_disks which is used to offset the unit number
for SCSI disks when converting from BIOS unit numbers to da unit numbers.

Prompted by Kevin Street <street@iname.com>
1998-11-13 23:40:02 +00:00
jkh
c6de7d3383 bootforth seems to be working well enough for me and others to turn
on by default.  If it causes trouble, it's very easy to switch off again.
1998-11-12 07:40:51 +00:00
rnordier
225b2f2541 Revise error messages. 1998-11-11 08:56:17 +00:00
rnordier
66796bdb7f Prevent boot.config being parsed more than once. 1998-11-08 18:37:28 +00:00
rnordier
b8cddca3cd Drop the familiar 'text=xxxx data=xxxx bss=xxxx ...' display while
loading.  This eliminates noise when loading boot/loader; and when
loading a kernel, they generally flash by too fast to be
intelligible anyway.
1998-11-08 18:29:29 +00:00
rnordier
040db5b721 boot1: Eliminate EDD detection and optional use of disk packet
interface.  Do some general consistency fixes and space optimizations.
Use of some freed-up space to defend against possible BIOS misfeatures.

boot2: Revise disk read interface to provide for boot1 changes.  Free
up space for this.
1998-11-08 15:36:35 +00:00
jkh
94f344ce1c o Add proper stack checking to all file words
o add fkey and fread
o eliminate fexists now that this can be expressed in HLL forth
  ( : fexists fopen dup -1 <> if fclose 1 else drop 0 then ; ) :-)

Once we get the ability to write files, it should be possible to do
stand-alone rescue work from the 3rd stage boot. :)
1998-11-07 17:38:40 +00:00
jkh
9c7d73f4f1 Eliminate much code cruft by extending simple file I/O API to include
fopen and fclose.
1998-11-07 06:18:06 +00:00
jkh
0ba901f49f Eliminate much code cruft by extending simple file I/O API to include
fopen and fclose.  Also look for /boot/boot.4th now and, if found,
load its contents.
1998-11-07 06:18:00 +00:00
jkh
4a9e91d8fe Take init out of here - it's a layering violation. 1998-11-07 05:01:25 +00:00
jkh
28962a6fad Don't have debugging on by default - it makes testing annoying. :) 1998-11-07 03:44:10 +00:00
jkh
e55571e9e2 OK, fload/fexec work properly when both compiling and interpreting
now.  Gack.
1998-11-07 01:56:06 +00:00
jkh
010392a4c7 switch words to default mode. 1998-11-06 23:50:08 +00:00
jkh
4ab0ef7d74 Submit better fix to the prompt bug. 1998-11-06 23:22:26 +00:00
jkh
d539a87b02 Make fexists/fload work with existing string literals instead. Doing
my own string literal handling is just too wonky.
1998-11-06 23:20:32 +00:00
jkh
3faff5bf0f Argh, I had this right[er] before. More commits to follow. 1998-11-06 19:17:03 +00:00
jkh
f867ac1646 Use proper literal names. 1998-11-06 04:01:32 +00:00
msmith
49cc339a79 Ack. Create parseable command tail properly, and eat args out of the TIB. 1998-11-06 03:50:44 +00:00
msmith
f224c67907 Don't not print the prompt string; not doing this has funny side-effects.
Make the prompt an empty string instead.
1998-11-06 03:47:08 +00:00
msmith
8602321e78 Don't use the poxy vmGetString interface (who uses counted strings these
days?), get the input buffer ourselves.  Add some debugging code.
1998-11-06 03:45:36 +00:00
rnordier
b975f40fac Make use of BIOS int 0x13 extensions configurable, and disabled
by default.
1998-11-05 20:52:25 +00:00
jkh
33ecda9af6 Remember a bit more of my forth and do:
o Add fexists word to check for the presence of a file
o make fexists and fload immediate words which DTRT both interpreted
  and compiled (doh!)
o add an init word which gets run at bootstrapping time to do extra
  post-coldload initialization (in the default implementation, we
  look for /boot/boot.4th and load it if found).
1998-11-05 08:39:43 +00:00
jkh
8d2ee599b0 1. rebuild all elements of testmain properly for safety.
2. add fload and key prims for doing simple file and terminal I/O, respectively
1998-11-05 07:27:55 +00:00
msmith
c9082bd8f6 Explicitly invoke perl to run the softwords.pl script in case the
script is not executable.
Submitted by:	Don Lewis <Don.Lewis@tsc.tdk.com>
1998-11-05 04:54:05 +00:00
msmith
38c50ef266 Improve the assertion testing for successful softword compilation.
The excessive use of assert() vs. robust error checking is annoying.
1998-11-04 07:07:18 +00:00
msmith
41affade8b Turn off -g accidentally left in from testing. 1998-11-04 03:42:36 +00:00
msmith
4797b6fa60 Fix includes; we were still pulling in <stdlib.h> in some places.
Support building a standalone interpreter with 'make testmain', remove
win32 and egregious gets() in testmain.c
1998-11-04 03:42:16 +00:00
msmith
b5e4ddf831 Use a smaller default dictionary to waste less space. 1998-11-04 03:41:09 +00:00
jkh
0f99bfc6c0 Respect ${.OBJDIR} properly when looking for libficl.a 1998-11-04 02:36:18 +00:00
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
rnordier
fa52c3954a Activate boot2. 1998-10-14 20:40:56 +00:00
peter
1a9a80c3f7 Link fdboot to boot1 as well. 1998-10-14 13:19:52 +00:00
peter
a6df719969 Initial attempt to update the Alpha loader and kernel to use the machine
independent elf loader and have access to kld modules.  Jordan and I were
not sure how to create boot floppies, and the things we tried just made
SRM laugh in our faces - but it was upset at boot1 which was not touched
by these changes.  Essentially this has been untested. :-(

What this does is to steal the last three slots from the nine spare longs
in the bootinfo_v1 struct to pass the module base pointer through.

The startup code now to set up and fills in the module and environment
structures, hopefully close enough to the i386 layout to be able to use
the same kernel code.  We now pass though the updated end of the kernel
space used, rather than _end. (like the i386).

If this does not work, it needs to be beaten into shape pronto.  Otherwise
it should be backed out before 3.0.

Pre-approved in principle by: dfr
1998-10-14 09:53:25 +00:00
peter
5e3acbf57e Try and get the sys/* and machine/* includes via relative paths. This
saves having to do a 'make includes' after touching any header file for
the boot code.
1998-10-14 07:08:16 +00:00
peter
0966fead52 Align to sizeof(long) rather than sizeof(int32_t). It needs to be
long because this code is shared with the alpha.  I hope the alpha can
read 32 bit ints at 32 bit alignment (vs. 64 bit alignment).
1998-10-14 05:07:23 +00:00
rnordier
f844028be7 Fix btx include path. 1998-10-14 01:53:56 +00:00
peter
b059e72205 Tweak the output one more time again. The kernel or module pathname
is useful, and usually fits all on one line with the load sizes.
1998-10-14 00:41:17 +00:00
rnordier
e4f3dfea8d Include <bsd.prog.mk>. Add install target (to /boot for now). 1998-10-14 00:24:16 +00:00
rnordier
828b808519 Fix flow of control after directory listing; enable EDD support;
cosmetics.
1998-10-13 23:43:38 +00:00
rnordier
0cb607c6dc Make v86.ctl default more explicit; simplify read error-handling;
twiddle.
1998-10-13 23:00:47 +00:00
rnordier
a168d3cb17 Adjust NDEV value.
Optimize reading of system time.
1998-10-13 22:17:05 +00:00
rnordier
4c49cf4675 Change to a 15-sector boot2.
Refine slice-handling.
1998-10-13 21:35:42 +00:00
rnordier
05e05b3c64 Don't use an absolute path to objcopy.
Noticed by: Scott Mace <smace@intt.org>
1998-10-13 18:29:18 +00:00
rnordier
38a0335208 Improve drive recognition and handling. 1998-10-13 17:41:06 +00:00
peter
f266373595 Make the ELF load messages cleaner. 1998-10-13 09:25:27 +00:00
rnordier
c4aec13535 New boot blocks: support for /boot/loader; a.out & ELF; cyl > 1023;
multiple 0xa5 slices; etc.
1998-10-12 21:16:26 +00:00
rnordier
e3811b3bae This commit was generated by cvs2svn to compensate for changes in r40269,
which included commits to RCS files with non-trunk default branches.
1998-10-12 21:16:26 +00:00
rnordier
0a456c31da New boot blocks: support for /boot/loader; a.out & ELF; cyl > 1023;
multiple 0xa5 slices; etc.
1998-10-12 21:16:26 +00:00
peter
b7f5f65708 Only print kernel entry point during load.
Drastically quieten down the verbose load progress messages.  They were
more useful for debugging than anything, but are beyond a joke when loading
a few dozen modules.
Simplify the ELF extended symbol table load format.  Just take the main
symbol table and the string table that corresponds.  This is what we will
be getting local symbols from.  (needed for the alpha stack tracebacks).
Use the (optional) full symbol tables in lookups.  This means we have to
furhter distinguish between symbols that can come from the dynamic linking
table and the complete table.
The alpha boot code now needs to be adapted as ddb/db_elf.c cannot use
the simpler format.
I have not implemented loading the extended symbol tables from the syscall
interface yet, just for preloaded modules.
I am not sure about the symbol resolution.  I *think* it's possible that
a local symbol can be found in preference to a global, depending on the
search sequence and dependency tree.
1998-10-12 09:13:50 +00:00
peter
8834a794bd Only print filename and entry address for the kernel itself. The rest
have a meaningless entry as they are relocatable.
1998-10-12 09:05:12 +00:00
rnordier
e0698462f3 Drop .MAKEFLAGS: hack. 1998-10-12 02:05:44 +00:00
rnordier
6924fedb20 Do without head and tail: they're pretty unnecessary here anyway. 1998-10-12 01:44:15 +00:00
rnordier
34a71608ef Use rather than for linking. This allows the new rather
than stale version of libstand.a to be found.

After this change, the new boot code is apparently building correctly
in a make world.
1998-10-12 01:03:00 +00:00
rnordier
45d3f503c7 Override for ELF. 1998-10-11 12:59:40 +00:00
rnordier
acc5d22f1d Override for ELF. Override .s.o suffix rule. 1998-10-11 11:27:48 +00:00
peter
9777d36292 Fix a warning that's been bugging me for ages. 1998-10-11 10:29:49 +00:00
peter
6a0a122684 Fix a warning 1998-10-11 10:28:51 +00:00
peter
264893b2f7 Probe all consoles, not just the first. It doesn't make a lot of
difference, but might later on when we implement some sort of multi-head
console mode.  Select a console after probing them all.
Don't strdup a potentially NULL return from getenv().
If we don't select an active console, choose the first regardless.
Call the console init function, at startup time and on a manual change.
The env_setenv() function needs EV_VOLATILE because it's pointing to
data that isn't malloc'ed and will cause a fault if it's freed later.
1998-10-11 10:19:11 +00:00
peter
f90e8eba25 Cosmetic: After the autoboot timeout, print a \n. 1998-10-11 10:10:41 +00:00
peter
000dea089b Only call vidc_init() once (unless forced).
Cosmetic change to the init-time character eater (like, make it increment
the index counter - if there's a problem, it would sit there in an infinite
loop instead of only running 10 times).
1998-10-11 10:07:52 +00:00
peter
ea08aa4013 Fix comconsole mode. The int 0x14 read and status commands were reversed.
Also, make sure we set %dx each time around otherwise the commands
suddenly start trying to work on things like com92 instead of com1.
Make sure comc_init() is only run once.
Cosmetic change to init-time character eater.
1998-10-11 10:05:13 +00:00
peter
2f4399a063 Warn that one of the DEBUG statements has a v86 recursion bug. 1998-10-11 10:01:55 +00:00
peter
8a8128b194 Fix comment to match code 1998-10-11 09:53:30 +00:00
dima
8066fbde53 add <sys/linker.h> 1998-10-11 03:53:35 +00:00
rnordier
ff07c61cc9 Fix a typo.
Output another newline before invoking bootstrap.
1998-10-10 14:03:03 +00:00
rnordier
adfacacde6 Turn off the new /sys/boot stuff (except boot0) unless OBJFORMAT
is elf.  (The BTX client must be ELF, though it is packaged as a.out
for compatibility.)
1998-10-09 23:30:16 +00:00
peter
cf0b734c3d Attempt to at least align MODINFO_* blocks. IMHO, decoding this stuff
should be MD code since one day we'll have to recover pages from deleted
preload data.  MI code can't be expected to know how to deal with pmap
internals, assuming it gets done via pmap that is. :-)
1998-10-09 23:24:55 +00:00
peter
259638944d Turn symbol table info passing back on, although it's probably not
particularly useful in this form.  KLD can deal with it much better.
setenv kernelname moved earlier.
1998-10-09 23:22:30 +00:00
peter
aa0de1fb18 Remove kernelname setenv, the common code does it.
Use the metadata for symtab pointers, mainly to keep it common with
elf_freebsd.c.
1998-10-09 23:20:47 +00:00
peter
591c24c542 Implement preloading for elf modules
- get dependency info from PT_DYNAMIC's DT_NEEDED tags.
 - store MODINFOMD_DYNAMIC for the kernel's later use
setenv kernelname when we have it
Fix firstaddr/lastaddr calculation (duh! :-)
Explicitly skip string table with section names in it.
1998-10-09 23:18:43 +00:00
peter
1ee0daa7ac Preload support for a.out KLD not implemented yet. (almost)
KLD modules are *not* PIC.  (Shared libs are pic to avoid relocations
causing copy-on-write, that's irrelevant here).
setenv kernelname when we load it.
Use MODINFO_SSYM/ESYM for each symbol section when (if) there are
more than one being loaded.
1998-10-09 23:15:39 +00:00
peter
2316c4c479 Use a consistant module search path (same as kernel will be).
Use new dependency mechanism.
1998-10-09 23:12:34 +00:00
peter
5d7982f149 loader <-> kernel preload module interface constants moved to common file.
Remove Mike's explicit data structures for dependency info.  This is
done via DT_NEEDED etc in the dynamic section for now.  This may need
to be revisited later on.
1998-10-09 23:11:05 +00:00
rnordier
017fa2eb67 Get this building as a.out or ELF.
With thanks to: jdp
1998-10-09 17:19:51 +00:00
msmith
ac6a24ba47 Remove some debugging code.
Do a much better job of DWIM with partial device specifications.
Fix the module metadata build process, which was completely broken.
Use a larger read buffer when copying large objects in; this
improves performance marginally and will avoid flushning any small caches
we might choose to implement.
1998-10-09 07:11:19 +00:00
msmith
67ce8300f6 Sync the MODINFO constants with <sys/linker.h>
Remove debugging in command_read().
Correctly strip leading controls on script commands.
Make 'ls' more DWIM in regard to pathnames.  We can still do better.
1998-10-09 07:09:22 +00:00
peter
e21834764b Fix that pesky boot aguments parsing bug. (I think :-) 1998-10-07 10:55:46 +00:00
msmith
aaa2a6fba9 Request the flags back when checking for keyboard status.
Submitted by:	rnordier
1998-10-07 07:34:31 +00:00
msmith
29868f7f79 Enable the DOS filesystem. NOTE: you will have to rebuild libstand in
order to be able to build again.
1998-10-07 02:39:32 +00:00
msmith
87bb4f6f57 - Drain the keyboard buffer when initialising.
- Be pedantic about the return from int 16 fn 01.
1998-10-07 02:39:06 +00:00
msmith
387d0e8c2b - VERBOSE_LS is obsolete, as the heap is much better behaved now.
- Don't whine about nodes we can't stat(); these are usually
   symlinks that lead out of the filesystem.
 - Autoboot is now controlled by $autoboot_delay, which is a value
   in seconds or NO to disable autoboot.
 - Don't autoboot at the end of boot.conf if we have already tried.
 - Add a 'read' command to complement 'echo'.  Both are still hidden.
 - Improve the 'source' command/function so that it is possible to
   source scripts off removable media.  The entire script is read and
   saved before beginning execution.  Script lines beginning with
   '@' will not be echoed when being executed.  Script execution will
   normally terminate at the first error, however if the script line
   begins with '-' this behaviour is overriden for that command.
1998-10-07 02:38:26 +00:00
msmith
436333e172 VERBOSE_LS is obsolete 1998-10-07 02:33:01 +00:00
msmith
9d7a6d77c8 bootinfo.c
Strip any device name information from the kernel name
	before passing it in.

biosdisk.c
	Be more strict about matching device names to slice entries.
	Only allow unsliced syntax on unsliced disks.
1998-10-06 07:27:05 +00:00
rnordier
484920ce83 Fix for "get base memory" bug found and mostly fixed by Mike. 1998-10-06 07:15:35 +00:00
msmith
723e5c6a84 The BIOS memory size is only a word. Some BIOSsen have garbage in the other
16 bits we were reading here, causing loss of arguments.
1998-10-06 06:13:36 +00:00
msmith
1a62a98115 Build boot0 as well. 1998-10-06 06:12:55 +00:00
rnordier
57f6784e78 Install in /boot. 1998-10-05 19:20:36 +00:00
rnordier
e5d9330f4d boot0 is a booteasy (boot manager) workalike with EDD support. 1998-10-05 10:08:37 +00:00
rnordier
e2e5ad22f0 This commit was generated by cvs2svn to compensate for changes in r39973,
which included commits to RCS files with non-trunk default branches.
1998-10-05 10:08:37 +00:00
msmith
3cdfede597 Insert whitespace between unargv'd arguments.
Submitted by:	"Louis A. Mamakos" <louie@TransSys.COM>
1998-10-05 05:40:58 +00:00
rnordier
dd5f9d7739 Adjust setting of argument pointer for BTX 0.87. 1998-10-04 21:15:45 +00:00
rnordier
93bf58f69c Allocate space for storing of arguments at the end of conventional
memory.
1998-10-04 21:14:33 +00:00
msmith
c53904ec56 Don't include ELF symbol information yet - it causes the ELF DDB to
explode.
1998-10-04 20:58:46 +00:00
msmith
2e5ae0a020 Improve the handling of the initial bootdev value from the previous loader.
Remove some unused code.
1998-10-04 09:12:54 +00:00
msmith
19c8db49e0 biosdisk.c
Allocate space for, and copy, NDOSPART slice entries from the
	MBR, not just one.  Add some extra debugging while we're at it.

elf_freebsd.c
	Initialise the symbol table start/end pointers in case we don't
	have them.
1998-10-04 09:12:15 +00:00
rnordier
b21275d877 Missing newline in heap command display.
Noticed by: jkh
1998-10-03 18:27:50 +00:00
rnordier
c59c5c0235 For system calls, reboot without prompting; for exceptions, display
message and await reset.
1998-10-03 18:05:12 +00:00
rnordier
5638c62ba7 Map all BTX system pages readable at ring 3.
This resolves the firmware problem first raised in connection
with PR 8105, although unrelated.
1998-10-03 14:33:06 +00:00
rnordier
9d6dbb0c2e bootinfo bi_vesa no longer exists. 1998-10-03 14:13:30 +00:00
msmith
6d472197ec Consolidate the bootinfo-loading code, greatly simplifying the _exec
functions.
1998-10-02 20:53:17 +00:00
msmith
f72bb5109c Fix an egregious precedence bug. 1998-10-02 20:52:26 +00:00
msmith
bcb24d714a Set $currdev according to our best guess at the BIOS device that the previous
bootstrap loaded us from.
1998-10-02 16:33:43 +00:00
msmith
a7e19924ad aout_freebsd.c
Use bd_getdev() to work out a dev_t for the root device.
	Allow $rootdev to override $currdev as the root device.

biosdisk.c
	Save the slice table and disklabel when opening a disk.
	Add bd_getdev(), which attempts to return a dev_t corresponding
	to a given device.  Cases which it still doesn't get right:
	 - The inevitable da-when-wd-also-exists
	 - Disks with no slice table (the slice number is not set correctly)
	The first is difficult to get right, the second will be
	fixed in an upcoming commit.

comconsole.c
vidconsole.c
	getchar() should return an 8-bit value; some BIOSsen pack extra
	information in %eax.

libi386.h
	Remove some stale prototypes, add new ones.
1998-10-02 16:32:45 +00:00
msmith
4e9232983b Mark exit() as __attribute__((__noreturn__)) 1998-10-02 16:22:54 +00:00
msmith
9844efc6b7 boot.c
Increase the robustness of the "is it time to boot yet" test;
	if the time skipped the "when" time, we would miss it.
	Don't spin in an endless loop if we don't find the first possible
	kernel suggested.  When we run out, don't try to load an empty
	kernel name.

load_aout.c
	printf format warnings
1998-10-02 16:22:26 +00:00
peter
a79bd7a693 First shot at loading elf symbols. Things are a bit strange because
of the ..umm.. "wierd" way binutils lays out the file.  The section
headers are nearly at the end of the file and this is a problem when
loading from a .gz file which can't seek backwards (or has a limited
reverse seek, ~2K from memory).

This is intended to be compatable with the ddb/db_elf.c code and the
alpha/libalpha/elf_freebsd.c layout.  I've studied these (which are NetBSD
derived) but did it a bit differently.  Naturally the process is similar
since it's supposed to end up with the same result.
1998-10-02 08:04:56 +00:00
jkh
5b11e52736 Override STRIP so installation doesn't try to strip the loader. 1998-10-01 09:57:09 +00:00
peter
67498e0651 Make 'make install' do something that might be useful. 1998-09-30 22:37:47 +00:00
peter
2a56913e23 Stop libi386.a from being installed.. 1998-09-30 22:36:45 +00:00
peter
3dd2274e4f Turn on i386-elf 1998-09-30 19:48:42 +00:00
peter
aa07eb9f84 i386 ELF loader startup backend. On an ELF kernel booted with the 3-stage
bootblocks, the kernel shows up as the primary module:

[3:24am]~-100# kldstat
Id Refs Address  Size     Name
 1    1 0xf0100000 ff00000  /kernel
		   ^^^^ oops.. :-)

Based heavily on aout_freebsd.c.  Hmm.. There's so much in common that
these could probably be combined and just check the metadata to see which
format it is.
1998-09-30 19:48:09 +00:00
peter
736cc28307 Save booted kernel name. Cosmetic cleanups. 1998-09-30 19:42:06 +00:00
peter
3a7eff1835 Fix typos.. The vector for "int 0x12" (get base mem) is not written in
hex as "0x1a". :-)
Fix a comment about the extended memory checks, that's int 0x15.
1998-09-30 19:41:07 +00:00
peter
13ed7743e0 ELF loader, part 1. It works with ELF kernels generated on the i386
so far, and should probably be able to be made to work for the alpha
without too much trouble once it's connected up and my assumptions tested.

I think (but have not tested) it will also load "old" ELF kernels that
were not linked with DYNAMIC headers.

The module glue is yet to come. (oh fun.. :-)

It does not explicitly load symbols [yet].  The _DYNAMIC data contains a
runtime symbol set that ddb can use via ddb/db_kld.c.  It'll be missing
some detail that stabs normally provides (eg: number of args to a function,
line numbers, etc).  On the other hand, those minimal symbols will always
be available even on a stripped kernel.

This is mostly stolen from load_aout.c with some ideas from
alpha/libalpha/elf_freebsd.c.
1998-09-30 19:38:26 +00:00
peter
956d202701 s/out_loadmodule/aout_loadmodule/ in a printf diagnostic. 1998-09-30 19:26:23 +00:00
peter
f989be112e Uncomment prototype for elf_loadmodule 1998-09-30 19:25:26 +00:00
peter
fc873fcda4 The bootinfo struct was getting clobbered or not passed through correctly.
Presumably VTOP doesn't work for static objects.
The easiest way to get it working was to reserve some space after the
environment strings and copy the bootinfo struct there.
Also, set RB_BOOTINFO, it's needed.

I got the code to load and run an unmolested kernel OK for the first time
with this system a few minutes ago - at last!.  I did have to stop it
looking at the floppy though as BTX was trapping a mode 14 fault when
it look for /boot/boot.conf when no disk was in the drive. (I'm booting
from a scsi disk (bios disk 0x80)).

Now to teach it about ELF and modules :-)
1998-09-29 09:11:49 +00:00
peter
501805c399 Only bcopy the correct amount of data from the buffer in case it is ever
in an overrun situation.
1998-09-28 22:04:54 +00:00
peter
bc25156633 Use the variable with the path in it for the error message. 1998-09-28 22:03:01 +00:00
peter
51b3ea754e Reactivate the a.out kernel loader code. 1998-09-28 22:01:20 +00:00
peter
6f52c26500 Missing return value that was kinda important. 1998-09-28 21:59:21 +00:00
peter
21ca5b8d5a Argh, I don't believe how much time I wasted looking for this...
Bytes of extended memory = (extkb * 1024), not (extkb + 1024)
1998-09-28 21:39:11 +00:00
peter
d3c472a717 The comconsole mode is accessed as 'comconsole' not 'com'. 1998-09-28 20:17:05 +00:00
peter
652e75ae6c MBR magic is 0x55aa not 0xffaa. 1998-09-28 20:08:34 +00:00
peter
a9ac15c833 Precedence bug (?) causing probe problems. 1998-09-28 20:07:39 +00:00
dfr
ad6ddb7767 * Add old UFS compatibility code to alpha/boot1.
* Fix a raft of warnings, printf and otherwise.
* Allocate the correct amount in mod_searchmodule to prevent an overflow.
* Fix the makefiles so they work outside my home directory (oops).
1998-09-26 10:51:38 +00:00
msmith
73ca5cb35b Recover the arguments passed in from the previous load stage, use them to set
the default console.
Print malloc stats from the new libstand allocator.
1998-09-26 01:31:10 +00:00
msmith
bfe7e4f757 The BIOS can't perform a floppy operation where the destination crosses
a physical 64k boundary.  Allocate a bounce buffer for such a transaction.
1998-09-26 01:30:20 +00:00
msmith
7e33170a26 console.c
Allow the MI code to override the preferred console (eg. so that
	an RB_SERIAL flag from the i386 boot2 can override the default
	first active console)

isapnp.c
	Use the standard format for ISA PnP IDs.

pnp.c
	Allow trailing comments on lines, be less picky about line
	contents.

ls.c
	Cosmetic error message fix.

panic.c
	Print the right arguments.
1998-09-26 01:29:13 +00:00
peter
9f5a84eacb Make these compile when there is an obj dir. 1998-09-25 17:14:16 +00:00
dfr
00428fddff Make the alpha bootstrap build again, fix some warning and change sdboot to daboot. 1998-09-20 21:46:19 +00:00
msmith
0a0d8ce99a Make libstand movable.
This completes the basic work required to make the loader work with BTX. We
now have a third-stage bootstrap shared by the i386 and Alpha.
1998-09-19 01:35:53 +00:00
msmith
0523a3e013 - Improve debugging code.
- Make the "what do we do with a drunken disklabel" if-then-else-regardless
   tangle easier to read.
 - Don't count on the v86 structure being preserved between loop iterations,
   as it may be trampled eg. by the DEBUG call.
1998-09-19 01:33:29 +00:00
msmith
c820301756 Add a generic hexdump tool for debugging purposes. 1998-09-19 01:31:28 +00:00
msmith
c4d753268c Enable the biosdisk driver, duplicate -lstand as it both calls and is called
by the i386 platform library.
1998-09-18 02:03:30 +00:00
msmith
225ddd2fb1 Synch with development version. Compiles and opens but doesn't work yet. 1998-09-18 02:02:33 +00:00
msmith
ef33b3f094 Remove 'panic' command (it works), don't ask for a keypress in panic, as
exit() does.  Perhaps it shouldn't?
1998-09-18 02:01:38 +00:00
msmith
757180a4cf We lost all the files in crt/, so define the BIOS sector size here instead. 1998-09-18 01:12:46 +00:00
msmith
1f22597a12 Use a.out.h to get all the correct bits in one place. 1998-09-18 01:12:23 +00:00
msmith
0cf3eaddd6 Oops, missed these. Machine-independant ISA PnP enumerator. 1998-09-18 00:24:25 +00:00
msmith
f0b5ddae6f Initial integration of the i386 bootloader and BTX.
- Discard large amounts of BIOS-related code in favour of the more compact
   BTX vm86 interface.
 - Build the loader module as ELF, although the resulting object is a.out,
   make gensetdefs 32/64-bit sensitive and use a single copy of it.
 - Throw away installboot, as it's no longer required.
 - Use direct bcopy operations in the i386_copy module, as BTX
   maps the first 16M of memory.  Check operations against the
   detected size of actual memory.
1998-09-17 23:52:16 +00:00
rnordier
9e60491656 Add exec syscall. 1998-09-15 13:26:23 +00:00
msmith
97d5b83076 Resynch with working sources before BTX integration.
- Use format-independant module allocator.
 - Conditionalise ISA PnP support.
 - Simplify PnP enumerator interface.
 - Improve module/object searching.
 - Add missing depend/install targets in BTX makefiles.
 - Pass the kernel environment and module data in extended bootinfo fields.
 - Add a pointer to the end of the kernel + modules in bootinfo.
 - Fix parsing of old-style kernel arguments.
1998-09-14 18:27:06 +00:00
rnordier
71b1c34d38 Add BTX startup/interface code. 1998-09-14 10:37:00 +00:00
rnordier
ac5f389299 Enable client entry point support. 1998-09-13 13:28:07 +00:00
rnordier
b9a6cd3383 Add btxldr, a BTX loader for ELF clients. 1998-09-12 06:30:26 +00:00
rnordier
63bfe0d0ad BTX (aka the boot extender) is an i386 kernel that hosts 32-bit
bootstrap programs, and provides page-level protection, hardware
interrupt reflection, a virtual-8086 mode interface to BIOS, etc.
1998-09-12 04:29:23 +00:00
rnordier
10a70998a1 This commit was generated by cvs2svn to compensate for changes in r39088,
which included commits to RCS files with non-trunk default branches.
1998-09-12 04:29:23 +00:00
rnordier
b599878e77 BTX (aka the boot extender) is an i386 kernel that hosts 32-bit
bootstrap programs, and provides page-level protection, hardware
interrupt reflection, a virtual-8086 mode interface to BIOS, etc.
1998-09-12 04:29:23 +00:00
msmith
aa412001a9 Generic plug-and-play enumerator infrastructure. Query supplied
enumerators, crossreference returned identifiers with a text-format
database and automatically load corresponding modules and dependancies.
1998-09-04 02:43:26 +00:00