Commit Graph

82 Commits

Author SHA1 Message Date
Peter Wemm
c582ad070a Use a consistant module search path (same as kernel will be).
Use new dependency mechanism.
1998-10-09 23:12:34 +00:00
Peter Wemm
12218096e1 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
Robert Nordier
4025ae9d2a Get this building as a.out or ELF.
With thanks to: jdp
1998-10-09 17:19:51 +00:00
Mike Smith
cab57be9ae 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
Mike Smith
6ba0dd2cfc 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 Wemm
e3de88f4ff Fix that pesky boot aguments parsing bug. (I think :-) 1998-10-07 10:55:46 +00:00
Mike Smith
ee4f7b62a0 Request the flags back when checking for keyboard status.
Submitted by:	rnordier
1998-10-07 07:34:31 +00:00
Mike Smith
0bab8c3243 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
Mike Smith
0f7d15efd8 - Drain the keyboard buffer when initialising.
- Be pedantic about the return from int 16 fn 01.
1998-10-07 02:39:06 +00:00
Mike Smith
b820c8e626 - 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
Mike Smith
82bb1fb746 VERBOSE_LS is obsolete 1998-10-07 02:33:01 +00:00
Mike Smith
afcd516b82 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
Robert Nordier
b7b32c2745 Fix for "get base memory" bug found and mostly fixed by Mike. 1998-10-06 07:15:35 +00:00
Mike Smith
024e2ede72 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
Mike Smith
58d4e8e80f Build boot0 as well. 1998-10-06 06:12:55 +00:00
Robert Nordier
09c7ea1cc8 Install in /boot. 1998-10-05 19:20:36 +00:00
Robert Nordier
264ba5c0fe boot0 is a booteasy (boot manager) workalike with EDD support. 1998-10-05 10:08:37 +00:00
Mike Smith
4d7b7e52de Insert whitespace between unargv'd arguments.
Submitted by:	"Louis A. Mamakos" <louie@TransSys.COM>
1998-10-05 05:40:58 +00:00
Robert Nordier
731a4a01db Adjust setting of argument pointer for BTX 0.87. 1998-10-04 21:15:45 +00:00
Robert Nordier
18577050a0 Allocate space for storing of arguments at the end of conventional
memory.
1998-10-04 21:14:33 +00:00
Mike Smith
5f8edb2c4d Don't include ELF symbol information yet - it causes the ELF DDB to
explode.
1998-10-04 20:58:46 +00:00
Mike Smith
7546830370 Improve the handling of the initial bootdev value from the previous loader.
Remove some unused code.
1998-10-04 09:12:54 +00:00
Mike Smith
58b7e8766e 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
Robert Nordier
a2a87ebc0b Missing newline in heap command display.
Noticed by: jkh
1998-10-03 18:27:50 +00:00
Robert Nordier
3948b979ba For system calls, reboot without prompting; for exceptions, display
message and await reset.
1998-10-03 18:05:12 +00:00
Robert Nordier
9cd66506dd 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
Robert Nordier
0860fb8f8c bootinfo bi_vesa no longer exists. 1998-10-03 14:13:30 +00:00
Mike Smith
bf72f68088 Consolidate the bootinfo-loading code, greatly simplifying the _exec
functions.
1998-10-02 20:53:17 +00:00
Mike Smith
9d38269bae Fix an egregious precedence bug. 1998-10-02 20:52:26 +00:00
Mike Smith
41e43bf627 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
Mike Smith
6b15efd961 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
Mike Smith
39de38225b Mark exit() as __attribute__((__noreturn__)) 1998-10-02 16:22:54 +00:00
Mike Smith
f9ba80b0e7 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 Wemm
2e06076f23 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
Jordan K. Hubbard
4225585999 Override STRIP so installation doesn't try to strip the loader. 1998-10-01 09:57:09 +00:00
Peter Wemm
392dfcadb1 Make 'make install' do something that might be useful. 1998-09-30 22:37:47 +00:00
Peter Wemm
f511533b56 Stop libi386.a from being installed.. 1998-09-30 22:36:45 +00:00
Peter Wemm
cf6b812d33 Turn on i386-elf 1998-09-30 19:48:42 +00:00
Peter Wemm
d1a50365db 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 Wemm
e6001c6229 Save booted kernel name. Cosmetic cleanups. 1998-09-30 19:42:06 +00:00
Peter Wemm
f9489e6a0e 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 Wemm
efca1dc5ee 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 Wemm
42355b3c0b s/out_loadmodule/aout_loadmodule/ in a printf diagnostic. 1998-09-30 19:26:23 +00:00
Peter Wemm
524d1bc175 Uncomment prototype for elf_loadmodule 1998-09-30 19:25:26 +00:00
Peter Wemm
a7de32b2aa 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 Wemm
38e1ef0f4a 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 Wemm
29a1d9c4e6 Use the variable with the path in it for the error message. 1998-09-28 22:03:01 +00:00
Peter Wemm
699f872732 Reactivate the a.out kernel loader code. 1998-09-28 22:01:20 +00:00
Peter Wemm
3165db6cbf Missing return value that was kinda important. 1998-09-28 21:59:21 +00:00
Peter Wemm
5eec23025f 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