Commit Graph

1381 Commits

Author SHA1 Message Date
bms
91f8e38d0e Add a serial console capable version of the FreeBSD boot manager. This has
been lying around my tree(s) for the past year or so. It could do with TLC.

Requested by:	obrien
Sponsored by:	Weyland-Yutani Corporation
2003-12-08 17:51:39 +00:00
dcs
e49b828f3c With the beastie menu a problem was introduced in which selecting a
different kernel to boot with kernel="NAME" would load the kernel and
loader.conf-selected modules from /boot/NAME, but it would not change
module_path. So, for instance, the automatically loaded acpi.ko would come
from /boot/kernel/acpi.ko, *always*.

Mind you, this happened for unassisted boot. If you interrupted, typed
"unload" and then "boot NAME", it would Do The Right Thing.

The source of the problem is the double initialization with beastie's
loader.rc. One would happen inside "start", and would load the kernel. The
next one would happen later in the loader.rc script, resetting module_path.

Because module_path is set to the Right Value by the functions in support.4th
that actually load the kernel, when beastie.4th proceeded to boot
module_path would remain wrong, as the kernel was already loaded.

This can be corrected by removing either initialization, and also by changing
the command used by beastie.4th from "boot" to "boot-conf", which makes sure
you use the right kernel and modules.

I chose to remove the second initialization, since this let you interrupt
(or confirm) boot before beastie even comes up. I avoid also doing the
boot-conf change because that would simply cause the kernel and modules to
be loaded twice (in fact, that was my original patch, until, in writing this
very commit message, I saw the error of my ways).

This commit changes the semantics of module loading when using the beastie
menu. Now it does what one would expect it to, but not what it was actually
doing, so something may break for unusual setups depending on broken
behavior. As our japanese friends so nicely put it, shikata ga nakatta. :-)

Approved by:	re (scottl)
2003-11-21 19:01:02 +00:00
jhb
270abadccb Update the size of the OS string table that wasn't updated in the previous
commit that removed the UNIX entry.

Submitted by:	Rudolf Cejka <cejkar@fit.vutbr.cz>
Approved by:	re (rwatson)
2003-11-20 20:28:18 +00:00
phk
182003c916 When rebooting the machine jump to 0xf000:0xfff0 instead of 0xffff:0x0.
While we end up the same place, we end up with two different CS register
values after the jump and 0xf000 is compatible with the hardware reset
value.

This makes a difference if the BIOS does a near jump before a far jump.

Detective work and patch by:	 Adrian Steinmann <ast@marabu.ch>
2003-11-16 18:24:23 +00:00
nyan
03f8ec31a5 MFi386: revision 1.13. 2003-11-15 12:25:47 +00:00
bde
8d33193f2d Changed the RB_PAUSE flag from 0x40000 to 0x100000 and marked the old
value as reserved for internal use in boot blocks, because RB_PAUSE
broke binary compatibility by usurping the RB_DUAL flag.  Probably no
one except me has boot blocks for which this matters, since most boot
blocks based on biosboot including pc98's boot2 can't boot elf kernels,
and /boot/loader doesn't properly pass flags set by the previous stage.

reboot.h:
Also mark the historical RB_PROBEKBD flag (0x80000) as reserved for
internal use in boot blocks.

boot2.c:
Added comments to inhibit usurping of other flags.

Approved by:	guido, imp
MFC after: 	1 week
2003-11-15 10:04:06 +00:00
jake
1fb373b0b2 Set RB_SERIAL in boothowto if the firmware output-device is ttya or ttyb.
This ensures that uart gets a higher console priority than syscons when
a serial console is being used.  Testing against the "console" environment
variable doesn't make sense since we only have one loader console driver.
2003-11-11 18:01:44 +00:00
bde
0bdac5e2ed Include <sys/reboot.h> the definition of RB_BOOTINFO. The previous
commit broke the world because it depended on namespace pollution that
was only in my version of <machine/bootinfo.h>.  The include was removed
in rev.1.63 after the last reference to it went away in rev.1.61.
2003-11-11 06:27:34 +00:00
bde
471e23295f Fixed loss of setting of the RB_BOOTINFO flag in rev.1.43. Fixed wrong
comment about this flag in rev.1.61.  It is not historical like the
comment said; it is the flag that says that most of what is laboriously
put in the bootinfo struct is actually there.  Newer kernels were
bootable by even the broken boot2 without losing anything except the
symbol table, but older kernels need at least the memory sizes.

