Commit Graph

1065 Commits

Author SHA1 Message Date
Doug Rabson
faf8077790 Move the first section up one page. The firmware bogusly uses the first
page of the image to load section headers and if we let the text section
start at zero, it corrupts the section table when its loaded. With this
change, the loader gets as far as the 'ok' prompt.
2001-06-10 13:39:10 +00:00
Doug Rabson
35ca79092b Remove a 'return' statement which I put in while I was trying to debug
the startup code.
2001-06-10 13:36:00 +00:00
Jesper Skriver
48e312be90 Fix a minor style bug in the last commit.
Submitted by:	Adrian Steinmann <ast@marabu.ch>
MFC after:	2 days
2001-06-10 11:15:37 +00:00
Doug Rabson
fd3e14e915 First approximation of an ia64 EFI loader. Not functional. 2001-06-09 16:49:51 +00:00
Ruslan Ermilov
0b381bf1fd Remove vestiges of MFS. 2001-06-01 10:07:28 +00:00
Daniel C. Sobral
209a9557ea Go back to 1.20 again. 2001-05-29 23:49:10 +00:00
Daniel C. Sobral
38e0371f17 Turn dictthreshold and dictincrease into cell-sized variables, so
they can be used with cell operators like !.

As I did this, I noticed the whole CELL thing might have problems with
big endian architectures with sizeof(int)!=sizeof(void*).
2001-05-29 23:44:12 +00:00
David E. O'Brien
2755dd7100 Revert the ugly band-aide[tm] hack of rev 1.12.
The offending loader.4th commit (rev 1.20) has been backed out.
2001-05-29 01:48:06 +00:00
Daniel C. Sobral
9a03de4cd8 Revert 1.20, as it causes mysterious problems to the Alpha people. 2001-05-29 00:34:32 +00:00
David E. O'Brien
dfbe5c12ae One needs to introduce things with a `.file' directive before trying to
do a .loc on it.  BTW, the .loc needs to be in a .text section.
gas 2.11.0 catches these oversights where previous versions did not.
2001-05-28 09:52:21 +00:00
David E. O'Brien
6baccdc4da grep -v offending lines from loader.4th until the master version of it
is fixed.
2001-05-28 05:18:13 +00:00
David E. O'Brien
b4cb7636c9 Add the generated help files to CLEANDIRS.
Found by:	rm -rf /usr/obj/usr/src/sys/boot ; make ; make clean ; cvs -q up
2001-05-28 05:12:13 +00:00
Jesper Skriver
961c53b8e4 In sys/boot/common/module.c, near line 105 a request for a raw
file is processed by passing its name in argv[1]:
        return(mod_loadobj(typestr, argv[1]));
however, it is not tested to see if argv[1] actually is defined.

At best, mod_loadobj() near line 244 returns an error like
"can't find 'garbage'" but if the "filename" entered is sufficiently
long, some buffer gets overrun. Of course, "load -t filename" is
actually a typo because we meant to type "load -t mfs_root filename";
nevertheless, a hung machine seems like too harsh a punishment for
such a small typo...

PR:			i386/27693
Submitted by:	Adrian Steinmann <ast@marabu.ch>
MFC after:	1 week
2001-05-27 23:26:11 +00:00
Robert Nordier
9dfe98e24e Fix reboot buglet when BOOT_BTX_NOHANG is defined.
Submitted by: Umesh Krishnaswamy <umesh@juniper.net>
2001-05-27 20:15:10 +00:00
Daniel C. Sobral
66bd171e5f As in with ":", check dictionary space and increase it if necessary before
"create".
2001-05-27 16:30:10 +00:00
Ruslan Ermilov
1166fb516b - sys/msdosfs moved to sys/fs/msdosfs
- msdos.ko renamed to msdosfs.ko
- /usr/include/msdosfs moved to /usr/include/fs/msdosfs
2001-05-25 08:14:14 +00:00
Yoshihiro Takahashi
d8b08f1591 (Re-)enabled boot2. 2001-05-24 11:19:43 +00:00
Yoshihiro Takahashi
f040ac4cec Update boot[12] program to compile ELF binary.
Submitted by:	Nobuyuki Koganemaru <n-kogane@syd.odn.ne.jp> and
		kawanobe@st.rim.or.jp (Kawanobe Koh)
2001-05-24 11:18:32 +00:00
Ruslan Ermilov
2c4645034f The following modules were renamed:
fdesc -> fdescfs
portal -> portalfs
umap -> umapfs
union -> unionfs
2001-05-23 10:06:48 +00:00
Dima Dorfman
21fa152ffa Fix a grammar nit.
PR:		27520
Submitted by:	Michael Lucas <mwlucas@blackhelicopters.org>
2001-05-22 00:29:42 +00:00
Yoshihiro Takahashi
a93f8c6e6e Merged from sys/boot/i386/btx/btx/btx.s revision 1.24. 2001-05-21 11:49:21 +00:00
Daniel C. Sobral
fa4fd1324a Allocate more memory if necessary. 2001-05-17 04:34:02 +00:00
Daniel C. Sobral
ec10295143 FICL 2.05 has a flawed definition of BASE. Fix it.
Spotted by: Peter Jeremy <peter.jeremy@alcatel.com.au>
2001-05-10 05:13:09 +00:00
David E. O'Brien
5e6220d9d0 * include/elf.h has been repo copied to include/elf-hints.h, and it no
longer includes machine/elf.h.
* consumers of elf.h now use the minimalist elf header possible.

This change is motivated by Binutils 2.11.0 and too much clashing over
our base elf headers and the Binutils elf headers.
2001-05-02 23:56:21 +00:00
Daniel C. Sobral
49acc8fe50 Bring in ficl 2.05.
This version has a step debugger, which now completely replaces the
old trace feature. Also, we moved all of the FreeBSD-specific MI
code to loader.c, reducing the diff between this and the official
FICL distribution.
2001-04-29 02:36:36 +00:00
Ruslan Ermilov
701d4ac0c1 mdoc(7) police: fixed whatis(1) entry. 2001-04-18 12:56:15 +00:00
Andrew Gallatin
f814df3b04 no longer needed now that we are able to build cdboot from sources again 2001-04-08 00:01:54 +00:00
Andrew Gallatin
3d8ec0e11f build cdboot from sources now that the cd9660 fs support works
MFC candidate
2001-04-07 23:52:31 +00:00
Doug Rabson
46b9a4ff52 Don't call prom_open() multiple times. This confuses some versions of SRM
and makes it impossible to boot from floppy and CD on some AlphaServer
platforms.

Detective work by: Michael Richards <michael@fastmail.ca>
2001-04-05 10:28:52 +00:00
Ruslan Ermilov
aa7664372f MAN[1-9] -> MAN. 2001-03-27 11:59:22 +00:00
David E. O'Brien
5d8a28f3e1 Turn off building the ARC loader. I don't know of anyone currently working
on advancing this WIP.
2001-03-25 23:07:44 +00:00
John Baldwin
b833d157c7 Always disable paging when exiting back to real mode after receiving a
fatal trap.  Also, reload the GDT register to point to BTX's GDT before
playing around with the segment registers to return to real mode.  This is
helpful if the kernel causes a fatal exception before it has setup its own
IDT and fault handlers.  For example, if one happens to break mtx_init().
Without these changes BTX would recursively page fault (if paging was not
disabled) or triple fault and reset the CPU (without the GDT reload)
instead of providing a potentially useful register dump.

Reviewed by:	rnordier
2001-03-21 20:08:07 +00:00
Paul Saab
c6fe53998a Don't set the gateway address if the netmask is zero or we're on
the same network.  PXE does not do netmask calculations, so if the
gateway is set it will use it.

Submitted by:	peter & FreeBSD cluster ACLs
2001-03-14 23:53:25 +00:00
John Baldwin
df860c72f9 Use better descriptions (ones invovling words from the English language
anyways) for the accept filter modules.
2001-03-14 21:33:36 +00:00
Daniel C. Sobral
54eb4ada14 Improve comments about the sound drivers.
Correct accf lines.
2001-03-14 17:46:32 +00:00
John Baldwin
90010f94de - Sync up with stable by adding in the Netgraph and Sound module sections,
the agp module, and the accept filter modules.
- Remove an extraneous blank line.
2001-03-13 16:16:35 +00:00
Daniel C. Sobral
06a9cc5bf7 Goodbye vn, welcome md. 2001-03-07 09:42:41 +00:00
David E. O'Brien
768fd422b4 Fix whitespace. 2001-03-04 04:38:14 +00:00
Ruslan Ermilov
afcf05e46a setlocale(3) has been fixed to match POSIX standard:
LC_ALL takes precedence over other LC_* envariables.
2001-03-02 16:52:14 +00:00
Ruslan Ermilov
c2d03ea879 Eliminate mdocNG warnings caused by misplaced or extraneous macro calls. 2001-02-28 17:38:53 +00:00
Daniel C. Sobral
32e1d1c252 Whenever the user might be offered a chance to quit through
pager_output(), respect that choice.

PR: 15747
2001-02-22 11:22:14 +00:00
Jeroen Ruigrok van der Werven
7c63796828 Preceed/preceeding are not english words. Use precede or preceding. 2001-02-18 10:25:42 +00:00
Jeroen Ruigrok van der Werven
1a6e52d0e9 Fix typo: seperate -> separate.
Seperate does not exist in the english language.
2001-02-06 11:21:58 +00:00
Dag-Erling Smørgrav
1c59150ad7 Add atspeaker_load. 2001-02-01 16:41:58 +00:00
Ruslan Ermilov
d0353b836e mdoc(7) police: split punctuation characters + misc fixes. 2001-02-01 16:38:02 +00:00
Ruslan Ermilov
1bfea903ed Prepare for mdoc(7)NG. 2001-01-16 09:39:23 +00:00
John Baldwin
0189f472ae Add commented out examples for the new KTR loader tunables. 2001-01-06 06:52:49 +00:00
Poul-Henning Kamp
0d7b8d16dc Use <sys/queue.h> macro API.
Submitted by:	"Jason" <jsmethers@pdq.net>
Reviewed by:	/sbin/md5
2000-12-30 20:40:16 +00:00
Dag-Erling Smørgrav
dd488b6dd8 Retire kernfs (kernel part). 2000-12-28 12:17:35 +00:00
Ruslan Ermilov
f53fadafee Prepare for mdoc(7)NG. 2000-12-27 16:37:32 +00:00
KATO Takenori
dfec8c70fa Disabled boot2 for the moment, because it needs aout tools. 2000-12-24 14:54:34 +00:00
Robert Nordier
1165e4c9a4 Fix column alignment (whitespace-only change). 2000-12-19 00:17:36 +00:00
KATO Takenori
db53335483 Merged from sys/boot/i386/loader/Makefile revision 1.49. 2000-12-16 03:15:48 +00:00
Ruslan Ermilov
c5f49c2585 mdoc(7) police: removed duplicate .Os call. 2000-12-14 12:48:07 +00:00
Robert Nordier
81578f4a33 Strip the .comment and .note sections when stripping. There's no
point in retaining this info, particularly under BTX.
2000-12-13 17:10:38 +00:00
Robert Nordier
1ec5afb81e Add a magic number, for easier identification of boot0. At present,
this is used only by libdisk.
2000-12-12 17:27:35 +00:00
Marcel Moolenaar
d5b14b2a37 Add "empty" makefile. Cross-building fails without it. 2000-12-08 04:08:09 +00:00
Andrey A. Chernov
fea0a15961 Cosmetique: don't use localized date 2000-12-01 01:58:48 +00:00
John Baldwin
0a7f15c202 Set the proper bit in the howto flags for a serial console rather than
setting the index of the bit.  (0xc vs. 0x1000)
2000-11-30 18:33:59 +00:00
Paul Saab
43ab35c8c7 Add support for probing the keyboard from pxeboot which will behave
exactly the same as passing -P to boot2.

Submitted by:	jhb
2000-11-30 14:55:10 +00:00
David E. O'Brien
4a93f235c1 `cdboot' is broken as it cannot load a kernel.
The release engineer keeps using the wrong /boot/cdboot when creating the
ISO images.  So we'll add the 4.0-RELEASE cdboot to the tree until someone
bothers to fix the source so a working `cdboot' is built.
2000-11-27 02:15:13 +00:00
Ruslan Ermilov
f4d874a1db mdoc(7) police: do not split author names in the AUTHORS section. 2000-11-22 09:35:58 +00:00
Ruslan Ermilov
d5874785b9 mdoc(7) police: use the new features of the Nm macro. 2000-11-20 17:05:46 +00:00
Ruslan Ermilov
251c176f41 mdoc(7) police: use certified section headers wherever possible. 2000-11-17 11:44:16 +00:00
Mike Smith
1d6dc22916 The default kernel filename is "kernel" again, not "kernel.ko".
Submitted by:	mckusick
2000-11-17 04:43:56 +00:00
Ben Smithurst
c6662b8e3d remove period from SEE ALSO. 2000-11-15 17:02:54 +00:00
David E. O'Brien
f9c70d7647 Don't use the Gawkism strftime(). Pass in the date stamp on the awk
command line instead.

Approved by:	dcs
2000-11-14 21:02:49 +00:00
Ruslan Ermilov
b5c508fba3 Use Fx macro wherever possible. 2000-11-14 11:20:58 +00:00
Matt Jacob
492ecc5fbd init booted_kernel from environment kernelname (if there) 2000-11-14 08:11:03 +00:00
Matt Jacob
178e6e0fed move init of booted_kernel to bootinfo.c 2000-11-14 08:10:15 +00:00
Benno Rice
4cc1860f9b OpenFirmware/PowerPC loader, part 2.
As of this patchset, the loader builds (under NetBSD/macppc), boots, interacts
and talks to BOOTP/NFS servers.

(main.c was moved from boot/ofw/libofw to boot/ofw/common but has no revision
 history)

Reviewed by:	obrien
2000-11-10 06:39:58 +00:00
Benno Rice
f1fb6c2132 Give the network device a print method.
Reviewed by:	obrien
2000-11-10 06:37:43 +00:00
Benno Rice
5b98b64392 OpenFirmware/PowerPC loader, part 2.
This brings the loader up to the point where I can compile it under
NetBSD/macppc and have it boot, interact and talk to NFS servers.

sys/boot/ofw/libofw/main.c has been deleted (it has no revision history) and
replaced with sys/boot/ofw/common/main.c

Reviewed by:	obrien
2000-11-10 06:29:42 +00:00
Paul Saab
3d122d8e2c Honor the ip address given in the root-path dhcp option.
PR:	21743
Submitted by:	Brian Candler <B.Candler@pobox.com>
2000-11-05 14:55:09 +00:00
Yoshihiro Takahashi
64ee4b5b08 Merged from the following changes.
sys/boot/i386/btx/btx/Makefile		1.9
sys/boot/i386/btx/btx/btx.s		1.23
sys/boot/i386/libi386/biosdisk.c	1.32 and 1.33
sys/boot/i386/libi386/biosmem.c		1.5
sys/boot/i386/libi386/comconsole.c	1.8
sys/boot/i386/libi386/gatea20.c		1.3
sys/boot/i386/libi386/time.c		1.4
sys/boot/i386/libi386/vidconsole.c	1.13
sys/boot/i386/loader/Makefile		1.48
sys/boot/i386/loader/main.c		1.22
2000-11-05 12:35:41 +00:00
Robert Nordier
9e3377b8b3 Support a.out: avoid (%dx) in in/out instructions, and use an m4
macro to supply underscores for externals.
2000-11-04 13:03:52 +00:00
Paul Saab
9193b12844 MF4: Add LOADER_TFTP_SUPPORT make.conf flag. 2000-11-04 08:43:13 +00:00
John Baldwin
f251e6cfa1 The Number of Fixed Disks at memory location 0x475 is only 1 byte, not a
2 byte word.  This fixes machines that probe 30-odd hard drives during boot
in the loader.

Submitted by:	Helpful folks at Tyan via ps
2000-11-02 23:28:12 +00:00
Matthew Hunt
26b5d23688 "it's" --> "its" (possessive).
Correct a malformed sentence.
2000-11-01 00:36:12 +00:00
Nick Hibma
25c8418620 Add entry for umodem 2000-10-30 10:55:03 +00:00
Doug Rabson
445516e4e0 Backout revision 1.7 which was a bad idea since it would force people
to reinstall boot1 after a 'make world'.

Unfortunately this means that people who have already installed a new
boot1 from a 'make world' after 2000/09/18 *must* reinstall it after
their next build using something like:

        # disklabel -B /dev/da0c
2000-10-27 09:36:34 +00:00
David E. O'Brien
bc6049dd46 Install the loader manpages. 2000-10-26 21:47:59 +00:00
Doug Rabson
d2041924cd Move the call to extend_heap() from main to start so that if our BSS
expands beyond the limit we will extend the address space before trying
to zero the BSS. This should give us plenty of headroom for modest
expansion of the loader.
2000-10-25 23:36:01 +00:00
Doug Rabson
75cdadceb4 Don't build start.S as part of libalpha.a - its built specially. 2000-10-25 23:30:04 +00:00
Doug Rabson
bcdb85b6b8 Don't indirect through a null pointer if we run out of kernel filenames. 2000-10-25 23:28:19 +00:00
Doug Rabson
a3fc4e0754 Make a few functions inline to save space. 2000-10-25 23:24:43 +00:00
Nick Hibma
2fd84f56d5 The USB scanner driver. To be used together with SANE. 2000-10-25 10:34:38 +00:00
David E. O'Brien
c2606cffec Convert from the Alpha compontents to PowerPC ones. 2000-10-16 19:58:32 +00:00
David E. O'Brien
146a7d5318 "Ok, my loader's now up to putting up a prompt. It probes disks partially
but can't boot from them yet."

Thanks to Stephane Potvin for the some of the code in this set.

Submitted by:	Benno Rice <benno@jeamland.net>
2000-10-16 10:46:22 +00:00
Yoshihiro Takahashi
54bb2a24af Merged from sys/boot/i386/loader/main.c revision 1.21. 2000-10-15 02:56:48 +00:00
Daniel C. Sobral
3851401454 Now I see the error of my ways.
Previous revision of this file changed the "boot" commands to take
no arguments from the stack. This is only valid in the case where
a kernel has not been loaded. In that case, load_kernel_and_modules
will be called, which takes a list of arguments from the stack.

When a kernel is presently loaded, though, the list of arguments must
be passed to the boot command, which was the behaviour before the last
revision.

Fix things for both cases.

Noticed by: S-Max and others on that chat room
2000-10-09 11:29:40 +00:00
Robert Nordier
8c964b9bca Go back to occupying just a single sector, reverting r1.17 - r1.20.
Taking over the sector following the MBR causes problems on some
machines, and the actual gains are fairly small in terms of how
the space is presently used.

Since we need a number of further features (eg. handling extended
partitions) that can't be readily accommodated in the basic boot0
design anyway, rather choose to implement the additional stuff
separately and concentrate on compatibility rather than features
here.
2000-10-02 17:30:22 +00:00
Robert Nordier
ce6a6a0f90 Set MAINTAINER. 2000-10-02 17:23:16 +00:00
Daniel C. Sobral
530df9baad Get rid of garbage left on the stack. 2000-09-25 11:36:55 +00:00
Daniel C. Sobral
a360c980c2 What could possibly have possessed me to forget the "0 (arguments)"
in two of the three boot words in the "boot" redefinition, I have no
clue. Fix it.

Noticed by: bp
Noticed by: adrian
2000-09-25 11:18:02 +00:00
KATO Takenori
6473734288 Merged from sys/boot/i386/loader/main.c revision 1.23. 2000-09-22 12:51:22 +00:00
KATO Takenori
87eae000dd Merged from sys/boot/i386/libi386/Makefile revision 1.19. 2000-09-22 12:49:15 +00:00
Archie Cobbs
474afc4230 Add support for the "nullconsole" console type, for systems with
neither a video console nor a serial port. Use it if the RB_MUTE
flag is set.

Submitted by:	Doug Ambrisko <ambrisko@whistle.com>
Reviewed by:	jhb
2000-09-20 18:13:36 +00:00
Daniel C. Sobral
504119265e Check for the correct minimum version required by the current code.
I hope I got this right... :-)
2000-09-18 22:42:54 +00:00
Matt Jacob
81372ff0ed Steal 512KB more from system memory for heap instead of 256KB. We died
without the extra space. What a pity.
2000-09-18 08:19:04 +00:00
Matt Jacob
8c8c7c234b Run SECONDARY_LOAD_ADDRESS down to 0x2000a000- this still leaves
(barely) enough room for boot1 and gives us 8KB more to play with
in the loader.
2000-09-18 08:17:57 +00:00
Matt Jacob
4b3f16308b Make the stack 12K- we seem to need a bit more.
Rename 'stack' to 'stackbase' as this variable
more correctly denotes what it is.
2000-09-18 08:16:38 +00:00
Daniel C. Sobral
818c39998e Use _ instead or - where proper, according to the style I have been
using.

Overload "?" so it will also show loader.4th commands.
2000-09-16 21:04:49 +00:00
Daniel C. Sobral
df3c7d3993 Solve a name clash.
Add something to help debugging.
2000-09-16 20:20:44 +00:00
Daniel C. Sobral
c888e59b84 The default search path for kernel and modules was bogus. It makes no
sense for /boot/kernel to come last.
2000-09-16 19:59:41 +00:00
Daniel C. Sobral
54329571cf The module_path set by default was bogus. It had /boot/kernel last,
which makes little sense.
2000-09-16 19:56:23 +00:00
Daniel C. Sobral
7b9e034490 Both boot and boot-conf were using a different algorithm from the one
used by start to find the kernel. Fix this.

Also, boot would proceed immediately in the absence of a path as
argument. Check first if a kernel has already been loaded, and, if
not, fall back to load kernel&modules behavior.

Some further factorizing. I deem this code to be mostly readable by
now! :-)

Many thanks to: Makoto MATSUSHITA <matusita@jp.FreeBSD.org>
2000-09-16 19:49:52 +00:00
Daniel C. Sobral
1cb190742f Factorize, reorganize, and move code around.
The boot-conf and boot code had various bugs, and some of it was big,
ugly, unwieldy, and, sometimes, plain incorrect. I'm just about
completely replaced these ugly parts with something much more manageable.

Minor changes were made to the well-factorized parts of it, to accomodate
the new code.

Of note:

	* make sure boot-conf has the exact same behavior wrt boot order
as start.

	* Correct both boot and boot-conf so they'll work correctly when
compiled in, as they both had some bugs, minor and major.

	* Remove all the crud from loader.4th back into support.4th, for
the first time since boot-conf was first improved. Hurray!

I'm fairly satisfied with the code at this time. Time to see about those
man pages...
2000-09-15 08:05:52 +00:00
Daniel C. Sobral
9f0c5de5f7 Start countdown only _after_ the kernel was loaded. Not very fair otherwise. 2000-09-15 07:54:10 +00:00
Daniel C. Sobral
a708ce6fa3 New world order wrt to kernel location and name. This doesn't actually
changes anything (in theory), just better document it. I'm waiting for
the final word before I tackle the man pages.
2000-09-12 20:21:11 +00:00
Roger Hardiman
6ce5d87513 Back out bktr_mem_load. It is not needed because I'm use MODULE_DEPEND
elsewhere.
Reminded by: Mike Smith
2000-09-12 08:41:55 +00:00
Roger Hardiman
0950aa881d Add bktr_mem_loader, default to NO.
In the near future the bktr module will need the bktr_mem module too.
2000-09-11 10:46:03 +00:00
Doug Rabson
55f0c30072 Fix this so that we actually define HAVE_PNP when its available. 2000-09-10 17:11:27 +00:00
Mark Murray
0f3ad95051 The entropy driver module has changed name. 2000-09-10 13:58:58 +00:00
Daniel C. Sobral
9714dd1a3a Bump up version as a result of the recent changes to kernel path,
and boot-conf&boot semantic changes.

Also, make it 1.0.

Reminded by: peter (even though he doesn't know it)
2000-09-10 13:51:44 +00:00
Daniel C. Sobral
f3b36c2a14 Bump up version as a result of the recent changes to kernel path,
and boot-conf&boot semantic changes.

Reminded by: peter (even though he doesn't know it)
2000-09-10 13:51:31 +00:00
Daniel C. Sobral
2ae7c98e29 Change NOFORTH comment character from # to \ followed by space,
to make things more interchangeable between it and the FORTH case.

Perhaps requiring the space is a bit too much, but...

Nothing in the tree seems to produce loader.rc files with comment
line, at this time.
2000-09-10 13:48:51 +00:00
Doug Rabson
4eedebf31f Only build PnP parts if the platform supports PnP. 2000-09-10 12:15:30 +00:00
Daniel C. Sobral
23aecb0109 Upon reflection, I decided that bootfile must have priority over kernel
as the kernel name. The one very unfortunate consequence is that kernel
as an absolute path loses the priority. It will only be tried after
/boot/${kernel}/${bootfile}. I'll see what can be done about it later.
2000-09-09 18:20:00 +00:00
Robert Nordier
3348fae50d Correct BSD/OS slice type.
PR:           21099
Submitted by: Alan Clegg <abc@bsdi.com>
2000-09-09 18:05:22 +00:00
Daniel C. Sobral
88a7f9eb70 First tackle at trying to handle the New Deal on kernels.
Load the first of the following kernels to be found:

${kernel} if ${kernel} is an absolute path
/boot/${kernel}/${kernel}
/boot/${kernel}/${bootfile}
${kernel}/${kernel}
${kernel}/${bootfile}
${kernel}
${bootfile}

The last instance of ${kernel} and ${bootfile} will be treated as a
list of semicolon separated file names, and each will be tried in turn,
from left to right.

Also, for each filename loader(8) will try filename, filename.ko,
filename.gz, filename.ko.gz, in that order, but that's not related
to this code.

This resulted in a major reorganization of the code, and much of what
was accumulating on loader.4th was rightly transfered to support.4th.

The semantics of boot-conf and boot also changed. Both will try to load
a kernel the same as above.

After a kernel was loaded, the variable module_path may get changed. Such
change will happen if the kernel was found with a directory prefix. In
that case, the module path will be set to ${directory};${module_path}.

Next, the modules are loaded as usual.

This is intended so kernel="xyzzy" in /boot/loader.conf will load
/boot/xyzzy/kernel.ko, load system modules from /boot/xyzzy/, and
load third party modules from /boot/modules or /modules. If that doesn't
work, it's a bug.

Also, fix a breakage of "boot" which was recently introduced. Boot without
any arguments would fail. No longer. Also, boot will only unload/reload
if the first argument is a path. If no argument exists or the first
argument is a flag, boot will use whatever is already loaded. I hope this
is POLA. That behavior is markedly different from that of boot-conf, which
will always unload/reload.

The semantics introduced here are experimental. Even if the code works,
we might decide this is not the prefered behavior. If you feel so, send
your feedback. (Yeah, this belongs in a HEADS UP or something, but I've
been working for the past 16 hours on this stuff, so gimme a break.)
2000-09-09 04:52:34 +00:00
Daniel C. Sobral
869e9b2096 Update boot and boot-conf descriptions to reflect new and old changes.
Add a warning in loader(8) that boot might be changed by loader.4th.
2000-09-08 21:39:31 +00:00
Daniel C. Sobral
80a1a63ef5 Enhance boot-conf.
Now boot-conf can also receive parameters to be passed to the kernel
being booted. The syntax is the same as in the boot command, so one
boots /kernel.OLD in single-user mode by typing:

boot-conf /kernel.OLD -s   instead of
boot-conf -s /kernel.OLD

The syntax still supports use of directory instead of file name, so

boot-conf kernel.OLD -s

may be used to boot /boot/kernel.OLD/kernel.ko in single-user mode.

Notice that if one passes a flag to boot-conf, it will override the
flags set in .conf files, but only for that invocation. If the user
aborts the countdown and tries again without passing any flags, the
flags set in .conf files will be used.

Some factorization was done in the process of enhancing boot-conf,
as it has been growing steadly as features are getting added, becoming
too big for a Forth word. It still could do with more factorization,
as a matter of fact.

Override the builtin "boot" with something based on boot-conf. It will
behave exactly like boot-conf, but booting directly instead of going
through autoboot.

Since we are now pairing kernel and module set in the same directory,
this change to boot makes sense.
2000-09-08 21:11:57 +00:00
Daniel C. Sobral
ebc9286d61 Strictly speaking, this works. It enumarates the PnP devices, and
load the modules needed according to a file relating module names
(actually, _file_ names, not really modules -- the dependency
stuff is not exported to loader's UI) to PnP IDs.

But it still lacks a number of desired features, and it's too crude
for my tastes. But since I don't have time to work on it, it might
be preferable to make it available to those who might. It's not
installed by default, much less loaded. In fact, it wouldn't even
had a copyright message (who? me? assume responsibility for _this_?),
if the cvs commit hadn't aborted for lack of $FreeBSD$, and I decided
to just cut&paste the stuff from elsewhere.
2000-09-08 17:13:24 +00:00
Daniel C. Sobral
f5da975f8f Add the infrastructure necessary to handle PnP from a Forth script.
Also, export the file_findfile() function. Again, this is taken from
work in progress but frozen for the time being. Since it works, I'd
rather commit and remove any uglyness later than hide it on my tree.
2000-09-08 17:03:53 +00:00
Daniel C. Sobral
d39b220c77 Fix an error message which was using the wrong variable to get the
kernel name from.
2000-09-08 16:58:31 +00:00
Daniel C. Sobral
297c9cab3e Add constructors to crude structure support. Rework some of the
code into a more modular interface, with hidden vocabularies and
such. Remove the need to a lot of ugly initialization.

Also, add a few structure definitions, from stuff used on the C
part of loader. Some of this will disappear, and the crude structure
support will most likely be replaced by full-blown OOP support
already present on FICL, but not installed by default. But it was
getting increasingly inconvenient to keep this separate on my tree,
and I already lost lots of work once because of the hurdles, so
commit this.

Anyway, it makes support.4th more structured, and I'm not proceeding
with the work on it any time soon, unfortunately.
2000-09-08 16:57:28 +00:00
Daniel C. Sobral
3053524c85 Make the pnp structure a global variable, so it can be used elsewhere. 2000-09-08 16:51:29 +00:00
Daniel C. Sobral
59549c5031 Fix autoboot. Now autoboot *always* show the correct kernel name. It
gets the name from the environment variable kernelname, which is set
when a kernel is loaded. For this reason, autoboot will _first_ try
to load a kernel, and only proceed with the wait prompt after that
succeeds. If it fails, it will abort immediately.

While I understand some may think this behavior undesirable, I think
it is, overall, the best thing to do, even if we do not consider the
aesthetic issue. Notice that anyone using the default loader.rc
already has the kernel loaded before autoboot.

On unload, unset kernelname.

Separate the code that tries to load a kernel from the list of options
to the function loadakernel(). It is used by both boot() and
autoboot().
2000-09-08 16:47:05 +00:00
KATO Takenori
87beee9c90 Merged from sys/boot/i386/loader/Makefile revision 1.47. 2000-09-08 11:18:40 +00:00
Warner Losh
799c0f62dd Look for libstand in the built tree rather than in /usr/lib. This
likely could be done better, but the tree is broken and I wanted to
get a fix into the tree.

Reviewed by: msmith
2000-09-08 04:26:55 +00:00
David E. O'Brien
db266683d3 With the committed changes to the loaders modules path code, the kernel
path does not need to be hard coded.
2000-09-06 20:50:24 +00:00
David E. O'Brien
6f54390e53 Fix the kernel default load from "/boot/modules" to "/boot/kernel".
Reported by:	dcs
2000-09-05 23:10:46 +00:00
David E. O'Brien
3bdfa9e589 The kernel is now known as `kernel.ko' and it and its matching modules
live in ``/boot/kernel/''.
2000-09-05 22:37:46 +00:00
Mike Smith
0153af6a16 Fix a bug which prevents parsing this Makefile without having a
previously-built loader binary elsewhere.
2000-09-05 22:33:07 +00:00
Mike Smith
bb65fdf6e0 Export the salient configuration items in a non-pxe-specific namespace
to allow commonality between varying platforms.  This is a step
towards parsing the diskless configuration information with MI code
inside the kernel.

