Commit Graph

1276 Commits

Author SHA1 Message Date
iwasaki
2b0ad603e1 Add help about hint.acpi.0.disable. 2002-08-09 20:07:51 +00:00
obrien
5b1436483f Restore autoloading of ACPI module.
Document the approved ways of disabling it.
Submitted by:	Daniel O'Connor <doconnor@gsoft.com.au>
2002-08-09 06:07:33 +00:00
obrien
5b039ddb78 Don't auto load ACPI -- it causes trouble with my laptop and is TOTALLY
undocumented how to control its loading and queries to freebsd-current
go unanswered.
2002-08-09 05:21:01 +00:00
jake
cf1e8a92ed Print out the strings in vers.o instead of hardcoding the loader banner. 2002-08-04 01:30:26 +00:00
rwatson
f14b4fadd4 Sample loader.conf lines for various MAC modules. 2002-08-01 22:03:19 +00:00
jake
17f7b80f47 Stash various networking paramters in the environment for the kernel
to pick up, ala pxe.
2002-07-31 20:17:06 +00:00
ru
34de99cd26 Drop support for COPY, -c has been the default mode of install(1)
for a long time now.

Approved by:	bde
2002-07-29 09:40:17 +00:00
peter
551a2f2376 Turn on -Wformat 2002-07-20 03:52:37 +00:00
peter
9e34b52468 Fix printf format errors 2002-07-20 03:52:18 +00:00
peter
646415b077 Work around some nasty bugs on the [beta] Itanium2's E1000 UNDI driver.
Bug#1: The GetStatus() function returns radically different pointers that
do not match any packets we transmitted.  I think it might be pointing to
a copy of the packet or something.  Since we do not transmit more than
one packet at a time, just wait for "anything".

Bug#2: The Receive() function takes a pointer and a length.  However, it
either ignores the length or otherwise does bad things and writes outside
of ptr[0] through ptr[len-1].  This is bad and causes massive stack
corruption for us since we are receiving packets into small buffers on
the stack.  Instead, Receive() into a large enough buffer and bcopy the
data to the requested area.
2002-07-20 03:51:53 +00:00
peter
2a111e043d Disable loader ufs support. It causes the loader to crash on the Itanium2
box that I have.  We have no EFI disk drivers yet anyway (maybe that is the
problem).
2002-07-20 03:46:43 +00:00
peter
2d9b6c5de2 Fix printf format errors 2002-07-20 03:44:01 +00:00
nyan
26e0a0e4c0 Remove boot2 temporarily. 2002-07-18 14:50:41 +00:00
benno
25220b020d Major rework of how we copy data into kernel space.
We now talk to the memory and mmu instances directly rather than using the
OpenFirmware "claim" method.
2002-07-18 12:39:02 +00:00
mp
2737067d8e Don't imply that setting the boot_ variables to "NO" will disable them.
MFC after:	3 days
2002-07-16 18:16:01 +00:00
nyan
1092574142 Change include order. 2002-07-16 14:39:52 +00:00
keramida
20b842009b Use present tense in all the verbs, when describing loader's startup.
Most of them are not in a future tense already.
2002-07-15 03:39:34 +00:00
charnier
1a7910b2bc The .Nm bootloader 2002-07-14 15:22:49 +00:00
charnier
2b8d8704f5 The .Nm set of commands 2002-07-14 15:21:28 +00:00
charnier
6b4f8cc539 The .Nm 2002-07-14 15:19:46 +00:00
benno
d6f0032088 Add support for passing metadata. 2002-07-10 12:13:16 +00:00
iwasaki
864900d96b Resolve conflicts arising from the ACPI CA 20020611 import. 2002-07-09 17:54:02 +00:00
jake
3d54465a4b Enable netboot support by default, since it can now coexist with disk and
cdrom support.  This avoids having to distribute separate loaders.
2002-07-07 23:08:22 +00:00
mp
c87de2823f Change help documentation for bootfile and module_path to reflect
the actual code. Both use a ";" (not a ",") to delimit entries.

PR:		39679
Submitted by:	Cyrille Lefevre <cyrille.lefevre@laposte.net>
MFC after:	3 days
2002-07-07 20:40:31 +00:00
jake
333a22867a Make building with ficl work. Unfortunately booting with it doesn't. 2002-07-07 18:23:10 +00:00
jake
56548d6af8 Build ficl on sparc64 fwiw. It doesn't work. 2002-07-07 18:10:38 +00:00
mini
03c10379ce Add missing kernal tunables to loader.conf.
PR:		i386/39085
Submitted by:	David Yeske <dyeske@yahoo.com>
2002-07-03 06:42:43 +00:00
iwasaki
b0dcba92f3 Fix a build problem for the ACPI CA 20020404 import.
Add definition of COMPILER_DEPENDENT_INT64 and also
fix definition of COMPILER_DEPENDENT_UINT64.

Pointed-out by:	Michael Nottebrock <michaelnottebrock@gmx.net>
2002-06-30 23:22:22 +00:00
peter
347e489483 Remove a couple of __P() stragglers. 2002-06-29 02:32:34 +00:00
jake
c7c7165c8b Enable cd9660 support by default. 2002-06-21 22:34:51 +00:00
jake
33cae03b3b Enable UFS1_AND_UFS2 support for sparc64 by default. Booting from ufs1 or
ufs2 filesystems seems to work fine.
2002-06-21 22:33:56 +00:00
phk
3ecb4e6d45 Revert the part of Kirks UFS2 commit which added divdi3.c and moddi3.c
to libi386, this issue was resolved already in a cleaner way.
2002-06-21 11:00:00 +00:00
mckusick
0694ff55c2 This commit adds basic support for the UFS2 filesystem. The UFS2
filesystem expands the inode to 256 bytes to make space for 64-bit
block pointers. It also adds a file-creation time field, an ability
to use jumbo blocks per inode to allow extent like pointer density,
and space for extended attributes (up to twice the filesystem block
size worth of attributes, e.g., on a 16K filesystem, there is space
for 32K of attributes). UFS2 fully supports and runs existing UFS1
filesystems. New filesystems built using newfs can be built in either
UFS1 or UFS2 format using the -O option. In this commit UFS1 is
the default format, so if you want to build UFS2 format filesystems,
you must specify -O 2. This default will be changed to UFS2 when
UFS2 proves itself to be stable. In this commit the boot code for
reading UFS2 filesystems is not compiled (see /sys/boot/common/ufsread.c)
as there is insufficient space in the boot block. Once the size of the
boot block is increased, this code can be defined.