Restoring the "|" with RB_BOOTINFO that was lost in rev.1.43 costs 5
bytes.  The fix can be done in only 4 bytes by fixing some code that
was removed in rev.1.61 (put RB_BOOTINFO back in in the initial value
of "opts" and fix RBX_MASK to not clobber it.)
2003-11-10 19:06:09 +00:00
marcel
5bff31195e Implement PAL_HALT_LIGHT now that the kernel halts the processor
when idle. All we have to do is return.
2003-11-09 07:42:16 +00:00
marcel
300c240ca8 Do not strip skiload when installed. The stripped binary does not load
in the simulator.
2003-11-09 06:53:37 +00:00
jhb
8c9828262b Fix an incorrect quote character in an M4 test conditon. Basically, one
of the verbose print statements that BTXLDR_VERBOSE enables wasn't properly
enabled.
2003-11-06 21:33:17 +00:00
iedowse
1326cf929a Override the root server address if an IP address is specified in
the root path. This is reported to make non-PXE netbooting, such as
is used on sparc64 systems, work correctly when the TFTP server is
not the same as the root server.

PR:		kern/57328
Submitted by:	Per Kristian Hove <Per.Hove@math.ntnu.no>
2003-11-03 19:45:05 +00:00
scottl
8c5f815b78 Directly call the 'reboot' word instead of indirectly evaluating it. 2003-10-28 17:18:42 +00:00
scottl
871473da6f Directly call the 'boot' word instead of indirectly evaluating it.
Submitted by: dcs
2003-10-27 16:39:49 +00:00
bde
4f8336a314 Don't repeat selected defines from ns16550.h or sioreg.h. Just
include ns16550.h.  The missing installation of ns16550.h was fixed
long ago and the misplaced defines in sioreg.h were fixed recently.
2003-09-16 11:24:23 +00:00
scottl
ed20b320a6 Apply Aleksander Fafula's crayons to the beastie. Add the this line to
/boot/loader.conf to see the pretty colors =-)

loader_color="YES"
2003-09-13 18:35:01 +00:00
obrien
89785203a5 Use __FBSDID().
Also some minor style cleanups.
2003-09-08 09:11:32 +00:00
phk
b6da2e6044 Add BOOT_PXELDR_ALWAYS_SERIAL option which forces serial console. 2003-09-03 08:12:20 +00:00
obrien
57fdddeed9 Use __FBSDID().
Also some minor style cleanups.
2003-08-25 23:30:41 +00:00
obrien
b352adcca9 Use __FBSDID().
Also some minor copyright style cleanups.
2003-08-25 23:28:32 +00:00
imp
75d0d02719 Many newer CF do not handle having the entire track read from them at
boot time.  Instead, read it a sector at a time.  While this sounds
like a significant slowdown, I've not been able to measure any
signficant difference.

Submitted by: luigi
Reviewed by: jhb, sam (both a while ago)
MFC After: 3 days
2003-08-22 01:59:28 +00:00
obrien
e57b63786c FICL doesn't build on PowerPC yet, so disable. 2003-08-16 02:48:20 +00:00
jhb
e78286124c Consistently use the BSD u_int and u_short instead of the SYSV uint and
ushort.  In most of these files, there was a mixture of both styles and
this change just makes them self-consistent.

Requested by:	bde (kern_ktrace.c)
2003-08-07 15:04:27 +00:00
njl
1d3dd52b02 Null terminate the OEM hint. This rids my laptop of the smiley face that
would follow the 6 valid chars of the table entry.
2003-08-07 14:53:14 +00:00
grehan
d35feded85 Fix asm string newlines to keep gcc3.3 happy. Use register prefixes
to make the asm a bit more readable.
2003-08-05 11:30:18 +00:00
marcel
c4a41a09ce Don't hardcode unit 0 for the current device if we're loaded from an
EFI file system. When booting from a CD and there's already an EFI
system partition on the disk, setting the current device to unit 0
will select the harddisk. This invariably breaks installing FreeBSD
when other operating systems have been installed before.