Export the interface hardware address to the kernel, so that it is possible
to determine the boot interface with certainty.

Export the NFS filehandle for the root mount to the kernel, so that the
kernel does not need to perform a mount RPC call.
2000-09-05 22:32:31 +00:00
David E. O'Brien
06a5e547a9 This is real released software, let people think that. 2000-09-03 02:46:17 +00:00
KATO Takenori
8b6a5e91bb The INT 1B BIOS call is used to obtain geometries of SASI/IDE hard
drives.  Some IDE cards don't set propler information into BIOS work
are and their sector size were always recognized as 256 bytes/sector.

Pointed out by:	jagarl@creator.club.ne.jp
2000-08-31 10:24:06 +00:00
John Baldwin
6bd9abd49a Add a new compile-time tweak to BTX. If you set the make(1) variable
BOOT_BTX_NOHANG, then BTX will be compiled with the appropriate flags so
that it reboots after a fault instead of hanging forever.

Requested by:	ps
Approved by:	rnordier
2000-08-24 20:57:44 +00:00
Sheldon Hearn
243782a80a List loader.conf and friends in the FILES section.
Requested by:	obrien
2000-08-24 08:00:29 +00:00
KATO Takenori
77dff523b3 Fixed determination method for sector size of the 2nd IDE HDD. 2000-08-15 08:17:03 +00:00
KATO Takenori
9300e1bae2 Merged from sys/boot/i386/Makefile.inc revision 1.2. 2000-08-12 07:37:19 +00:00
Peter Wemm
5aef48a16b Add -mpreferred-stack-boundary=2 to CFLAGS for i386. This and libstand
reduces /boot/loader from 163840 bytes to 155648 and pxeboot from 165888
bytes to 157696 bytes.
2000-08-11 23:23:20 +00:00
Daniel C. Sobral
e7b7c050c7 Add missing "is".
PR:		20524
Submitted by:	Peter Pentchev <roam@orbitel.bg>
2000-08-11 10:32:23 +00:00
Paul Saab
646cf5017b Add support to send the string 'PXEClient' as the Vendor class
identifier to the DHCP server.  Now you can check for this string
in your dhcp configuration to decide whether you will hand out a
lease to the client or not.
2000-08-11 08:36:17 +00:00
Paul Saab
f6940c1842 Pass along the interesting variables we were given from DHCP so we
can utilize them in the kernel and with kenv.
2000-08-11 05:31:59 +00:00
Robert Nordier
ff7ed3a234 Typo/spelling fixes. 2000-08-08 07:20:25 +00:00
KATO Takenori
c4082e99a4 - Fixed missing initialization of current device number.
- Fixed comment.