Things to note: the definition of SBSIZE has changed to SBLOCKSIZE.
The header file <ufs/ufs/dinode.h> must be included before
<ufs/ffs/fs.h> so as to get the definitions of ufs2_daddr_t and
ufs_lbn_t.

Still TODO:
Verify that the first level bootstraps work for all the architectures.
Convert the utility ffsinfo to understand UFS2 and test growfs.
Add support for the extended attribute storage. Update soft updates
to ensure integrity of extended attribute storage. Switch the
current extended attribute interfaces to use the extended attribute
storage. Add the extent like functionality (framework is there,
but is currently never used).

Sponsored by: DARPA & NAI Labs.
Reviewed by:	Poul-Henning Kamp <phk@freebsd.org>
2002-06-21 06:18:05 +00:00
peter
78acd0a2c1 Add boot_serial and boot_multicons variables to set RB_SERIAL and
RB_MULTIPLE since this seems to be the easiest way to add these flags
for non-forth loaders etc.
2002-06-20 06:29:42 +00:00
phk
13d1c9d2c2 #include <sys/disklabel.h> to get BBSIZE. 2002-06-11 10:19:59 +00:00
phk
fce2951b7c Make the alpha architecture use the common ufsread().
Submitted by:	ticso
2002-06-11 06:56:31 +00:00
benno
63a4292e13 Uncomment some bits that we now need. 2002-06-07 11:49:56 +00:00
benno
317ce3556d Fix up the DMA buffer allocation call. 2002-06-07 11:49:33 +00:00
phk
5a45b6f37b Add explicit dependency on ufsread.c 2002-06-05 12:30:45 +00:00
phk
db647e6ca8 Remove UFS related #includes, they're read in ufsread.c now. 2002-06-05 12:12:25 +00:00
phk
2e0fa74141 Make sparc64 share ufsread.c with i386.
Sponsored by: DARPA & NAI Labs.
2002-06-05 12:00:53 +00:00
phk
8403ce6b28 Avoid entering IOCCC with a memcpy turned bcopy. 2002-06-05 11:56:12 +00:00
phk
bd8f00a811 Indent this file more like style(9).
Sponsored by: DARPA & NAI Labs.
2002-06-05 11:20:37 +00:00
phk
b25b6e5b9d Preparation for UFS2 commit:
Factor the ufs reading code out of the i386/boot2 loader so it can
be reused by for instance sparc64.

Sponsored by: DARPA and NAI Labs.
2002-06-05 11:10:38 +00:00
schweikh
d4616d4c94 Fix a handful of typos and grammar bogons. No content changes.
Translators can ignore this commit.

MFC after:	2 weeks
2002-05-30 09:24:01 +00:00
schweikh
51cc1303d6 Fix a handful of typos and grammar bogons. No content changes.
Translators can ignore this commit.

MFC after:	2 weeks
2002-05-29 22:57:18 +00:00
jake
c5a56a9739 Add needed include of queue.h. Remove unneeded include of smp.h. 2002-05-29 19:38:49 +00:00
jake
b2900af488 Use a contrived 'tlb_entry' structure for passing the mappings for the
kernel text and data from the loader to the kernel, so that the tte format
is not part of the loader->kernel ABI.
2002-05-29 05:49:59 +00:00
jake
43c4a49998 Sync with i386. The loader was being installed before the beforeinstall
target, which conventiently moved it to loader.old, leaving no loader.
2002-05-28 23:09:59 +00:00
n_hibma
6eba606f98 Cosmetic change (align with other boot blocks):
CONSPEED -> COMSPEED

Approved by:	nyan
2002-05-26 10:11:17 +00:00
gordon
f4b01128bc Add support for reading an additional loader configuration file. By default,
this is called /boot/nextboot.conf. This file is required to have it's first
line be nextboot_enable="YES" for it to be read. Also, this file is
rewritten by the loader to nextboot_enable="NO"<space> after it is read.
This makes it so the file is read exactly once. Finally, the nextboot.conf
is removed shortly after the filesystems are mounted r/w.

Caution should be taken as you can shoot yourself in the foot. This is only
the loader piece. There will be a tool called nextboot(8) that will manage
the nextboot.conf file for you. It is coming shortly.

Reviewed by:	dcs
Approved by:	jake (mentor)
2002-05-24 02:28:58 +00:00
nyan
25e8f06c14 Fixed to conflict labels.
Submitted by:	Kaho Toshikazu <kaho@elam.kais.kyoto-u.ac.jp>
2002-05-21 12:53:48 +00:00
nyan
9def9e7306 MFi386: revision 1.22 2002-05-21 09:44:52 +00:00
jake
a88e3c700d MD ficl files for sparc64. 2002-05-19 23:20:56 +00:00
marcel
f12b9395ff o Remove namespace pollution from param.h:
-  Don't include ia64_cpu.h and cpu.h
   -  Guard definitions by  _NO_NAMESPACE_POLLUTION
   -  Move definition of KERNBASE to vmparam.h