We obviously want to do the same when we're booting over the network.
Maybe later.

Based on a patch (from memory) from: arun
2003-08-02 08:22:03 +00:00
marcel
ab242291b3 Fix the ski loader, broken by the gcc upgrade. Update the linker
script to match the one for the EFI loader and rewrite __start()
in assembly to have gp defined without getting in the way of the
compiler.
2003-07-17 01:49:59 +00:00
marcel
32cdabf111 Have the linker script look more like the default linker script
on ia64. This fixes the breakage caused by the gcc upgrade that
resulted in a broken executable.
2003-07-17 00:32:08 +00:00
njl
a9ae3ff6d1 Add include file so this builds with new acpica
Reported by:	Kevin Oberman <oberman@es.net>
2003-07-13 22:54:53 +00:00
nyan
206189f91b Fixed build error with GCC 3.3.1 2003-07-13 08:13:52 +00:00
tmm
9150327941 NFS support should be conditional on LOADER_NFS_SUPPORT, not
LOADER_NET_SUPPORT.
2003-07-11 16:12:50 +00:00
ru
88a35b4886 Revert non-style part of the recent two deltas that dealt with
using as(1) to compile plain assembler source files; bsd.lib.mk
has been fixed (in revision 1.147).
2003-07-02 12:45:45 +00:00
ru
46ffe823f2 sys/ia64/ia64/pal.s has been repocopied to pal.S.
Approved by:	marcel
Repocopied by:	joe
2003-07-02 11:53:55 +00:00
ru
35f07fe322 pal_stub.s has been repo-copied to pal_stub.S.
Approved by:	marcel
Repocopied by:	joe
2003-07-02 11:47:33 +00:00
brueffer
c701d7fedd Add the beastie_disable variable which allows to turn the beastie
boot menu on and off.

Reviewed by:	scottl
2003-07-01 01:03:32 +00:00
ru
a6c4dc6b5f bsd.lib.mk,v 1.143 no longer uses ld(1) directly to strip
symbols from intermediate object files, so these hacks to
get AMD64 compile are no longer needed.

Tested on:	sledge.FreeBSD.org
2003-06-30 19:08:49 +00:00
ru
bd66ea89b9 Switch to using bsd.prog.mk; this gives us back the standard
.s.o transformation rule.
2003-06-30 14:10:58 +00:00
ru
d776332351 MFi386: revision 1.16. 2003-06-30 00:20:28 +00:00
ru
840346e987 Revision 1.13, besides its useful part, replaced bsd.prog.mk by
bsd.lib.mk and thus broke the build since AFLAGS were not taken
into considered anymore, as bsd.lib.mk currently has wrong .s.o
rule that uses cc(1) instead of as(1).

Revision 1.14 reverted to using as(1), and revision 1.15 brought
AFLAGS back to the business, but revision 1.14 also broke "make
clean".

To fix this, but not break anything that was fixed in revisions
1.13-1.15, we revert mostly to revision 1.13 except for switching
back to using bsd.prog.mk.  This gives us back the default .s.o
rule from sys.mk that uses as(1), and fixes "make clean" by
restoring the full contents of OBJS.

Also fixed LDFLAGS.
2003-06-30 00:15:38 +00:00
brueffer
39dd6aaa1e Capitalize an occurrence of 'ficl' for consistency.
Submitted by:	Andre Guibert de Bruet <andy@siliconlandmark.com>
MFC after:	3 days
2003-06-29 20:57:55 +00:00
peter
0c72d78956 Build on amd64. Yes, I know this isn't particularly nice. 2003-06-26 03:51:57 +00:00
iedowse
7b26cd770f When looking for the ':' separator in the root path, don't go past
the terminating '\0'. Since the initialisation of rootpath in
libstand/bootp.c may copy junk into the rest of the buffer, it was
possible for the code to find a ':' after the '\0' and do the wrong
thing.

Reviewed by:	ps
MFC after:	1 week
2003-06-16 20:48:56 +00:00
jake
cf03276016 Remember to release the loader's heap.
Reviewed by:	tmm
2003-06-15 19:16:43 +00:00
scottl
0eb9e0a4e8 Don't start the beastie menu if the 'beastie_disable' variable is set to
'YES'.