Pointed out by:	nyan
2000-08-06 14:35:37 +00:00
John Baldwin
ab9e9f9d2d Argh! Fix a brainfart of mine. In the old boot0, we relocated ourself
to 0x600 via a 'rep movsw'.  Once that was done, %cx was zero, so we could
simply use 'movb' to update the lower byte of %cx in preparation for
zeroing out the fake partition entry used to boot to other drives via F5.
Well, in the new boot0, we don't actually relocate ourselves, instead it
is easier to create the fake partition entry first and then just use it to
get the BIOS to load all of boot0 into memory at 0x600.  However, since we
aren't doing the relocate code anymore, we don't know that %cx == 0 when
we hit the 'movb' to setup %cx for clearning the fake partition entry.
Thus, if %ch != 0 when the BIOS started boot0, then it would end up zeroing
a lot more memory than just 8 words.  The solution is to do a word move of
$8 into %cx.

Debugging help from:	David Wolfskill <dhw@whistle.com>
2000-08-04 22:37:21 +00:00
David E. O'Brien
2111e67c80 Fix this so it is a Makefile and not a shell script -- now issuing `make'
a second time does not rebuild the binary.
2000-08-04 08:30:00 +00:00
John Baldwin
2efeedfd4b Fix some of the arcdisk devsw functions to catch up with warning fixes in
<stand.h>.  Also, since bcache_strategy() used to not have a prototype,
arcdisk happily called bcache_strategy() with 6 parameters instead of 7,
leaving out the disk unit number, which is the 2nd parameter.  Add in the
unit number to the bcache_strategy() call to fix this.
2000-08-04 05:25:36 +00:00
John Baldwin
00dc3782f7 Bring back the perform() function. However, conditionionalize it on
BOOT_FORTH as it is only used if BOOT_FORTH is not defined.
2000-08-04 05:23:41 +00:00
KATO Takenori
aa4e20f5bd - Fixed %si (offset to partition table) in boot.
- Fixed comment.
2000-08-03 13:01:45 +00:00
John Baldwin
eb37712079 Fix the more obvious warnings to deal with my earlier warning cleanups. 2000-08-03 09:49:44 +00:00
John Baldwin
4ae4202e70 Cleanup warnings. Most of these are signed/unsigned warnings, as well as
some added const's.
2000-08-03 09:14:02 +00:00
John Baldwin
c2fa9f3e89 Fix several BDECFLAGS warnings. Also, actually use the 'verbose' parameter
for lsdev when printing out slice information.  Now, you only get the
sizes and LBA's of slices if you use 'lsdev -v'.
2000-08-03 09:09:49 +00:00
KATO Takenori
1ee980919d - Fixed pointer to the partition table in the buffer.
- Use shift by %cl instead of five shifts by 1.
2000-08-03 09:00:19 +00:00
KATO Takenori
e9b13dd6ec Added PC-98 HDD boot manager. The boot0 is the `IPL' which occupies
sector 0 of a disk and boot0.5 is the `boot selector' which starts
from address 0x400.  The IPL loads boot0.5 and boot0.5 loads bootblock
of a slice.

The boot manager stuff was developed by me (kato) with Borland C++,
and then, translated into bcc in the ports collection by Nokubi-san.
After that, boot0 has been translated into gas with the .code16
directive by Takahashi-san (nyan) and boot0.5 has been rewritten in
gas by me.
2000-08-02 08:46:08 +00:00
Yoshihiro Takahashi
78a9e97b3a Merged from sys/boot/i386/btx/btx/btx.s revisions from 1.18 to 1.22. 2000-07-30 07:45:02 +00:00
Sheldon Hearn
1b2fbe6ff9 Rename the loadable nullfs kernel module: null -> nullfs 2000-07-28 11:54:09 +00:00
John Baldwin
ddb820b015 Remove an unnecessary .PATH entry. 2000-07-21 22:36:42 +00:00
David E. O'Brien
ff1e937c46 Declare our DEC Alpha cdboot to be a fully released version 1.0. 2000-07-18 04:15:06 +00:00
John Baldwin
f15da231c5 Oops. Remove some debugging code used to display a hexdump of the sector
we just loaded from the disk.  The code to call it was commented out, and
it easily fit into the extra sector, but remove it anyway as it is
unneeded.
2000-07-17 19:39:50 +00:00
Jonathan Lemon
cd914f8fa0 Unbreak the build -- no manual page for this yet. 2000-07-17 19:03:58 +00:00
Jonathan Lemon
15602c8dd8 Hook up liloldr 2000-07-17 17:06:27 +00:00
Jonathan Lemon
9ebf93dc6d This is `liloboot', which creates a file which can be treated like a
Linux kernel image, and is designed to be dropped into a Linux system
and booted via LILO.  Once booted, the user is greeted by the FreeBSD
loader.  This still isn't quite complete, as the the root= specification
from LILO isn't currently passed to the loader yet.
2000-07-17 17:06:04 +00:00
Yoshihiro Takahashi
11c2252a1f Merged from sys/boot/i386/libi386/biosdisk.c revision 1.31. 2000-07-14 04:23:45 +00:00
John Baldwin
1dce5cb37f The new and improved boot0, v1.1. This version adds the following:
- Autodetection and support of the BIOS EDD extensions to work around the
  1024 cylinder limit on all but really ancient BIOS's.