o  Move definitions of IA64_RR_{BASE|MASK} to vmparam.h
o  Move definitions of IA64_PHYS_TO_RR{6|7} to vmparam.h

o  While here, remove some left-over Alpha references.
2002-05-19 04:42:19 +00:00
marcel
66dad28f94 An almost mechanical sweep to replace C++ style comments with C
style comments. This is not an attempt to conform to style(9).
Such has lower priority.
2002-05-19 03:17:22 +00:00
phk
4655debb2a Fix one of the va_arg() with less than int sized type probelms. 2002-05-18 09:12:32 +00:00
trhodes
bf5f8aaae5 More s/file system/filesystem/g 2002-05-16 21:28:32 +00:00
jhay
bf4fcf3218 DEV_BSIZE lives in sys/param.h and not in machine/param.h anymore. 2002-05-15 11:32:53 +00:00
ru
c5de77ef9f Even more BBSIZE related breakage. 2002-05-14 13:30:45 +00:00
nyan
afc2da404f Fixed to build for GCC 3.1 2002-05-14 12:34:03 +00:00
nyan
5add3c8f69 Add -ffreestanding to CFLAGS. 2002-05-14 12:32:59 +00:00
ru
d8299f3aed Align CLEANFILES with revision 1.25 changes. 2002-05-13 16:16:00 +00:00
ru
af5f255d96 Fixed CLEANFILES after bsd.lib.mk sweep. 2002-05-13 15:48:05 +00:00
ru
e68122e850 Removed now unused INTERNALSTATICLIB.
INTERNALLIB now implies NOPIC and NOPROFILE.
Removed gratuitous NOMAN.
2002-05-13 11:09:07 +00:00
ru
e7d136a7c9 Major cleanup of bsd.lib.mk.
Get rid of the INTERNALSTATICLIB knob and just use plain INTERNALLIB.
INTERNALLIB now means to build static library only and don't install
anything.  Added a NOINSTALLLIB knob for libpam/modules.  To not
build any library at all, just do not set LIB.
2002-05-13 10:53:24 +00:00
obrien
d77258c9dd Match the default newfs UFS block size. 2002-05-13 05:09:34 +00:00
bde
e37e584d26 Saved 176 bytes by compiling with -fno-guess-branch-probability. The
default of -fguess-branch-probablility causes time optimizations (?)
like rewriting `if (foo) x++;' as
`if (!foo) goto forth; back: ; ...; forth: x++; goto back;".  This is
pessimizes space especially well on i386's because one short branch
gets converted to 2 long ones.

Removed -fno-align-foo since it is implied by -Os.  Previous commit
messages seem to have overstated the new alignment bugs in gcc.  The
only case that affects boot2 is that -fno-align-functions (or
equivalently -falign-functions=1) actually gives -falign-functions=2.
This is caused by FUNCTION_BOUNDARY being 2 (bytes) instead of 1.
The default case where the optimization level is 1 and no alignment
options are given is more broken.  All alignments are minimal, modulo
the bug in FUNCTION_BOUNDARY.  This is caused by toplev.c setting
defaults too early.

Some hacks in previous commits ar not needed now, but may as well be
kept until gcc is fixed.  The previous on in the Makefile saved 96
bytes of text due to the wrong FUNCTION_BOUNDARY and 32 bytes of data
due to unrelated bloat in the alignment of large objects.  There aren't
even any options to control alignment of data.
2002-05-12 15:45:28 +00:00
obrien
a6606f515d Back out last commit. I expect our bsd.*.mk gods to remove the need for
defining so many extra things in addition to INTERNALLIB.  We don't like
repetitive C code and we shouldn't for make code either.
2002-05-12 13:54:42 +00:00
jake
f54014e7c3 Attempt to not crash and burn on UltraSPARC III machines; the cpuid property
is named differently.
2002-05-11 22:05:22 +00:00
peter
38864d15d9 Save about 60 bytes by #define memcpy __builtin_memcpy and removing
the function we provided.  Restore the Keyboard: yes/no  printf for the
probe diagnostics.  We end up with 40 bytes free.
2002-05-11 21:49:39 +00:00
peter
4da0d55eaa Reconnect boot2. I'm sure I'll regret this though. :-) 2002-05-11 21:41:03 +00:00
peter
73b309fd5f Use a crowbar and duct-tape to make boot2 fit again. This gets it down
to 4 bytes free.  I removed a printf (the Keyboard yes/no) since it is of
marginal value and sed'ed the generated asm output to remove the unwanted
aligns.  There's probably a better way to gain a few extra bytes than
losing the printf.  Shortening strings is probably a better option but this
should get us over the hurdle.
2002-05-11 21:39:59 +00:00
jake
a1b64a4737 Change the disk probing so that it will actually find disks other
than the first one on a controller, and work for secondary
controllers.
Due to the prom not having nodes for each disk, but a catch-all one,
we have to iterate over each device, trying to open it to determine
whether it is actually present.
Since probing this way takese some time (and spews some spurious
warnings), it should maybe be short-circuited if we use the
device we were booted from.
Implement lazy device probing, and correct slice/partiniton
handling in the ofwd_open() code. With this, I can now actually boot
a kernel from disk, and the loader does not create unnecessary
delays.

Submitted by:	tmm
2002-05-11 21:30:46 +00:00
obrien
8d5c888c32 NOPIC, NOPROFILE, NOMAN, and INTERNALSTATICLIB are redundant when using
INTERNALLIB now.
2002-05-11 18:02:33 +00:00
obrien
39cf9a8976 -ffreestanding is the word.
(also resort some CFLAGS such that the more "important" value are first so
they are easier to see)
2002-05-10 09:26:35 +00:00
jhb
a11990e850 - Axe -mpreferred-stack-boundary=2 as -Os turns this on by default.
- Axe -fdata-sections as turning it on or off makes no difference.  If
  it did make a difference it would serve to bloat boot2 even further with
  extra padding.