If the user selects to escape to the loader prompt, set 'autoboot_delay'
to 'NO' so that the prompt timer doesn't run.
2003-06-10 22:04:09 +00:00
nyan
79e48e66cc Add help file for pc98. 2003-06-08 03:34:49 +00:00
nyan
d1aa768d5a Enable new boot menu. 2003-06-08 03:20:35 +00:00
nyan
f16e2e2f63 Don't load the acpi module. 2003-06-08 03:16:59 +00:00
nyan
60e3df1edd Set arch-pc98 env to true for pc98. 2003-06-08 03:11:16 +00:00
obrien
596f9326ec Add ${AFLAGS} to 'as' invocation. 2003-06-07 17:42:26 +00:00
nyan
32aaffdd98 MFi386: revisions 1.13 and 1.14. 2003-06-07 08:36:41 +00:00
nyan
f218877662 MFi386: revision 1.30. 2003-06-07 08:23:42 +00:00
obrien
296f3366b9 Don't use a C compiler to assemble a pure asm file. 2003-06-07 08:03:19 +00:00
kuriyama
7a4aac91af Tweak make values and targets not to build kgzldr.o at
installation stage.

Reviewed by: bde
2003-06-06 13:49:51 +00:00
obrien
faff8d522a Don't use a C compiler to assemble a pure asm file. 2003-06-02 02:37:27 +00:00
obrien
96baf9e262 Accpet '1'..'5' in place of F1..F5 for serial console users.
Reviewed by:	Bruce M Simpson <bms@spc.org>
2003-06-01 20:41:04 +00:00
scottl
daeeee662a Man, I'm not on the ball. 4th does not need to escape '\' chars. This
should make our beloved friend look less like he has a massive head wound.
2003-05-31 16:07:00 +00:00
scottl
1abea42025 Flag when ACPI has been disabled by the user so that sysinstall can do
something with it.
2003-05-31 11:19:11 +00:00
scottl
98c4bf22bc Enable the new bootloader for i386 only. The new loader.rc is will only
be installed if an old one does not exist, i.e. only during install, not
during upgrades.

Approved by:	re
2003-05-31 05:25:18 +00:00
scottl
63dab501ca Add a new bootloader menu. Pull in screen.4th and frames.4th from the
examples directory to support it.  This is installed only on i386 for
now.  It will be enabled in a later commit.

Approved by:	re
2003-05-30 09:29:24 +00:00
ru
a09cc58e87 Fixed the markup and wording of the kern.ipc.nsfbufs tunable.
(It does not modify NSFBUFS, but just overrides it if set.)

Approved by:	re (blanket)
2003-05-17 22:17:23 +00:00
peter
7e0ebd57cd Fix a bug in the AMD64 trampoline. I misunderstood the implicit
32->64 bit zero extend.  This changes a movl to an orq.

Approved by:	re (amd64 bits)
2003-05-17 00:30:51 +00:00
murray
9314b2f2cd Add variables for missing network drivers.
PR:		kern/51911
Submitted by:	David Yeske <dyeske@yahoo.com>
Approved by:	re
2003-05-16 04:31:00 +00:00
peter
47dbf3e6e6 Fix lookup of module metadata on amd64 systems. While this is in
common code, the non-trivial part is #ifdef'ed and only executes when
loading amd64 kernels. The rest is trivial but needed for the the amd64
case. (Two variables changed from char ** to Elf_Addr).

Approved by:	re (amd64 "low-risk" stuff)
2003-05-12 05:48:09 +00:00
peter
a985f5d84d Revert leftover AMD64 disable-acpi-module stuff. 2003-05-12 04:57:05 +00:00
peter
a46046be95 For amd64 kernels, repeat the 1GB mapping over the entire address space
instead of just at 0GB and 1GB marks.  This gives more flexibility for
the choice of KERNBASE.