- To work around some BIOS's which break when EDD is used with older drives,
  we only attempt to use EDD if the cylinder is > 1023.
- Since this new code required more space than we had left, expand boot0 to
  2 sectors (1024 bytes) in length.
- Add support for boot0 being multiple sectors using predefined constants.
  If boot0 needs to be extended in the future, all that is required is
  bumping the NUM_SECTORS constant.
- Now that we have more room to work with, add a few more fs type
  descriptions while making others more verbose.
2000-07-12 18:11:54 +00:00
John Baldwin
492f000557 Always install loader.4th, defaults/loader.conf, and support.4th instead of
only doing so if loader.rc does not exist.  This fixes the problem where
installworld doesn't update /boot/loader.4th, resulting in device.hints not
being loaded after updating past the config(8) changes, which resulted in
mcclock0 not being probed, and a nice kernel panic during boot.
2000-07-10 16:52:42 +00:00
Kris Kennaway
8c8970cf16 Don't call printf with no format string. 2000-07-10 06:40:06 +00:00
Kris Kennaway
487730cc8b Don't call printf with no format string. This is technically a security
vulnerability and could in principle be used to upload a new kernel from the
bootloader :-)
2000-07-10 06:33:55 +00:00
John Baldwin
18601b5712 Remove commented out NOMAN variable. 2000-07-07 20:37:11 +00:00
John Baldwin
8dfe6fb59c - Inline all the functions that are only called once. This results in a
savings of 68 bytes in boot2.
- Also add a comment warning that you can't remove the empty exit()
  function.
2000-07-06 01:51:27 +00:00
John Baldwin
54ff3ae038 Doh. The disklabel is not 0x200 bytes of zeros, but it is 0x200 bytes long. 2000-07-06 00:29:40 +00:00
John Baldwin
a6bef20793 Clarify the comments in here a bit. The first sector of boot2 is not just
zeros, it is actually the disklabel itself.  boot2.ldr is simply a
placeholder in the boot2 binary.
2000-07-06 00:22:50 +00:00
John Baldwin
bd61ce880f Emulate the WBINVD instruction when it is called by the BIOS. 2000-07-06 00:13:21 +00:00
John Baldwin
0b74850760 Change the fault message to say 'BTX halted' isntead of 'System halted' to
avoid confusion.

Submitted by:	George Scott <George.Scott@its.monash.edu.au>
2000-06-29 08:24:50 +00:00
Andrey A. Chernov
5911ecd993 Add randomdev_load="NO" 2000-06-29 06:10:14 +00:00
John Baldwin
52f5035190 Rework the detecting of the rdmsr and wrmsr instructions in the v86
monitor so that the codepath is cleaner and easier to maintain in the
future.
2000-06-29 01:25:31 +00:00
John Baldwin
bce816b9cc - Don't blindly assume that there are 8 hard drives installed. Instead,
use the BIOS Equipment List to determine how many hard drives are
  installed and if the drive number we received in %dl is valid.
- Don't bother to disable interrupts when setting up the stack.  The 8086
  and beyond implicitly disable interrupts after an instruction that sets
  %ss (for example, a pop or a mov) so that you can safely set %ss and %sp
  in two consecutive instructions.  An exception to this is the lss
  instruction, which can set both registers simultaneously and thus doesn't
  need this hack.
- Add support for EDD BIOS extensions to support booting off of hard drives
  of nearly arbitrary length.
2000-06-27 20:04:10 +00:00
John Baldwin
2960c255b4 Comment this. 2000-06-26 23:58:04 +00:00
John Baldwin
cbf3fb883e Add in support for EDD to support large disks via LBA. This uses a
method similar to that of the loader to avoid potentially breaking older
drives in that we only use EDD if the desired cylinder is > 1023.
2000-06-26 22:57:16 +00:00
Matthew Hunt
5d98029c7e Typo fix: tunnable.
Backslash-parsing is not the role of printf(3), but is provided
	by the C language.
2000-06-25 07:12:03 +00:00
Sheldon Hearn
0c74e83819 Whitespace-only changes: apply accepted line breaking style as a
pre-cursor to other markup changes.

Accepted in principle by the author.
2000-06-22 08:37:22 +00:00
John Baldwin
35bdac5bbd Comment this bad boy. Hopefully the next person that comes along won't
have to spend a few hours reading the code to figure all this out.
2000-06-19 22:50:46 +00:00
John Baldwin
335dd56674 - Add some more details to the 'lsdev' output for FAT file systems.
- Add in support for the EDD (Enhanced Disk Drive) BIOS extensions to
  use LBA mode for accessing drives past cylinder 1024.  This should allow
  us to load a kernel from anywhere on a newer drive up to 2 TB.  Part
  of this came from the PR below.

PR:		i386/13847
Submitted by:	Tor Egge <Tor.Egge@fast.no>
2000-06-19 17:44:40 +00:00
Matt Jacob
74c7cee09a Add wx and ispfw loadable module defaults. 2000-06-17 23:09:51 +00:00
John Baldwin
1ddb0ab555 Add support for emulating the RDMSR and WRMSR instructions into BTX. In
theory, this should allow the K7V Athlon motherboard to boot ok with boot
virus protection enabled.  However, I have no hardware to test this.  It
shouldn't break anything though. :)