- Axe -fforce-addr.  This gets us 32 bytes so we are down to only being
  64-bytes over.

We still can't compile this with gcc 3.1.  The problem seems to be that
the -fno-align-foo options don't actually work.  Comparing the new and
old output it turns out that gcc is 4-byte padding all the functions and
labels and what not despite the passed in arguments thus adding the
unfortunate bloat to boot2.
2002-05-10 04:05:42 +00:00
obrien
20e51b70ff We don't need bootinfo any more, and sparc64 doesn't have it anyways. 2002-05-10 01:20:37 +00:00
obrien
5b456f8e1a Don't be redundant. 2002-05-10 01:06:52 +00:00
obrien
2b17593e04 -ffreestanding is the word for /sys. 2002-05-10 00:53:45 +00:00
obrien
d2af9a9d82 Turn off boot2 -- it gained over 96 bytes dieting on the in-tree Gcc 3.1. 2002-05-10 00:52:00 +00:00
obrien
a21d6c6c98 Ficl doesn't build on sparc64. 2002-05-09 20:33:22 +00:00
obrien
9b0b9784b2 Partical style cleanup. 2002-05-09 17:47:25 +00:00
joe
5d6d64b108 Replace /kernel with /boot/kernel/kernel.
PR:		docs/37757
Submitted by:	Hiten Pandya <hiten@uk.FreeBSD.org>
2002-05-09 11:47:42 +00:00
wes
675489844a Rename the file used to specify the nextboot to make it clear that this
is a loader configuration file and can be used for more than just a
kernel name.

Submitted by:	Gordon Tetlow <gordont@gnf.org>
2002-04-26 22:32:15 +00:00
dcs
5e6be20377 A long, long time ago, msmith introduced vfs.root.mountfrom
loader variable, which let users specify the root mount point
the exact way one does after booting the kernel.

Let's take this opportunity to document it...
2002-04-26 20:52:59 +00:00
wes
2db3e04183 Add a -k option to reboot to specify the kernel to boot next time
around.  If the kernel boots successfully, the record of this kernel
is erased, it is intended to be a one-shot option for testing
kernels.

This could be improved by having the loader remove the record of
the next kernel to boot, it is currently removed in /etc/rc immediately
after disks are mounted r/w.

I'd like to MFC this before the 4.6 freeze unless there is violent
objection.

Reviewed by:	Several on IRC
MFC after:	4 days
2002-04-26 07:31:04 +00:00
nyan
9ea9202582 MFi386: revision 1.56 2002-04-25 13:31:27 +00:00
nyan
38459444e0 MFi386: revision 1.8 2002-04-25 13:28:10 +00:00
jake
72293f814d Split file system setup code out into a function called mount.
Implement vsnprintf.  Implement panic in terms of it.
2002-04-24 05:54:10 +00:00
jake
62a9d7c2a6 Add support for loading files other than /boot/loader. Useful if you're
loader is screwed and you want loader.old.
Rewrite the scaled down printf so it actually works right, and add support
for more formats.
2002-04-24 04:27:49 +00:00
jake
86d656d4fb Add an exit function. 2002-04-24 02:50:59 +00:00
jake
e3a00ca111 Add -Wno-unused. 2002-04-24 02:50:36 +00:00
jake
6ca3e0a62f memcpy, memset -> bcopy, bzero. 2002-04-24 02:24:32 +00:00
jake
764280c1c7 Clean up elf loading to not make assumptions about the ordering of sections.
Don't load the symbol table; this is only needed for loading kernels and we
load the loader.
2002-04-24 02:10:35 +00:00
jake
9b46f9391d Remove xfsread. Just call fsread directly. 2002-04-24 01:47:05 +00:00
jake
d7133066f0 Remove a bunch of unused variables, functions and macros. Allocate storage
statically instead of using a faked up malloc.
2002-04-24 01:40:54 +00:00
marcel
615d64e376 Improve self-relocation:
o  We don't expect the PLT relocations to follow the .rela section
   anymore. We still assume that PLT relocations are long formed,
o  Document register usage,
o  Improve ILP,
o  Fix the FPTR relocation by creating unique OPDs per function.
   Comparing functions is valid now,
o  The IPLT relocation naturally handles the addend. Deal with it.
   We ignore the addend for FPTR relocations for now. It's not at
   all clear what it means anyway.

Fix ABI misinterpretation:
o  For Elf_Rela relocations, the addend is explicit and should not
   be loaded from the memory address we're relocating. Only do that
   for Elf_Rel relocations (ie the short form).
o  DIR64LSB is not the same as REL64LSB. DIR64LSB applies to a
   symbol (S+A), whereas REL64LSB applies to the base address (BD+A),
2002-04-21 08:49:47 +00:00
obrien
1c623074d6 o Use our own elf2aout now.
o Generalize a little.
2002-04-21 02:37:55 +00:00
marcel
0fdd58edf6 Allocate sufficient pages to hold the bootinfo block and stop
hardwiring the location.
2002-04-19 06:43:09 +00:00
ru
4da8e556f7 Install files via FILES, there's no reason to compare them before installing. 2002-04-17 16:56:36 +00:00
ru
9000f22529 Really unbreak it this time (clean and install were still broken). 2002-04-17 15:33:40 +00:00
nyan
b993a663e3 MFi386: revision 1.7. 2002-04-15 13:44:00 +00:00
ru
da177b72c4 Unbreak this as well.
At the extra bonus of fixing the contents of the .depend file.

