Commit Graph

1042 Commits

Author SHA1 Message Date
wes
210f257e4e 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
c6603b03d3 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
9bf40bea60 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
2d4219d383 MFi386: revision 1.56 2002-04-25 13:31:27 +00:00
nyan
f51b511837 MFi386: revision 1.8 2002-04-25 13:28:10 +00:00
jake
9a5eae2a45 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
11cf71a416 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
40d13085f4 Add an exit function. 2002-04-24 02:50:59 +00:00
jake
628ea2a252 Add -Wno-unused. 2002-04-24 02:50:36 +00:00
jake
3473cf4ec1 memcpy, memset -> bcopy, bzero. 2002-04-24 02:24:32 +00:00
jake
ab92bb92b7 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
205c7831cd Remove xfsread. Just call fsread directly. 2002-04-24 01:47:05 +00:00
jake
1aa7da0fd6 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
1f2cc7b30c 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
76b7ec65d9 o Use our own elf2aout now.
o Generalize a little.
2002-04-21 02:37:55 +00:00
marcel
b37c8f0b41 Allocate sufficient pages to hold the bootinfo block and stop
hardwiring the location.
2002-04-19 06:43:09 +00:00
ru
217b7e94cc Install files via FILES, there's no reason to compare them before installing. 2002-04-17 16:56:36 +00:00
ru
0b397f2023 Really unbreak it this time (clean and install were still broken). 2002-04-17 15:33:40 +00:00
nyan
c911a2cbdc MFi386: revision 1.7. 2002-04-15 13:44:00 +00:00
ru
5f45c246ce 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
a2bdc11625 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
63071c12c8 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
bfa5faab11 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
2ead48154d Upgrade FICL to 3.02. Forgot this one, sorry.
PR:		36308
Submitted by:	dcs
2002-04-09 20:59:34 +00:00
dcs
eeb34873c0 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
297661679e Fix another unsigned long used to index the symbol table which should be
Elf_Hashelt.
2002-04-09 00:05:46 +00:00
peter
d76ff96eff 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
1a2f6bfa9f Set BINDIR 2002-04-07 04:26:42 +00:00
peter
a0a4c849a0 Add loader bootforth infrastructure and install it. 2002-04-07 04:25:45 +00:00
peter
cddc57f171 Make it a bit closer to the EFI build and tie up some loose ends. 2002-04-06 04:33:53 +00:00
peter
8eb1fab9da Try and tidy up some very loose ends with paths to various libraries etc. 2002-04-06 04:29:36 +00:00
peter
bc98e7be03 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
b2d9042186 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
66482b75cf 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
4e70269a83 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
b486ed03d8 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
eb20435a69 Do not use semi-fixed TLB slots for the 4M kernel pages any more. 2002-04-02 17:10:15 +00:00
tmm
2025cfe33a 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
a683bcc922 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
7151c10d96 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
2830f94478 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
688cf86e24 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
83aa1632bb 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
cbfb12da8c MFi386: revision 1.55 2002-03-30 11:18:30 +00:00
marcel
dd7885b88d 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
64a996484d 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
bafbd25360 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
08a102c3c4 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
fa19ce8844 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
e27cdad86b 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