Prodded by:	Kelly Yancey <kbyanc@posi.net>
2000-06-17 06:45:40 +00:00
Daniel C. Sobral
f102f87438 Fix vocabulary juggling so that builtins voc is always searched before
forth vocabulary when initially creating the builtins. FICL 2.05 has a
better way to do this, but this works for now.

Fixes "?".
2000-06-16 05:04:05 +00:00
Daniel C. Sobral
ef34e89ba2 Revert to 1.8 2000-06-14 19:39:31 +00:00
Daniel C. Sobral
18ee60a576 Remove the setting of sourceid from bf_vm(), as bf_vm() really has
no clue.

Set sourceid to 0 when booting, which is the correct setting for stdin.

Set sourceid to an arbitrary fd when include'ing, preserving and restoring
the previous sourceid. This is possibly broken(), as 0 is a valid fd. Maybe
we should +1 to this value.

This fixes the version problem widely reported.
2000-06-14 19:37:00 +00:00
Paul Saab
cc3d937224 Delay calling the device cleanup routines until the absolute last
moment.  We were cleaning up after PXE too early and the module
dependancy code would not be able to load any files if it needed
too.
2000-06-14 10:34:29 +00:00
Paul Saab
f98558ff74 Make typing 'q' or 'Q' work for the show command as the pager prompt
says it should.
2000-06-14 09:05:03 +00:00
Peter Wemm
49e7f72d87 With apologies to dcs, temporarily comment out the version check code. It
is failing for everybody that I have spoken with that has tried it.

FreeBSD/i386 bootstrap loader, Revision 0.8
(root@outback.netplex.com.au, Tue Jun 13 23:26:49 PDT 2000)
Loader version 0.3+ required
Aborted!
start not found

Note that the 0.3+ message is from inside the arch-alpha block, not the
i386 block of code.  And even then, 0.8 is higher than 0.3.

This prevents the rest of the loader.conf stuff working. :-/
2000-06-14 07:18:18 +00:00
Peter Wemm
f71c01cc52 Borrow phk's axe and apply the next stage of config(8)'s evolution.
Use Warner Losh's "hint" driver to decode ascii strings to fill the
resource table at boot time.

config(8) no longer generates an ioconf.c table - ie: the configuration
no longer has to be compiled into the kernel.  You can reconfigure your
isa devices with the likes of this at loader(8) time:
  set hint.ed.0.port=0x320

userconfig will be rewritten to use this style interface one day and will
move to /boot/userconfig.4th or something like that.

It is still possible to statically compile in a set of hints into a kernel
if you do not wish to use loader(8).  See the "hints" directive in GENERIC
as an example.

All device wiring has been moved out of config(8).  There is a set of
helper scripts (see i386/conf/gethints.pl, and the same for alpha and pc98)
that extract the 'at isa? port foo irq bar' from the old files and produces
a hints file.  If you install this file as /boot/device.hints (and update
/boot/defaults/loader.conf - You can do a build/install in sys/boot) then
loader will load it automatically for you.  You can also compile in the
hints directly with:  hints "device.hints"  as well.

There are a few things that I'm not too happy with yet.  Under this scheme,
things like LINT would no longer be useful as "documentation" of settings.
I have renamed this file to 'NOTES' and stored the example hints strings
in it.  However... this is not something that config(8) understands, so
there is a script that extracts the build-specific data from the
documentation file (NOTES) to produce a LINT that can be config'ed and
built.  A stack of man4 pages will need updating. :-/

Also, since there is no longer a difference between 'device' and
'pseudo-device' I collapsed the two together, and the resulting 'device'
takes a 'number of units' for devices that still have it statically
allocated.  eg:  'device fe 4' will compile the fe driver with NFE set
to 4.  You can then set hints for 4 units (0 - 3).  Also note that
'device fe0' will be interpreted as "zero units of 'fe'" which would be
bad, so there is a config warning for this.  This is only needed for
old drivers that still have static limits on numbers of units.
All the statically limited drivers that I could find were marked.

Please exercise EXTREME CAUTION when transitioning!

Moral support by: phk, msmith, dfr, asmodai, imp, and others
2000-06-13 22:28:50 +00:00
Ruslan Ermilov
5737d0e1d4 Treat \t and \n inside /boot.config as whitespaces.
PR:		19215
2000-06-13 13:07:53 +00:00
Daniel C. Sobral
70e1899762 Fix REFILL. It must throw RESTART instead of OUTOFTEXT so that
execution can take place at the point where it stopped after the
input buffer has been refilled.

Add ANS Forth CORE EXT and FILE word SOURCE-ID.
2000-06-12 16:46:28 +00:00
Daniel C. Sobral
d742bdfc76 The word environment? returns a flag indicating whether the variable
was found or not. Fix it's usage. Alas, it caused no problem before,
besides leaving garbage in the stack, because refill, used by [if]
[else] [then], was broken.
2000-06-12 16:45:01 +00:00
Daniel C. Sobral
23bab6002c Make abort" functional in interpret mode. This behavior is undefined
by ANS Forth standard, but it's useful.

Also, define the constant true in a more strict way. C might garantee
2-complement math, but Forth doesn't.
2000-06-12 16:42:02 +00:00
Daniel C. Sobral
d2083bf417 Make comment reflect reality. 2000-06-12 16:40:00 +00:00
Daniel C. Sobral
e0d83caeed Put some version checking. 2000-06-07 22:19:49 +00:00
Daniel C. Sobral
a6a1d6e852 Bump loader version due to FICL (duh!) and copyin, copyout, setenv&cia. 2000-06-07 22:14:09 +00:00
Daniel C. Sobral
5ae8a644f6 Bump loader version due to copyin, copyout, setenv&cia. 2000-06-07 22:12:21 +00:00
Daniel C. Sobral
c1312289dd Modify boot-conf so it can take a kernel or directory name as
a parameter and dtrt.

Also, make boot-conf always unload first. There wasn't really any
point in not doing this, as the kernel _has_ to be loaded before
any other modules.

Tested by: dwhite
2000-06-07 22:10:05 +00:00
Daniel C. Sobral
f0b972df2f Add setenv, getenv, setenv?, unsetenv, copyin and copyout to FICL. 2000-06-07 22:07:01 +00:00
Daniel C. Sobral
14a7c31a0c Remove AGAIN definition, as FICL 2.04 provides it.
Add strlen, to help handling data generated by C code.

Add 2>r 2r>, because OO programming without them sucks.
2000-06-07 22:03:37 +00:00
Daniel C. Sobral
7015e7c9a1 Remove a bug that caused local variables declarations in the format
{ | internal -- } to be rejected.
2000-06-07 22:00:10 +00:00
Daniel C. Sobral
7632c12363 Place original builtins in a vocabulary called "builtins". This
is intended mainly for debuging purposes, but it can be used by
other words if done carefully.
2000-06-07 21:57:23 +00:00
Daniel C. Sobral
7302acac1c Remove residual printf.
Prodded by: msmith
2000-06-07 03:33:12 +00:00
Doug Rabson
e347aadd85 Record the new PALcode revision in the pcs structure after changing to
run OSF/1 PALcode.

Obtained from: NetBSD
2000-06-03 08:24:37 +00:00
Daniel C. Sobral
11b96475f7 Apply a number of fixes for the Alpha platform. 2000-06-02 20:07:56 +00:00
Daniel C. Sobral
b8e8da45a9 Add something that was missing from the original 2.04 distribution. 2000-06-02 13:49:09 +00:00
Daniel C. Sobral
b270590aeb Add "int" sized manipulation words. 2000-06-01 18:10:44 +00:00
Yoshihiro Takahashi
c787eb8a72 Sync with the following changes.
sys/boot/i386/btx/btx/Makefile          1.8
sys/boot/i386/btx/btx/btx.s             1.16 and 1.17
sys/boot/i386/btx/btxldr/btxldr.s       1.10
sys/boot/i386/loader/Makefile           1.45
2000-05-29 11:58:01 +00:00
Daniel C. Sobral
b6b204a98b Strip spaces and comments more agressively. 2000-05-26 22:58:10 +00:00
Daniel C. Sobral
7795d19132 Bring in FICL 2.04. No bump of loader version is required by this
commit.
2000-05-26 21:35:08 +00:00
Jake Burkholder
e39756439c Back out the previous change to the queue(3) interface.
It was not discussed and should probably not happen.

Requested by:		msmith and others
2000-05-26 02:09:24 +00:00
John Baldwin
e1efa49a84 Convert the short stub of real-mode code into 16-bit assembly. 2000-05-24 02:20:34 +00:00
Jake Burkholder
740a1973a6 Change the way that the queue(3) structures are declared; don't assume that
the type argument to *_HEAD and *_ENTRY is a struct.

Suggested by:	phk
Reviewed by:	phk
Approved by:	mdodd
2000-05-23 20:41:01 +00:00
John Baldwin
a1a611ed6b Grrr, fix a silly 'movl' -> 'movw' typo in both pxeldr and cdldr. Also,
remove unnecessary cruft from the Makefiles for both.
2000-05-23 12:31:32 +00:00
John Baldwin
af54a4fe47 Clean up some more 16-bit code and get rid of more m4 macros. 2000-05-23 12:28:31 +00:00
John Baldwin
638bac9fc0 Clean up all of the 16-bit assembly code in the x86 bootstrap to work
with the new binutils.  Now that we have a decent assembler, all the old
m4 macros are no longer needed.  Instead, straight assembly can be used
since as(1) now understands 16-bit addressing, branches, etc.  Also,
several bugs have been fixed in as(1), allowing boot0.s to be further
cleaned up.
2000-05-23 12:18:49 +00:00
Daniel C. Sobral
716f301734 Document abial's .#. 2000-05-23 11:47:23 +00:00
Tim Vanderhoek
b0d9eb06f9 Make this compile in case anyone ever wants to use the PC98 booter
on an IBM machine.  This fix matches i386/boot2/boot.c.

PR:	kern/7903
2000-05-21 05:27:56 +00:00
Daniel C. Sobral
aad477d890 One of loaders' bugs disappeared somewhere along the way. 2000-05-19 11:15:12 +00:00
Daniel C. Sobral
9ece4dbfe9 Move man page directives to common/Makefile.inc. 2000-05-19 08:52:16 +00:00
Daniel C. Sobral
536f89a623 This file got repo-copied to common/. 2000-05-19 08:44:48 +00:00
Daniel C. Sobral
a2aa3427cf Move man page directives to common/Makefile.inc. 2000-05-19 08:41:45 +00:00
Daniel C. Sobral
27391e65fd Remove INSTALL_FORTH stuff. 2000-05-19 08:40:37 +00:00
Daniel C. Sobral
6593d234e6 Move man page directives to common/Makefile.inc.
Remove INSTALL_FORTH stuff.
2000-05-19 08:40:11 +00:00
Daniel C. Sobral
d9f7c44adf Make corrections to allow for Alpha. 2000-05-18 12:44:50 +00:00
Doug Rabson
8bbd2c1e46 Only probe network settings on the first open of the network device.
The alpha firmware takes a seriously long time to open the network device
the first time.
2000-05-13 15:40:46 +00:00
David E. O'Brien
7f562b6673 The loader was written so that if /kernel was missing /kernel.old would
be booted.  Due to a bug, this wasn't happening.