Not really my day.
2002-04-12 15:49:30 +00:00
peter
96b818e57b Bandaid for a buffer overrun in the module searching code. When breaking
up the module_path string, we would walk one past the end of the buffer.
This hurting ia64 originally, but it was probably also happening on i386
occasionally as well.  The effects were usually harmless, it would add
bogus "binary" search directories to the places it actually looked for
files.
2002-04-11 10:00:44 +00:00
peter
369ab8e7f2 Finally fix loader completely for IA64. efifs_stat() wasn't setting
the S_IFREG bit for regular files.  This caused the path search code to
skip it when it finally did find the kernel (after the common/module.c
buffer overrun bug was fixed)
2002-04-11 09:50:11 +00:00
pb
de9530a7e8 Code cleanup, no functional change.
Patch adapted from PR.

PR:		i386/36015
Submitted by:	thomas@cuivre.fr.eu.org
MFC after:	1 week
2002-04-11 09:21:10 +00:00
dcs
4dbf12b92d Upgrade FICL to 3.02. Forgot this one, sorry.
PR:		36308
Submitted by:	dcs
2002-04-09 20:59:34 +00:00
dcs
e0cd7655ee Upgrade to FICL version 3.02. Anything wrong is my fault, everything right is
due Jon Mini.

PR:		36308
Submitted by:	Jon Mini <mini@haikugeek.com>
MFC after:	4 weeks
2002-04-09 17:45:28 +00:00
jake
53ee5eb3d9 Fix another unsigned long used to index the symbol table which should be
Elf_Hashelt.
2002-04-09 00:05:46 +00:00
peter
f0e2362cb4 We must not let install(1) strip loader.efi when installing it, or the
resulting binary will be damaged and no longer work.
2002-04-07 04:27:50 +00:00
peter
6cff997ea1 Set BINDIR 2002-04-07 04:26:42 +00:00
peter
da212191a2 Add loader bootforth infrastructure and install it. 2002-04-07 04:25:45 +00:00
peter
37abfd0f43 Make it a bit closer to the EFI build and tie up some loose ends. 2002-04-06 04:33:53 +00:00
peter
9e58864005 Try and tidy up some very loose ends with paths to various libraries etc. 2002-04-06 04:29:36 +00:00
peter
4e72461ad3 Do not add the ficl/alpha subdir to the ia64 include path. Try ficl/ia64
instead.
2002-04-06 04:16:58 +00:00
peter
a4db7b2f18 Do not assume that ${OBJCOPY} variable exists. It was hidden by the
fact that the 'ia64-make' wrapper explicitly set it.
2002-04-06 04:11:46 +00:00
peter
280bcbf216 Use the correct elf hash table entry type. This matches a similar fix
in the kernel side of things some time ago.  The hash table entries are
always 32 bits wide, even on 64 bit machines.
2002-04-06 04:09:42 +00:00
peter
e6bae32e50 Fix self hosted loader building. When you use a self configured gcc, it
detects and uses the gas section merge support.  As a result, a whole bunch
of new sections arrive, including .rodata.str1.8, which was not included
in our custom ldscript.ia64.  The result was a loader binary that EFI
rejected.

While here, collect the loader shell commands linker set and include it
in the data area rather than having its own section.

/boot/loader.efi was the last holdout for having a 100% self built ia64
system.
2002-04-06 03:39:22 +00:00
peter
978f30ab9c Use a relative path to libstand.. /usr/src/lib/libstand may not exist
or may have the wrong header files.
2002-04-04 06:04:38 +00:00
tmm
b75d5cb2b2 Do not use semi-fixed TLB slots for the 4M kernel pages any more. 2002-04-02 17:10:15 +00:00
tmm
8baa3c1161 1.) Rename locore.s to locore.S (by repocopy), to be able to remove
special-case make rule
2.) Cleanups, remove superfluous expicit rules, add -nostdlib to LDFLAGS,
    remove -X and -g, remove -g from CFLAGS
3.) Add BINDIR
4.) Build install the loader help file, add an empty help.sparc64
5.) Change the default configuration to only support booting from disk
6.) Get libofw.a from a path relative ${.OBJDIR}, not ${.CURDIR}

Submitted by:	jake (1 - 5), obrien (6)
2002-04-02 17:08:37 +00:00
tmm
cc4a29020b Add support for booting from CD-ROM. Make it possible to enable UFS
support using make arguments.
2002-04-01 23:28:35 +00:00
tmm
ec7beb0345 1.) Produce a boot1 disklabel template of the format disklabel(8) expects.
2.) Clean up and change over to using bsd.prog.mk

Submitted by:	jake (2)
2002-04-01 22:57:51 +00:00
marcel
c232568024 Only install the help file if we can find it. Use ${BASE}.help
in both the condition and for the install. We expect to find
the help file in ${.OBJDIR}.
2002-03-31 20:48:13 +00:00
marcel
370dd74956 Pass the address of the bootinfo block to the kernel in register
r8. Keep it at the hardwired address for now. Bump the version.
2002-03-30 23:52:34 +00:00
marcel
923fa916a1 Pass the physical address of the bootinfo block to the kernel in
register r8. We continue to write the bootinfo block at the same
hardwired address, because the kernel still expects it there.
It is expected that future kernels use register r8 to get to the
bootinfo block and don't depend on the hardwired address anymore.

Bump the loader version once again due to the interface change.
2002-03-30 23:00:05 +00:00
nyan
dfd08ac611 MFi386: revision 1.55 2002-03-30 11:18:30 +00:00
marcel
429c45d97f Add a quick and dirty way to determine where we're loaded from. We
only care if it's network or not at this time. If we're loaded from
the network, we set currdev (=loaddev) so that the kernel is loaded
from the network as well. In all other cases we initialize to disk.
This makes netbooting more convenient and can easily be enhanced to
do more elaborate checking.
2002-03-30 07:32:08 +00:00
marcel
6d17934475 The EFI loader has been improved a lot since it was first added.
Most significantly (from an interfacing point of view) is the
support for the FPSWA pointer passing. Even though that was added
4 months ago, it's probably not a bad idea to bump the version
number to reflect this.
2002-03-30 04:54:54 +00:00
marcel
144031afe8 Fix the initialization of the protocol:
o  Query the state field of the protocol mode to determine whether
   we need to start and/or initialize the protocol. When we're
   loaded across the network, the protocol has already been started
   and is already initialized. When no networking has happened yet,
   we have to start and initialize the protocol ourselves.