Approved by:	re (amd64 stuff)
2003-05-11 22:42:29 +00:00
obrien
8535cdbb46 Since we insist on loading the POS ACPI by default, give the poor user
instructions on the main help screen for disabling it.
2003-05-05 07:33:12 +00:00
murray
f3e43835e2 Fix a bunch of typos and grammatical errors.
PR:		docs/40234
Submitted by:	Chris Pepper <pepper@rockefeller.edu>  (mostly)
MFC After:	3 days
2003-05-04 08:23:24 +00:00
kato
6f443bbc06 IPLware support. The `IPLware' program assumes boot menu program
begins with the `jmp 0x2d4' near jump.
2003-05-02 09:33:12 +00:00
nyan
4f562cc012 Fix to build pc98 boot loader after support amd64. 2003-05-01 13:17:06 +00:00
peter
9516d9de41 Commit a missed change to keep in sync with the MI elf loader. 2003-05-01 04:39:22 +00:00
peter
2717df393b Argh. This was broken by the last-minute elf32/elf64/"elf kernel" changes. 2003-05-01 04:31:33 +00:00
peter
03a9c2af5c Nuke; repocopied to elf32_freebsd.c where it lives on. 2003-05-01 03:57:19 +00:00
peter
9bf3eb20a4 Enable the i386 loader to load and run an amd64 kernel. If this puts
things over floppy size limits, I can exclude it for release builds or
something like that.  Most of the changes are to get the load_elf.c file
into a seperate elf32_ or elf64_ namespace so that you can have two
ELF loaders present at once.  Note that for 64 bit kernels, it actually
starts up the kernel already in 64 bit mode with paging enabled.  This
is really easy because we have a known minimum feature set.

Of note is that for amd64, we have to pass in the bios int 15 0xe821
memory map because once in long mode, you absolutely cannot make VM86
calls.  amd64 does not use 'struct bootinfo' at all.  It is a pure loader
metadata startup, just like sparc64 and powerpc.  Much of the
infrastructure to support this was adapted from sparc64.
2003-05-01 03:56:30 +00:00
peter
87d0a417db We use i386 boot code on AMD64. 2003-04-30 22:13:36 +00:00
peter
d8f70430d6 ACPI will always be present on AMD64 - it will never be an autodetect
module.
2003-04-30 22:02:39 +00:00
peter
64ae1a85bf Also look for an "elf64 kernel" (for sparc64) and "elf32 kernel" (for
powerpc) when building metadata.
2003-04-30 22:00:16 +00:00
njl
96ca58df0d Support functions for the new ACPI import.
* AcpiOsDerivePciId(): finds a bus number, given the slot/func and the
    acpi parse tree.
  * AcpiOsPredefinedOverride(): use the sysctl hw.acpi.os_name to
    override the value for _OS.

Ideas from:	takawata, jhb
Reviewed by:	takawata, marcel
Tested on:	i386, ia64
2003-04-29 18:50:34 +00:00
phk
e389b1d8d5 Cut&Paste considered far too easy:
Don't include <sys/disklabel.h>
2003-04-16 21:09:41 +00:00
peter
44b534066a Zap some a.out leftovers 2003-04-06 06:28:08 +00:00
phk
1c52794ba9 Libdisk does not need to include <sys/diskslice.h> any more.
Move the remaining bits of <sys/diskslice.h> to <i386/include/bootinfo.h>

Move i386/pc98 specific bits from <sys/reboot.h> to
<i386/include/bootinfo.h> as well.