There is still a lesser bug in that the loader decides which file to boot
after the 10sec count down.  This means the bootfile listed in the count
down in is wrong in the case where the loader will boot /kernel.old.
2000-05-13 02:45:11 +00:00
Peter Wemm
24d29b9649 Install the bootforth config files for the Alpha too. loader.conf should
be functional now.
2000-05-12 23:22:09 +00:00
Peter Wemm
dafe1ac0a0 Reactivate the FICL hooks to make it be compiled in, but also initialize
FICL.  bootforth is now live on the Alpha!

**BEWARE** - you *MUST* build and install a current libstand or you will
most likely get zfree() panics at loader startup.

We should now be able to set up the loader.conf stuff on the Alpha too.
2000-05-12 22:45:16 +00:00
Peter Wemm
4887dfcfd4 Stop libficl from using floating point registers - this was cauing
dictDelete() to fault early on the Alpha and was the original cause of
the Alpha ficl failures.
2000-05-12 21:51:20 +00:00
Peter Wemm
fa139a1ac3 Fix the Alpha loader the rest of the way. If FICL is present in
/boot/loader (even though it is 100% dormant in the Alpha version),
then the loader panics with a zfree error:Loading /boot/loader.test
  *** keyboard not plugged in...
  Console: SRM firmware console
  panic: zfree(0x2003cb58,4096): wild pointer
versus the exact same code but without FICL linked in:
  Loading /boot/loader
  Console: SRM firmware console
  VMS PAL rev: 0x1000600010114
  OSF PAL rev: 0x1000600020116
  Switch to OSF PAL code succeeded.

  FreeBSD/alpha SRM disk boot, Revision 0.1

This is almost certainly an alpha infrastructure bug, not a FICL
problem.  It's probably the same thing that made FICL fail for no
apparent reason on the Alpha.
2000-05-12 07:47:47 +00:00
Boris Popov
cf448cb2c9 long != int on Alphas. 2000-05-12 05:16:37 +00:00
Doug White
325bde0fb7 Remove metion of the 'magic options.' Apparently PXE doesn't require the
special options on 0.99c (it mumbles something about 'PXE server not found'
but works anyway), and it won't work at all with PXE 2.0.
2000-05-09 18:28:07 +00:00
Mike Smith
1fd777e1d5 Teach the alpha loader install process to make backup copies of the
boot programs when installing new versions.
2000-05-06 18:31:26 +00:00
John Baldwin
773065b3b8 Switch to using the .code16 as(1) directive and using 16-bit assembly
code instead of using 32-bit code and having to just "know" that it's
really 16-bit instructions when things run.  This also allows the code
to use fewer macros and more actual assembly statements, which eases
maintenance.  Unfortunately, due to as(1) brokenness, we still use m4
macros for all 16-bit addresses, and all short jumps (i.e., 8-bit
relative addresses in the jump instruction) must be wrapped in .code32
directives to avoid useless bloat by as(1).  This also fixes a few
problems that were preventing boot0 from compiling with the latest
and greatest version of as(1).
2000-05-05 13:22:10 +00:00
Paul Saab
90c25bd74a Remove the static heap. It is unknown why it was needed in the
beginning, but it no longer is required.  This has been tested with
many different revisions of the PXE rom from Intel.
2000-05-05 07:24:03 +00:00
Daniel C. Sobral
ff7e939c43 Lay the groundwork for on-demand dictionary expansion. 2000-05-05 02:06:38 +00:00
Daniel C. Sobral
20689aa3d4 Correct a bug whereby allocations to the dictionary would not be allowed
unless four times the space requested was available.
2000-05-04 23:23:13 +00:00
Daniel C. Sobral
4eb5b7979d Make documentation on recently added heap? command reflect reality. 2000-05-04 22:51:21 +00:00
Daniel C. Sobral
a1d54dfc62 Add "heap?" to loader's man page. 2000-05-04 21:26:26 +00:00
Daniel C. Sobral
19c80876dc Further improve ordering. 2000-05-04 21:22:55 +00:00
Daniel C. Sobral
c45393b59c Sort entries in FreeBSD-specific FICL commands. 2000-05-04 21:18:26 +00:00
Daniel C. Sobral
1ca3a0ce6a Add heap?, so we can tell how much free space we have left. 2000-05-04 20:41:30 +00:00
Yoshihiro Takahashi
86a5a8c251 - Removed hi-resolution mode supports.
- Added a dummy partition table.
2000-05-03 04:35:25 +00:00
Nick Hibma
65b674a33b Add the udbp module 2000-05-02 11:51:07 +00:00
Doug White
55ebf88553 Add man page for pxeboot.
Reviewed By:	asmodai
2000-05-02 05:01:38 +00:00
Peter Wemm
365c5db0a7 Add $FreeBSD$ 2000-05-01 20:32:07 +00:00
Peter Wemm
62470170de GC unused variable (size) 2000-05-01 18:03:15 +00:00
Peter Wemm
cd2d859cee Fix some warnings on the Alpha. sizeof() returns different things on
x86 and Alpha. Sigh.
2000-05-01 18:02:38 +00:00
Paul Saab
482cb52dcb Wrap the failure warnings around PXE_DEBUG in the cleanup routine.
It does not matter if they fail, so dont print anything about it
unless we are debugging.
2000-05-01 17:55:05 +00:00
Boris Popov
801e789e01 Update loader logic to distinguish modules vs. files.
Add support for module metadata. The old way of dependancy
handling will be supported for a while.

Reviewed by:	peter
2000-05-01 17:41:25 +00:00
Yoshihiro Takahashi
292feef381 Sync with sys/boot/i386/libi386/biosdisk.c revision 1.30. 2000-04-30 08:24:36 +00:00
Paul Saab
95394e643f Fall back to /pxeroot as the location of the NFS exported directory
if we are not given one by dhcp.
Remove extra includes while I am here.

Reminded by:	jlemon
2000-04-29 23:08:49 +00:00
Jonathan Lemon
8e30378f89 Teach the loader about the ext2fs filesystem, extended partitions, and
the new readdir function.
2000-04-29 20:49:33 +00:00
Paul Saab
f14ad6978f Make PXE do a dhcp request to find out where its files are. The
DHCP server is no longer required to also act as the NFS/TFTP
server.
2000-04-27 12:30:28 +00:00
Paul Saab
e7fd6f003e Don't report errors when we UDP_WRITE fails with a status of 1. 2000-04-27 03:23:50 +00:00
John Baldwin
eeb5db2946 Now that we are compiling PXE into libi386, we don't need ../libi386 in
.PATH anymore.
2000-04-26 19:54:49 +00:00
Paul Saab
d08ae64b1d Bring support in for Intel Wired for Management 1.1 (PXE 0.99 and
below).  This did not work previously because interrupts were
disabled when PXE calls were being made, and they must be enabled.
This should also allow us to be compliant with all newer PXE rom's
from Intel.

For PXE 0.99, this has been tested using the Intel N440BX motherboard
and I am confident it will work on the Intel L440GX motherboard.

Lots of help/information from: jhb, peter

I would like to thank Michael Johnston <michael.johnston@intel.com>,
Mike Henry <mike.henry@intel.com>, and all the other PXE developers
at Intel for their help, and information in helping solve this
problem.
2000-04-26 07:38:40 +00:00
John Baldwin
36273c5d79 Don't disable interrupts when calling a vm86 mode interrupt or routine
from user mode.  Don't disable interrupts when returning from vm86 mode
to user mode either.  Now, we only disable interrupts before calling a
hardware interrupt handler, which is the only time we _should_ be
disabling interrupts.

Because of this, err, feature, any routine that one called in vm86 mode
had to re-enable interrupts by setting the interrupt flag or interrupts
would remain disabled even after the routine returned.  For example, I
have a simple debugging routine that uses a vm86 mode function to dump
any arbitrary memory word that I use to read the BIOS timer or any other
memory location.  This function does 1 load instruction from memory and
then returns.  Since it didn't re-enable interrupts, the first time I
called it to read the BIOS timer, it disabled interrupts.   This also
affected the PXE bootstrap as it needs interrupts enabled while it is
processing.  This patch fixes both of those situations so that those
functions do not worry about having to enable interrupts.  Hardware
interrupt handlers worked fine with the old code because they always
enable interrupts as part of their routine.

If you have any problems with the loader after this commit, please
let me know.  I'd like to MFC it in a week or two since PXE support
needs it.

Noticed by:	ps, Michael Johnston <michael.johnston@intel.com>
2000-04-26 04:35:25 +00:00
Yoshihiro Takahashi
41088a06e7 Sync with the following changes.
sys/boot/i386/libi386/Makefile	1.16 and 1.17
sys/boot/i386/loader/Makefile	1.44
sys/boot/i386/loader/main.c	1.20
2000-04-23 09:33:31 +00:00
Paul Saab
43e797fd31 Move the building of the PXE module into libi386. 2000-04-21 22:06:02 +00:00
Paul Saab
2339dc037f Make the loader a little smarter about when it is and is not allowed
to call PXE.
2000-04-21 04:58:51 +00:00
Paul Saab
5d5b2077f1 Don't call the PXE cleanup routine if PXE is not enabled. This
should fix the "Invalid partition table" error people were seeing.
2000-04-21 03:04:16 +00:00
Paul Saab
6450dd3cb4 Add a cleanup function. This is needed for PXE where you should
shutdown the UNDI and unload the stack.
2000-04-20 00:06:15 +00:00
Paul Saab
e938899cc3 Use !PXE api over PXENV+ api.
Magic trampoline by: peter (at 4am and after a good whipping at airhockey)
Do a better job of returning and detecting errors.
2000-04-19 11:22:38 +00:00
Mike Smith
300451c472 Some more i386-only BIOS-friendliness:
- Add support for using the PCI BIOS functions for configuration space
   accesses, and make this the default.

 - Make PNPBIOS the default (obsoletes the PNPBIOS config option).

 - Add two new boot-time tunables to disable each of the above.
2000-04-16 20:48:33 +00:00
Yoshihiro Takahashi
b638de134f The printf function of boot2 can't recognize "%lx" format.
Submitted by:	Nobuyuki Koganemaru <kogane@koganemaru.co.jp>
2000-04-14 14:25:13 +00:00
Yoshihiro Takahashi
1e6081a12f Merged from sys/boot/i386/loader/Makefile revision 1.43. 2000-04-14 13:51:14 +00:00
KATO Takenori
117a0be4e9 Merged from sys/boot/i386/loader/main.c rev 1.19. 2000-04-12 11:17:08 +00:00
John Baldwin
2cb6d95d48 Add a missing dependency: boot2 depends on the BTX kernel. 2000-04-11 14:49:13 +00:00
Jordan K. Hubbard
4fbd258bcc Nuke duplicate struct declaration from somebody's paste-o 2000-04-08 22:50:18 +00:00
Paul Saab
d8af287caf Make PXE use the UDP API. This allows for both TFTP and NFS support.
You may specify TFTP or NFS via compile time options in the loader,
but not both at this time.

Also, remove a warning about not knowing how to boot from network
devices.  We can obviously do that now.
2000-04-08 01:22:14 +00:00
Paul Saab
dbe3e0f575 Add a missing PXE API call and structure. 2000-04-04 07:28:54 +00:00
Paul Saab
2efc827d19 Add all the PXE related structures from the 2.1 PXE spec from Intel.
Fix exsisting code to match the spec.
2000-04-04 00:38:59 +00:00
KATO Takenori
c1cdadfffe Synced with following files:
src/sys/boot/i386/Makefile.inc	1.1
  src/sys/boot/i386/btx/btx/btx.s	1.15
  src/sys/boot/i386/btx/btxldr/Makefile	1.8
  src/sys/boot/i386/btx/btxldr/btxldr.s	1.9
  src/sys/boot/i386/libi386/biosdisk.c	1.29
  src/sys/boot/i386/loader/Makefile	1.42
  src/sys/boot/i386/loader/main.c	1.18