o  After initialization, we have to set the receive filters. Not
   doing this results in a deaf interface. We set the unicast and
   broadcast filters. Multicast may not be supported. This specific
   change fixes the problem we had that we could not netboot if
   the loader was started from the EFI shell.
o  To help future debugging, add a function that dumps the current
   mode of the interface. It's conditional on EFINET_DEBUG.
o  To help in runtime problems, emit a diagnostic message when we
   could not initialize the protocol properly.
2002-03-30 04:50:52 +00:00
marcel
45542f0502 Don't blindly dereference f->f_devdata as if it's always a pointer to
an efi_devdesc structure. When we're netbooting, f->f_devdata holds
the address of the network socket variable. Dereferencing this caused
some very unpredictable behaviour, including proper functioning.
So, as a sanity check, we first make sure f->f_dev points to our
own devsw. If not, the open will fail before we use f->f_devdata.

This solves the netboot hangs I invariably got whenever I used the
latest toolchain to compile the EFI loader.
2002-03-30 01:36:03 +00:00
marcel
e3944f5ca3 o Make efinet_put a blocking call by waiting for the protocol
layer to signal transmission of the packet. This resolves the
   problem I'm seeing that an immediate call to net->Receive
   after calling net->Transmit returns EFI_DEVICE_ERROR. This
   condition seems to be sufficiently persistent that BOOTP and
   RARP fail.
o  While here, unify all functions to have 'nif' defined. Some
   have it as arguments. The others now have them as locals. We
   now always get the protocol interface by using the 'nif' var.

The current status of netbooting is that even though we now reliably
have BOOTP working (again), opening a file (ie loading a kernel)
across the network causes the loader to hang. I'm working on that now.
2002-03-29 23:10:15 +00:00
marcel
ae9add7e2e Fix the beforeinstall target. We install ${PROG}.help if loader.help
exists, otherwise we install it anyway. I interpret this as a very
high desire to install ${PROG}.help. Alas, ${PROG}.help doesn't exist
at the moment and neither does loader.help, so in practice this just
doesn't work, no matter how you interpret it. The compromise is to
install ${PROG}.help IFF it exists. I realize we lost creativity with
this commit, but style should have been preserved, AFAICT :-)
2002-03-29 22:53:56 +00:00
obrien
2f99a6913d Needs a.out support built into the loader. 2002-03-28 19:09:44 +00:00
marcel
7c45eba132 o Don't include sys/cdefs.h 2002-03-28 07:07:45 +00:00
marcel
7a0eb915f6 o Add -L${DESTDIR}${LIBDIR} on the link line for -lstand.
o  Add -j .dynstr to objcopy. This makes .efi binaries work
   when built with a 3.x based toolchain.
2002-03-28 06:58:46 +00:00
marcel
51302f6073 Duplicate the logic used elsewhere to define LIBSTAND. 2002-03-28 06:52:10 +00:00
obrien
53ee162501 was repocopied to ../boot1 2002-03-28 02:56:05 +00:00
obrien
09b201eadd Apparently either gcc or ld, in their infinite wisdom, want to
put a bunch of crap before the code in .text.  Since the firmware
doesn't seem to honour the a.out entry point, we need to include
a little assmbler file which jumps to where we want to be in C.

Submitted by:	jake
2002-03-28 02:41:52 +00:00
obrien
36c58b1466 Opps, bootblock component is no more. 2002-03-28 01:41:23 +00:00
obrien
08786cadcc sparc64 is an ofw consumer. 2002-03-28 01:37:10 +00:00
obrien
acd1a89fca Not all platforms have and want a.out format support. 2002-03-28 01:28:21 +00:00
obrien
c55dc99f99 Add a Makefile for sparc64 at this level. 2002-03-28 01:01:43 +00:00
pb
d38f414a57 Add option -n to i386 boot2 to disallow boot interruption by keypress.
PR:		i386/36016
Submitted by:	Thomas Quinot <thomas@cuivre.fr.eu.org>
Reviewed by:	rnordier
MFC after:	1 week
2002-03-23 19:40:27 +00:00
alfred
ddadde3bc0 Remove __P. 2002-03-20 08:00:54 +00:00
peter
d88d7f6e76 Add EFI write support to loader 2002-03-19 23:05:33 +00:00
peter
1dd0a3757b Add -ffreestanding to avoid printf/puts/putchar conversions 2002-03-19 10:51:57 +00:00
peter
db6368ecc5 Boot from efifs first. 2002-03-19 10:50:41 +00:00
peter
006f4b486d gcc-3.1 likes to have extra { } around the internal array initializers in
the GUID templates.
2002-03-19 10:50:09 +00:00
sobomax
7069dbebf0 Add splitfs vfs layer into libstand, which allows loading big kernels and
modules split across several physical medias. Following is how it works:

The splitfs code, when asked to open "foo" looks for a file "foo.split"
which is a text file containing a list of filenames and media names, e.g.

	foo.aa "Kernel floppy 1"
	foo.ab "Kernel floppy 2"
	foo.ac "Kernel and modules floppy"

For each file segment, the process is:

- try to open the file
- prompt "Insert the disk labelled <whatever> and press any key..."
- try to open the file
- return error if file could not be located

RE team is free to use this feature in the upcoming 5.0-DP1.