Adjust includes in sys/boot accordingly.
2003-04-04 16:35:16 +00:00
marcel
ca81fcfe5d Remove `#ifndef lint' left behind after previous change. 2003-04-04 02:12:56 +00:00
obrien
8d3944c4fc Use __FBSDID rather than rcsid[]. 2003-04-03 21:36:33 +00:00
ru
5c0e8870d5 FreeBSD 5.0 has stopped shipping /modules 2.5 years ago. Catch
up with this further by excluding /modules from the (default)
kern.module_path.
2003-03-11 12:09:25 +00:00
trhodes
7ff3d9259d Fix a few spelling errors.
Submitted by:	Stefan Farfeleder <stefan@fafoe.dyndns.org> via -doc.
2003-03-07 03:24:38 +00:00
seanc
842bd69183 Document the tunable kern.ipc.nsfbufs in help.common and loader.8. Small
nearby grammar fixup that saves a line of display while in the loader
(help set tunables), but reuses the line for kern.ipc.nsfbufs.

Approved by:	 roam
2003-03-04 23:46:29 +00:00
ru
2dd01a3c06 FreeBSD 5.0 has stopped shipping /modules 2.5 years ago. Catch
up with this further by excluding /modules from the (default)
kern.module_path.
2003-03-03 22:53:35 +00:00
ru
c83d5b9bf4 Fixed sys/boot/pc98/boot2/Makefile to use kern.mk and
get rid of bsd.kern.mk completely.

OK'ed by:	bde
2003-03-02 21:18:40 +00:00
harti
803350c22c Add two loader tuneables that allow one to change the maximum number of
queue items that can be allocated by netgraph and the number of free queue
items that are cached on a private list.

Netgraph places an upper limit on the number of queue items it may allocate.
When there is a large number of netgraph messages travelling through the
system (100k/sec and more) there is a high probability, that messages get
queued at the nodes and netgraph runs out of queue items. In this case the data
flow through netgraph gets blocked. The tuneable for the number of free
items lets one trade memory for performance.

The tunables are also available as read-only sysctls.

PR:		kern/47393
Reviewed by:	julian
Approved by:	jake (mentor)
2003-03-02 18:04:10 +00:00
marcel
fb799d8743 Speed up debugging in the context of unexpected traps by printing
the address of the image base of the loader. Given cr.iip, we can
use the symbol table to figure out what function caused the trap.
2003-03-01 05:18:28 +00:00
marcel
1483ca0409 Paranoia: Don't use the length of the option string alone to
determine whether we have command line options. We expect a
valid string pointer as well.
2003-03-01 05:13:59 +00:00
marcel
e46a755cd0 Increase the block size for reading and writing from 8KB to 1MB and
introduce a preprocessor define for it. The larger block size
significantly speeds up the loading of the kernel.

Submitted by: Arun Sharma <arun.sharma@intel.com>
2003-02-26 09:13:05 +00:00
obrien
4465e4794d Consistently use NOFORTH to control the usage of ficl. 2003-02-26 06:18:52 +00:00
ru
6ca556abf4 Fixed CLEANFILES.
Submitted by:	cron
2003-02-25 15:41:49 +00:00
obrien
abf341488c Only apply rev 1.10 (which hacks around the i386 boot2 being too big for
both ufs1 and ufs2 support) on i386.
2003-02-25 00:10:20 +00:00
mckusick
5fd1d4fdba Revert to old (broken for over 1.5Tb filesystems) version of cgbase
so that boot loader once again will fit.

Sponsored by:   DARPA & NAI Labs.
2003-02-24 04:57:01 +00:00
marcel
44d37f7cb6 Simplify page alignment. 2003-02-20 06:47:54 +00:00
benno
83631bfcea Don't bother to build ficl if NOFORTH is defined. 2003-02-13 04:35:04 +00:00
trhodes
1d57f17d42 s/hw.pci_allow_unsupported_io_range/hw.pci.allow_unsupported_io_range/
The former was incorrect and gave an `unknown oid' error.
2003-02-08 19:39:01 +00:00
marcel
494acc1366 Remove special casing for running in the simulator from the kernel
and instead add platform, firmware and EFI stubs to the loader.
The net effect of this change is that besides a special console and
disk driver, the kernel has no knowledge of the simulator. This has
the following advantages:
o  Simulator support is much harder to break,
o  It's easier to make use of more feature complete simulators.
   This would only need a change in the simulator specific loader,
o  Running SMP kernels within the simulator. Note that ski at this
   time does not simulate IPIs, so there's no way to start APs.

The platform, firmware and EFI stubs describe the following hardware:
o  4 CPU Itanium,
o  128 MB RAM within the 4GB address space,
o  64 MB RAM above the 4GB address space.

NOTE: The stubs in the skiloader describe a machine that should in
parts be defined by the simulator. Things like processor interrupt
block and AP wakeup vector cannot be choosen at random because they
require interpretation by the simulator. Currently the simulator is
ignorant of this.

This change introduces an unofficial SSC call SSC_SAL_SET_VECTORS
which is ignored by the simulator.

Tested with: ski (version 0.943 for linux)
2003-02-01 22:50:09 +00:00