(entry point address of loader was not changed.)

Reviewed by:	nyan
2000-03-31 16:03:02 +00:00
KATO Takenori
fdf884ea55 Separated serial boot block interface routine into NS16550 stuff and
i8251 stuff.
2000-03-30 09:25:03 +00:00
John Baldwin
48a0c4ea04 Mega i386 loader commit.
- Don't hard code 0x10000 as the entry point for the loader.  Instead add
  src/sys/boot/i386/Makefile.inc which defines a make variable with the
  entry point for the loader.  Move the loader's entry point up to
  0x20000, which makes PXE happy.
- Don't try to use cpp to parse btxldr for the optional BTXLDR_VERBOSE,
  instead use m4 to achieve this.  Also, add a BTXLDR_VERBOSE knob in the
  btxldr Makefile to turn this option on.
- Redo parts of cdldr's Makefile so that it now builds and installs cdboot
  instead of having i386/loader/Makefile do that.  Also, add in some more
  variables to make the pxeldr Makefile almost identical and thus to ease
  maintainability.
- Teach cdldr about the a.out format.  Cdldr now parsers the a.out header
  of the loader binary and relocates it based on that.  The entry point of
  the loader no longer has to be hardcoded into cdldr.  Also, the boot
  info table from mkisofs is no longer required to get a useful cdboot.
- Update the lsdev function for BIOS disks to parse other file systems
  (such as DOS FAT) that we currently support.  This is still buggy as
  it assumes that a floppy with a DOS boot sector actually has a MBR and
  parses it as such.  I'll be fixing this in the future.
- The biggie:  Add in support for booting off of PXE-enabled network
  adapters.  Currently, we use the TFTP API provided by the PXE BIOS.
  Eventually we will switch to using the low-level NIC driver thus
  allowing both TFTP and NFS to be used, but for now it's just TFTP.

Submitted by:	ps, alfred
Testing by:	Benno Rice <benno@netizen.com.au>
2000-03-28 01:19:53 +00:00
Yoshihiro Takahashi
b0198bb46f Sync with sys/boot/i386/libi386/biosdisk.c revision 1.27 and 1.28.
Submitted by:	Kaho Toshikazu <kaho@elam.kais.kyoto-u.ac.jp>
2000-03-17 12:38:36 +00:00
John Baldwin
7be31bb1b2 Remove some extra spammage that made it into this commit. This will be
revisited later with a better fix, or at least one that compiles. :)

Approved by:	dcs
2000-03-15 16:36:55 +00:00
Daniel C. Sobral
7b12e51659 Pass an unit number to bcache_strategy, so it can flush the cache when
necessary. Pass an absolute block number too, instead of receiving a
relative one in realstrategy(), as bcache_strategy() requires this.

The fix is sligthly different from the one in the PR.

PR:		17098
Submitted by:	John Hood <jhood@sitaranetworks.com>
2000-03-15 01:58:45 +00:00
Daniel C. Sobral
a5686d2f66 bcache_strategy() now receives an unit number, and keep track of what
was the last unit number received. If it changes, it flushes the cache.
Add bcache_flash().

The actual fix is sligthly different from the one in the PR.

PR:		17098
Submitted by:	John Hood <jhood@sitaranetworks.com>
2000-03-15 01:56:12 +00:00
Daniel C. Sobral
fbc9fa5059 Pass unit number to bcache_strategy(), so that the cache can be
flushed if the unit changes. Compute the absolute offset before
bcache_strategy() instead of after.

The actual fix is sligthly different for the one in the PR.

PR:		17098
Submitted by:	John Hood <jhood@sitaranetworks.com>
2000-03-15 01:53:34 +00:00
Boris Popov
ce0d1c79c3 Fix the loader to handle module dependencies properly. More fixes
will be provided after modmetadata appears in the kernel.

Reviewed by:	msmith
Approved by:	jkh
2000-02-25 05:10:44 +00:00
Mike Smith
51b5739aaf Close a file descriptor leak in the code which loads file objects.
Submitted by:	Paul Saab <paul@mu.org>
Approved by:	jkh
2000-02-17 02:19:19 +00:00
John Baldwin
536fcb08bf This patch to BTX fixes several small things:
1) Fix a bug in the int15 function 87 emulation where we only copied half
   of what the BIOS asked for.  This caused the Mylex RAID adapter to go
   haywire and start trashing memory when you tried to boot from it.
2) Don't use interrupt 19 to reboot.  Instead, set the reboot flag to a warm
   boot and jump to the BIOS's reboot handler.  int 19 doesn't clear memory
   or restore the interrupt vector table, and thus really isn't safe.  For
   example, when booting off of PXE, the PXE BIOS eats up a chunk of memory
   for its internal data and structures.  Since we rebooted via int 19,
   using the 'reboot' command in the loader resulted in that memory not
   being reclaimed by the BIOS.  Thus, after a few PXE boots, the system
   was out of lower memory.
3) Catch any int 19 calls made by a BTX client or a user pressing
   Ctrl-Alt-Delete and shutdown BTX and reboot the machine cleanly.  This
   fixes Ctrl-Alt-Delete in the loader and in boot2 instead of presenting
   the user with a BTX fault.

Approved by:	jkh
Found by:	1) by msmith
2000-02-16 07:00:16 +00:00
Ruslan Ermilov
a6120246a2 Support the new ata(4) syntax, while providing backward compatibility for wd(4).
Reviewed by:	jkh, msmith, sos
Approved by:	jkh
2000-02-09 19:23:46 +00:00
KATO Takenori
080be1dd6a Synced with sys/boot/i386/loader/Makefile rev 1.41. 2000-02-05 02:21:31 +00:00
Luigi Rizzo
2dea85d508 Add a NOFORTH variable so we can build a smaller loader without
Forth support, for use with PicoBSD

Approved-By: jordan
2000-02-04 20:57:09 +00:00
John Baldwin
4e60d653ce Fix bogon in previous commit. Re-enable Forth in the loader.
Noticed by:	dcs
Approved by:	jkh
2000-01-30 06:56:27 +00:00
KATO Takenori
0219f40756 Synced with sys/boot/i386/btx/btx/btx.s rev 1.14. 2000-01-29 13:48:36 +00:00
John Baldwin
064b3244ec Allow for cdldr to be built in ${.OBJDIR}/../cdldr/cdldr instead of
only looking for it in ${.CURDIR}/../cdldr/cdldr.  This fixes world.
2000-01-28 15:19:22 +00:00
Daniel C. Sobral
bc9ca81f3d Implement a machine-independent (word size-independent) FICL_TRUE. 2000-01-28 03:59:12 +00:00
Daniel C. Sobral
c2881538fa ANS Forth for logical not is 0=, not invert. Replace wrong usage. 2000-01-28 03:41:39 +00:00
Daniel C. Sobral
d9d102dd14 Add testmain.o to CLEANFILES. 2000-01-28 03:07:25 +00:00
Daniel C. Sobral
5c23af7cdb Try my hand again at removing ugly testmain target. 2000-01-28 02:40:23 +00:00
John Baldwin
c8bb85f758 Add the new cdldr CD bootstrap loader. This patch includes the following:
- Fix btxldr to preserve a NULL bootinfo pointer when it copies the kernel
  arguments.
- Add the cdldr bootstrap program.  This program is tacked onto the
  beginning of the standard 3rd stage boot loader (/boot/loader) to form
  the CD boot loader (/boot/cdboot).  When a CD is booted, the cdboot file
  is copied into memory instead and executed.  The cdldr stub emulates the
  environment normally provided by boot2 and then starts the loader.  This
  booting method does not emulate a floppy drive, but boots directly off of
  the CD.  This should fix the problems some BIOS's have with emulating a
  2.88 MB floppy image.
- Add support to the loader to recognize that it has been booted by cdldr
  instead of boot2 and use a simpler method of extracting the BIOS boot
  device.
2000-01-27 21:21:01 +00:00
John Baldwin
c299f41fd9 Fix brokenness introduced with the PAGING conditional variable. The value
of %cr0 wasn't reloaded into %eax before being modified to turn protected
mode off if PAGING was not defined.  The result was that the processor did
not exit protected mode, so when it tried to jump to segment 0x0 in the
next instruction to clear the prefetch cache like one should when leaving
protected mode, it actually tried to jump to a null selector, causing a
GPF.
2000-01-27 21:06:13 +00:00
Bill Paul
261b9b3066 Add driver support for the Aironet 4500/4800 series wireless 802.11
NICs. (Finally!) The PCMCIA, ISA and PCI varieties are all supported,
though only the ISA and PCI ones will work on the alpha for now.
PCCARD, ISA and PCI attachments are all provided. Also provided an
ancontrol(8) utility for configuring the NIC, man pages, and updated
pccard.conf.sample. ISA cards are supported in both ISA PnP and hard-wired
mode, although you must configure the kernel explicitly to support the
hardwired mode since you have to know the I/O address and port ahead
of time.

Special thanks to Doug Ambrisko for doing the initial newbus hackery
and getting it to work in infrastructure mode.
2000-01-14 20:41:03 +00:00
Bill Paul
0177987224 Add device driver support for USB ethernet adapters based on the CATC
USB-EL1202A chipset. Between this and the other two drivers, we should
have support for pretty much every USB ethernet adapter on the market.
The only other USB chip that I know of is the SMC USB97C196, and right
now I don't know of any adapters that use it (including the ones made
by SMC :/ ).

Note that the CATC chip supports a nifty feature: read and write combining.
This allows multiple ethernet packets to be transfered in a single USB
bulk in/out transaction. However I'm again having trouble with large
bulk in transfers like I did with the ADMtek chip, which leads me to
believe that our USB stack needs some work before we can really make
use of this feature. When/if things improve, I intend to revisit the
aue and cue drivers. For now, I've lost enough sanity points.
2000-01-14 03:14:49 +00:00
Bill Paul
dfd1e98eac Add device driver support for USB ethernet adapters based on the
Kawasaki LSI KL5KUSB101B chip, including the LinkSys USB10T, the
Entrega NET-USB-E45, the Peracom USB Ethernet Adapter, the 3Com
3c19250 and the ADS Technologies USB-10BT. This device is 10mbs
half-duplex only, so there's miibus or ifmedia support. This device
also requires firmware to be loaded into it, however KLSI allows
redistribution of the firmware images (I specifically asked about
this; they said it was ok).

Special thanks to Annelise Anderson for getting me in touch with
KLSI (eventually) and thanks to KLSI for providing the necessary
programming info.

Highlights:
- Add driver files to /sys/dev/usb
- update usbdevs and regenerate attendate files
- update usb_quirks.c
- Update HARDWARE.TXT and RELNOTES.TXT for i386 and alpha
- Update LINT, GENERIC and others for i386, alpha and pc98
- Add man page
- Add module
- Update sysinstall and userconfig.c
2000-01-05 04:27:24 +00:00
Yoshihiro Takahashi
7c1df76bc2 Merge from the following changes.
sys/boot/i386/libi386/biosmem.c	Rev 1.4
	sys/boot/i386/libi386/time.c	Rev 1.3
	sys/boot/i386/loader/main.c	Rev 1.16