Reviewed by:	msmith, dcs
2002-03-17 12:18:05 +00:00
ru
b2a169d1ab mdoc(7) police: fix a typo and markup. 2002-03-15 15:12:10 +00:00
ru
e6259531fa Implement -m and -p loader(8) "boot" command options in boot2.
(This is more useful for 4.x where boot blocks can still load
kernels, modulo the PR kern/17422.)
2002-03-13 11:03:36 +00:00
ru
964a98fef4 Further document "console" (nullconsole). 2002-03-13 10:55:22 +00:00
sobomax
2670c65946 CG superfluous prototype. 2002-03-10 22:33:04 +00:00
robert
5c87188c39 Change every occurrence of "bootblock" into "boot1" after
the repo-move from "src/sys/boot/sparc64/bootblock".
2002-03-05 16:39:36 +00:00
robert
09db4997bc - Fix seeking for offsets requiring more than 32 bits.
- Add sanity checks to lookup().
 - Implement the 'l' modifier in printf().

Submitted by:	tmm
2002-03-05 11:22:43 +00:00
alfred
f7283497a7 Support for USB fm radio.
Submitted by: David Yeske <dyeske@yahoo.com>
2002-03-04 03:51:21 +00:00
jake
f4fdf0c43d Catch up to change in tte format.
Forgetten by:	jake
Submitted by:	tmm
2002-03-01 06:17:28 +00:00
nyan
6bf93be47a Add -D_KERNEL to CFLAGS for ntohl(). 2002-02-28 10:08:23 +00:00
robert
44da26eeab - Fix indentation and return statements to conform to style(9).
- Use the __FBSDID macro.
 - Fix some warnings.

Submitted by:	obrien (partly)
2002-02-26 10:05:20 +00:00
bde
611282075d Declare time(not3) instead of depending on namespace pollution 3 layers
deep in <stand.h> to eventually include <time.h> to declare the user
version.

This is not quite the right place to declare it, but <stand.h> would
be worse because time() is very MD so it isn't in libstand.