2000-01-03 15:43:52 +00:00
Yoshihiro Takahashi
fdab06ad70 Fixed to get the BIOS geometry. 2000-01-03 15:28:05 +00:00
Mike Smith
627249c7b1 Substantially revamp the way that we determine the amount of memory available
for our use.  Use the same search order for BIOS memory size functions
as the kernel will later use.

Allow the loader to use all of the detected physical memory (this will
greatly help people trying to load enormous memory disk images).

More correctly handle running out of memory when loading an object.

Use the end of base memory for the top of the heap, rather than
blindly hoping that there is 384k left.

Add copyrights to a couple of files I forgot.
1999-12-29 09:54:46 +00:00
Peter Wemm
c447342094 Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"
is an application space macro and the applications are supposed to be free
to use it as they please (but cannot).  This is consistant with the other
BSD's who made this change quite some time ago.  More commits to come.
1999-12-29 05:07:58 +00:00
Mike Smith
495865e47d Correctly handle a user-requested abort in the middle of displaying a
help subtopic.

PR:		kern/13196
Submitted by:	MIHIRA Sanpei Yoshiro <sanpei@sanpei.org>
1999-12-28 07:19:22 +00:00
Bill Paul
ed63a7aaef This commit adds device driver support for the ADMtek AN986 Pegasus
USB ethernet chip. Adapters that use this chip include the LinkSys
USB100TX. There are a few others, but I'm not certain of their
availability in the U.S. I used an ADMtek eval board for development.
Note that while the ADMtek chip is a 100Mbps device, you can't really
get 100Mbps speeds over USB. Regardless, this driver uses miibus to
allow speed and duplex mode selection as well as autonegotiation.
Building and kldloading the driver as a module is also supported.

Note that in order to make this driver work, I had to make what some
may consider an ugly hack to sys/dev/usb/usbdi.c. The usbd_transfer()
function will use tsleep() for synchronous transfers that don't complete
right away. This is a problem since there are times when we need to
do sync transfers from an interrupt context (i.e. when reading registers
from the MAC via the control endpoint), where tsleep() us a no-no.
My hack allows the driver to have the code poll for transfer completion
subject to the xfer->timeout timeout rather that calling tsleep().
This hack is controlled by a quirk entry and is only enabled for the
ADMtek device.

Now, I'm sure there are a few of you out there ready to jump on me
and suggest some other approach that doesn't involve a busy wait. The
only solution that might work is to handle the interrupts in a kernel
thread, where you may have something resembling a process context that
makes it okay to tsleep(). This is lovely, except we don't have any
mechanism like that now, and I'm not about to implement such a thing
myself since it's beyond the scope of driver development. (Translation:
I'll be damned if I know how to do it.) If FreeBSD ever aquires such
a mechanism, I'll be glad to revisit the driver to take advantage of
it. In the meantime, I settled for what I perceived to be the solution
that involved the least amount of code changes. In general, the hit
is pretty light.

Also note that my only USB test box has a UHCI controller: I haven't
I don't have a machine with an OHCI controller available.

Highlights:

- Updated usb_quirks.* to add UQ_NO_TSLEEP quirk for ADMtek part.
- Updated usbdevs and regenerated generated files
- Updated HARDWARE.TXT and RELNOTES.TXT files
- Updated sysinstall/device.c and userconfig.c
- Updated kernel configs -- device aue0 is commented out by default
- Updated /sys/conf/files
- Added new kld module directory
1999-12-28 02:01:18 +00:00
Peter Wemm
7f69314760 Connect up the bootforth glue and compile it, but don't initialize it
at runtime as it has a nasty habit of crashing on the Alpha :-(.
This is being done this way so we have a common starting point for
debugging.
1999-12-27 09:20:33 +00:00
Bill Paul
0c868fed5a Close PR #15422; fix loader.conf to reflect new driver support (old
tulip clone NICs merged into if_dc driver).

PR: conf/15422
1999-12-23 05:28:31 +00:00
Yoshihiro Takahashi
2ea9f12efa - Supported the bd_getbigeom function and use this function to get BIOS
geometry.
- Use i386/libi386/bootinfo.c instead of pc98/libpc98/bootinfo.c.

Submitted by:	IMAI Takeshi <take-i@ceres.dti.ne.jp>
1999-12-19 14:05:46 +00:00
Marcel Moolenaar
a031bda24e Don't build gensetdefs when we can use /usr/bin/gensetdefs. The latter
also creates setdef{0|1}.c so there's no need to have those in the
repository. Using /usr/bin/gensetdefs has no consequences for the
output.
1999-12-16 17:25:01 +00:00
Marcel Moolenaar
bc16e96f49 Add -L${DESTDIR}${LIBDIR} to ld's command line so that the right
libstand is used.
1999-12-15 18:16:56 +00:00
Poul-Henning Kamp
7d5961670c Remove BAD144 support, it has already been disabled for some time. 1999-12-08 09:33:00 +00:00
Mike Smith
d0eb8c13d5 Update the sample for $init_path to reflect the kernel default. 1999-12-07 18:35:58 +00:00
Mike Smith
390cab70e1 Update to reflect use of : not ; as separator in paths passed to the
kernel.
1999-12-07 18:31:43 +00:00
Daniel C. Sobral
025ff8abcc Make some examples reflect defaults. 1999-12-07 04:24:05 +00:00
Yoshihiro Takahashi
8203d279a0 Supported to sound beep.
Submitted by:	chi@bd.mbn.or.jp (Chiharu Shibata)
1999-12-03 13:20:55 +00:00
Daniel C. Sobral
300325c61e Add bus suffix to mii. 1999-12-02 03:48:50 +00:00
Daniel C. Sobral
8bde83d551 Add if_ prefix to network drivers. 1999-12-02 03:47:46 +00:00
Daniel C. Sobral
35d9646783 Add fairings. Do not depend on user actually supplying the arguments
he is supposed to supply.
1999-12-01 18:30:26 +00:00
Daniel C. Sobral
69c9583604 Make the prompt look like on OpenBoot. 1999-11-27 21:44:47 +00:00
Daniel C. Sobral
3f45ca0445 Zeroes structure before using it. 1999-11-27 18:31:57 +00:00
Daniel C. Sobral
0f59fe37a4 Belatedly add splash_pcx_load to the documented variables. Reword
splash_bmp_load.
1999-11-26 08:09:04 +00:00
Yoshihiro Takahashi
82dbc15151 Sync with sys/boot/i386/loader/Makefile revision 1.37. 1999-11-25 12:46:16 +00:00
Daniel C. Sobral
c124b1392d Activates password protection (if a password is defined).
Adds $FreeBSD$.
1999-11-24 17:59:37 +00:00
Daniel C. Sobral
d2290dd57e Add silly password feature. If people want to depend on a flawed
security measures, so be it. It costs us almost nothing.

Document some code in support.4th that I was unable to understand
just by reading.
1999-11-24 17:56:40 +00:00
Daniel C. Sobral
8a3f7b6ba9 Add machine-specific include path to ficl's sysdep.h. Wishes I had
gone to bed earlier.

Pointed by: peter
1999-11-23 16:30:48 +00:00
Daniel C. Sobral
0ae220095f Revert ill-considered simplification in 1.13.
Pointed by: peter
1999-11-23 16:28:39 +00:00
Daniel C. Sobral
83b912c6e6 Improve Makefile by using .PATH.
Taught by: peter
1999-11-23 15:55:28 +00:00
Daniel C. Sobral
8967d5f42e Improve on ficl port to alpha.
Files sysdep.[ch] are now in ${MACHINE_ARCH} subdirectory. Internal
#if's used to identify the platform where removed.

Make rule for target testmain was greatly simplified, because it was
easier simplifying it than changing it to support the new location of
sysdep.[ch].

(a repo-copy was done on sysdep.[ch], of course)
1999-11-23 15:24:30 +00:00
Daniel C. Sobral
99915e5b91 (Hopefully) make all necessary changes for ficl to support alpha. 1999-11-23 11:17:37 +00:00
Nick Hibma
384781000e Add comments on what it the USB modules are. Add the usb module.
The USB module contains the OHCI and UHCI controllers as well.
Sticking them into separate modules might be possible after I have
untangled the mess.
1999-11-22 04:08:37 +00:00
Nick Hibma
f83cfc1b03 Change the name of the modules from <name>_mod to <name>
Suggested by:	David O'Brien <obrien@FreeBSD.ORG>
1999-11-17 22:47:11 +00:00
Nick Hibma
92fcf9e046 Add the USB modules. 1999-11-16 22:00:46 +00:00
Yoshihiro Takahashi
15e01db88b Fixed warnings. 1999-11-16 11:59:19 +00:00
Yoshihiro Takahashi
1615de7614 Remove -mno-486 option and add -mpreferred-stack-boundary=2 option. 1999-11-16 11:56:38 +00:00
Yoshihiro Takahashi
4374deee58 Cosmetic changes. 1999-11-16 00:42:18 +00:00
Yoshihiro Takahashi
f089b54dc6 Install loader.rc. 1999-11-16 00:38:20 +00:00
Marcel Moolenaar
0ff463dd2d PC-98 has MACHINE_ARCH=i386 and MACHINE=pc98. Make it a special case.
This should fix the breakage reported by nyan.
1999-11-15 08:31:14 +00:00
David E. O'Brien
c8e02dfe73 Add -fdata-sections, which is a new GCC 2.95 optimization. Remove
-fschedule-insns as it wasn't such a big win with 2.95 after all.

Add the *BIG* win "-mpreferred-stack-boundary=2" optimiztion submitted by
Dima.  GCC 2.95 ensures the stack frame is always properly [opitimally]
aligned by surrounding every function call by code simular to
"addl $-12, %esp" / "addl $12, %esp".  Here we need the reduction in space,
with speed not an issue.
1999-11-15 04:23:40 +00:00
David E. O'Brien
cd37fe517b Return this file to its pre-spammed version. Thanks to some new compiler
optimizations, we can go from 3 bytes free with the spammed version, to
279 bytes free with the full version.
1999-11-14 22:17:06 +00:00
Marcel Moolenaar
0917704bd4 ${MACHINE} -> ${MACHINE_ARCH}
All Makefiles now use MACHINE_ARCH for the target architecture.
Unification is required for cross-building.

Tags added to:
	sys/boot/Makefile
	sys/boot/arc/loader/Makefile
	sys/kern/Makefile
	usr.bin/cpp/Makefile
	usr.bin/gcore/Makefile
	usr.bin/truss/Makefile

usr.bin/gcore/Makefile:
	fixed typo: MACHINDE -> MACHINE_ARCH
1999-11-14 13:54:44 +00:00
David E. O'Brien
cf49270ac3 Enter complier upgrade mode again. We need to cut 169 bytes from this:
Remove some printf() calls, reduce size of buffers, and abbreviate
	some strings.

Hopefully the boot people will fix this spamage after the cut over to
Gcc 2.95.2 as the system compiler.
1999-11-14 00:41:54 +00:00
David E. O'Brien
73de3d0ff7 Turn on the -fforce-addr and -fschedule-insns optimizations. Adding
either one gives us an additional 32 bytes of additional space available
when using EGCS 1.1.2.  With GCC 2.95.2 -fforce-addr gives us 12 more bytes,
and adding -fschedule-insns gives us an additional 4 bytes.
1999-11-13 23:08:46 +00:00
Doug Rabson
ef4939417a Add back netboot since it compiles just fine. Note that you need a full
source tree to build netboot since it depends on headers from libstand.
1999-11-03 20:19:30 +00:00