Many places in the boot sources still get the user version using only
1 layer of pollution (#include <sys/time.h>.  Some pollute themselves
directly (#include <time.h>).  But the boot Makefiles are too broken
to enable warnings for redeclarations.
2002-02-25 04:31:25 +00:00
bde
7719e4ef67 Removed mounds of unused variables. 2002-02-25 03:45:09 +00:00
jake
383336949e Keep track of the ttes used to map the kernel and pass them to it as loader
metadata.  Modify tlb handling functions to take a tte, instead of virtual
address, physical address and flags.
2002-02-23 11:06:37 +00:00
jake
0a02bf6d20 Add -ffreestanding to CFLAGS. 2002-02-23 04:36:15 +00:00
jake
23487cd93b Add make variables for fs support and propagate them to CFLAGS. Put
-ffreestanding in CFLAGS.  Remove unnecessary LDFLAGS.
2002-02-23 04:35:28 +00:00
jake
3ce2e37779 Fix test for != 0 that should be > 0. 2002-02-23 04:33:15 +00:00
jake
be3dd376ac Check the return values of index() and don't dereference it if its null;
the path may not have a ':' in it.  The mac address property is called
mac-address for sparc64.  Don't allocate a dma buffer for sparc64 either.
2002-02-23 04:31:30 +00:00
jake
0aeb33ef7f #if 0 more bootinfo stuff. 2002-02-23 04:13:02 +00:00
jake
c0038d4e5d Fix fs support ifdefs. Add tftp support. Add physical and virtual
watchpoint support for debugging (under LOADER_DEBUG).  Claim the
physical and virtual addresses used to map the kernel from the prom;
we map it ourselves behind the scenes though.  Add a reboot command.

Submitted by:	tmm
2002-02-23 04:04:30 +00:00
jake
093e9dbe7b Allocate a frame on our initial stack so that it doesn't run off into
random memory.  Disable interrupts while loading the tlb.

Submitted by:	tmm
2002-02-23 03:38:18 +00:00
jake
8830a12657 Add OF_claim_virt() and OF_release_phys().
Submitted by:	tmm
2002-02-23 03:36:04 +00:00
jake
a6b93b6c93 Include <machine/metadata.h>. 2002-02-23 03:33:39 +00:00
davidc
25e1265c61 Document the hw.physmem kernel environment variable.
Reviewed by:	alfred
2002-02-21 05:15:52 +00:00
robert
30b87680c1 - Remove unneeded variable.
- Remove change for my local configuration that slipped in with
   the last commit; I am having problems booting when multiple SCSI
   disks are attached, so I will change this part as soon as I find
   a solution, anyway.
2002-02-15 13:22:09 +00:00
robert
886e148e1c This file is now unneeded. 2002-02-15 13:11:00 +00:00
robert
f27a2d2271 - Do not include a NetBSD header as it is not needed anymore.
- Remove two constants that were needed in conjuction with the
   NetBSD disklabel header.  Use the FreeBSD equivalents.
   To boot from NetBSD/sparc64 partitions, define LABELOFFSET to
   be 128.
 - Do not use the complete open firmware path to filter out cdrom drives.
   No path containing "cdrom" is detected as a disk now.
 - Simplify some code.
2002-02-15 13:09:34 +00:00
robert
7a41491a80 Add the FreeBSD/sparc64 bootblock and its make file. 2002-02-15 12:49:20 +00:00
nyan
57a4adcaa8 Expand COMBRD(x) macro. 2002-02-01 14:48:44 +00:00
sobomax
a999636afc CG hard sentence breaks.
Submitted by:	ru
2002-01-23 09:35:55 +00:00
sobomax
4af7566456 Allow dump device be configured as early as possible using loader(8) tunable.
This allows obtaining crash dumps from the panics occured during late stages
of kernel initialisation before system enters into single-user mode.

MFC after:	2 weeks
2002-01-21 01:16:11 +00:00
iedowse
0faf29b407 Cut more than 500 bytes off the size of the alpha boot1 by adding
a simple version of bcopy() so we avoid picking up the overly-complex
implementation in libc (via libstand). This is not necessary on
-current, but RELENG_4 has apparently just exceeded the 15-sector
limit for boot1.

Reviewed by:	wilko
2002-01-18 21:54:02 +00:00
nyan
4ddf29c7e8 Added kgzldr for pc98.
crt.s is based on btx.s.
2002-01-18 09:00:38 +00:00
iedowse
e77c617f9a Oops, the previous revision (1.35) broke booting from floppies
because the buffers we use could end up spanning a 64k boundary.
Unfortunately it causes too much bloat (228 -> 72 bytes free) to
just reinstate the old malloc() function.

Instead, define a structure that contains all 4 buffers which must
not cross 64k boundaries. We allocate a 64k-aligned instance in
main() using the magic that was in the old boot2 malloc() function.
This brings the free space down to 168 bytes, but that is still
better than it was before revision 1.35 (136 bytes).

Reported by:	Mike Brancato <funnyguy@digitalsmackdown.net>
Pointy-hat to:	iedowse
2002-01-17 22:39:19 +00:00
iedowse
2b6f384551 Make the i386 boot2 fully blocksize-agnostic, as has already been
done with boot1 on the alpha. We use 4k buffers regardless of the
actual filesystem block size.

Remove the simple malloc() implementation, as it is no longer used.
2002-01-14 19:39:19 +00:00
iedowse
b12e182c84 Make the alpha boot1 work on filesystems that have a block size
larger than 8k. We now use 4k buffers regardless of the filesystem
block size, so there is no longer a static limit.

Simply increasing the buffer size from 8k to 16k as done on the
i386 doesn't work on the alpha, probably because it causes us
to overshoot boot1's 48k runtime memory limit.

Tested by:	naddy
2002-01-11 16:14:34 +00:00
jhb
2ac0b9d59e Catch the netboot version up to the main loader. This is pretty bogus.
All the alpha loaders should use the same version file.  Also, we might
should merge the various loaders (cdboot, loader, netboot) into one loader
that can boot off of disks, CD's, and network devices.  The version bump
is needed so the FICL scripts won't bomb out thinking that the netboot
binary is too old.
2002-01-11 00:09:59 +00:00
jhb
37d318ebf1 Unrevert revision 1.12. Revision 1.14 backed this out saying it was
backing out the 1024 sector boot0, but revision 1.12 had nothing to do with
that.  Instead, it documented various compile time options for boot0 and
allowed them to be overridden via make.conf or options on the make
command line.
2002-01-10 21:40:33 +00:00
iedowse
cb1c8a49e8 Increase BSIZEMAX from 8k to 16k, so that we can reliably boot from
filesystems with 16k blocks.
2002-01-09 15:46:17 +00:00
jhb
c4cd5823ed Don't turn on RB_CDROM if the rootdev is a BIOS cd device for now as this
breaks when cdboot is used with an MFS root.
2002-01-04 07:59:27 +00:00
robert
5955fa5551 Avoid having the text and data sections merged into one program
header table entry by removing the -N flag from the LDFLAGS.
2001-12-28 22:12:38 +00:00
jim
a574e77d06 Add missing snd_ich_load entry.
Noticed by:	will
MFC after:	2 days
2001-12-20 09:14:45 +00:00
ru
a4577e8a1f mdoc(7) police: remove hard sentence break which I didn't
submit to Jonathan Mini.
2001-12-14 09:06:11 +00:00
nyan
f96149feea MFi386: revision 1.35 (Add support for writing to BIOS disks) 2001-12-12 13:47:04 +00:00
jhb
270414c350 - Add 'fwrite' and 'fseek' words for writing to and seeking on files.
- Change the 'fopen' keyword to accept a mode parameter.  Note that this
  will break existing 4th scripts that use fopen.  Thus, the loader
  version has been bumped and loader.4th has been changed to check for a
  sufficient version on i386 and alpha.  Be sure that you either do a full
  world build or install or full build and install of sys/boot after this
  since loader.old won't work with the new 4th files and vice versa.

PR:		kern/32389
Submitted by:	Jonathan Mini <mini@haikugeek.com>
Sponsored by:	ClickArray, Inc.
2001-12-11 00:49:34 +00:00
jhb
9e31ff2e6e Add support for writing blocks to the loader's disk cache.
PR:		kern/32389
Submitted by:	Jonathan Mini <mini@haikugeek.com>
Sponsored by:	ClickArray, Inc.
2001-12-11 00:10:00 +00:00
jhb
78fc5be9e8 Add support for writing to BIOS disks.
PR:		kern/32389
Submitted by:	Jonathan Mini <mini@haikugeek.com>
Sponsored by:	ClickArray, Inc.
2001-12-11 00:08:10 +00:00
guido
a0b913284f Add new boot flag to i386 boot: -p.
This flag adds a pausing utility. When ran with -p, during the kernel
probing phase, the kernel will pause after each line of output.
This pausing can be ended with the '.' key, and is automatically
suspended when entering ddb.

This flag comes in handy at systems without a serial port that either hang
during booting or reser.
Reviewed by:	(partly by jlemon)
MFC after:	1 week
2001-12-10 20:02:22 +00:00
obrien
9f689db796 Update to C99, s/__FUNCTION__/__func__/,
also don't use ANSI string concatenation.
2001-12-10 08:09:49 +00:00
rwatson
f8a272a3c2 o Expand list of tunables documented in loader.8 to include kern.maxusers,
since other related tunables were also documented here.  Add a cross
  reference to tuning(7) for information on setting this value
  appropriately.
2001-12-07 18:05:24 +00:00