Commit Graph

61 Commits

Author SHA1 Message Date
Andrew Turner
63d071445e Add support to the efi boot1 and loader for 32-bit ARM. This will be used
by the future qemu virt support.

Differential Revision:	https://reviews.freebsd.org/D2238
Reviewed by:	emaste
2015-04-06 15:50:20 +00:00
Rui Paulo
bb09480677 SMBIOS support for EFI.
MFC after:	1 week
2015-04-06 06:55:47 +00:00
Andrew Turner
60ac534440 Add FDT support to loader.efi. This will be used on arm and arm64.
Differential Revision:	https://reviews.freebsd.org/D2219
2015-04-05 18:37:39 +00:00
Rui Paulo
a620035cf4 loader/EFI: improve the help of the 'mode' command. 2015-04-04 04:30:37 +00:00
Andrew Turner
36725fc471 Only enable the efi framebuffer on x86 for now 2015-04-03 12:54:38 +00:00
Andrew Turner
5da820b611 Only include machine/specialreg.h on x86 2015-04-03 12:30:18 +00:00
Andrew Turner
cf5d3022f9 Only enable comconsole and nullconsole on x86. 2015-04-03 12:08:08 +00:00
Ed Maste
db117b94d3 Move i386/efi files to new home in efi/loader/arch/i386
This was not (and still is not) connected to the build, but the EFI
loader is in the process of being built for other than amd64 so these
files ought to live in their eventual MD location.
2015-04-02 18:57:35 +00:00
Andrew Turner
9e62ed8ff9 Move the efi loaders to be under sys/boot/efi. This will help us add
support for booting arm and arm64 from UEFI.

Differential Revision:	https://reviews.freebsd.org/D2164
Reviewed by:	emaste, imp (previous version)
Sponsored by:	The FreeBSD Foundation
2015-04-01 08:30:40 +00:00
Marcel Moolenaar
21321a3432 This file was repocopied to src/sys/boot/ia64/efi. 2004-11-23 18:55:24 +00:00
Marcel Moolenaar
2ba0042660 Remove struct ia64_itir and use a plain old uint64_t instead. 2004-11-21 21:40:08 +00:00
Marcel Moolenaar
f3a21ad7c6 Redefine a PTE as a 64-bit integral type instead of a struct of
bit-fields. Unify the PTE defines accordingly and update all
uses.
2004-09-23 18:37:36 +00:00
Marcel Moolenaar
0797d69c78 Catch up with change to <machine/pte.h>. 2004-08-10 02:08:57 +00:00
Marcel Moolenaar
8af8df6452 Fix the creation of EFI images that got broken by the import of
binutils 2.15. The linker now creates a .rela.dyn section for
dynamic relocations, while our script created a .rela section.
Likewise, we copied the .rela section to the EFI image, but not
the .rela.dyn section. The fix is to rename .rela to .rela.dyn
in the linker script so that all relocations end up in the same
section again. This we copy into the EFI image.
2004-07-20 07:01:02 +00:00
Marcel Moolenaar
317872f26c Don't create a mapfile during link. It's not needed for the build. 2004-02-13 04:45:41 +00:00
Ruslan Ermilov
5c8f32a869 Tidy up makefiles.
Tested by:	marcel
2004-02-12 08:10:34 +00:00
Marcel Moolenaar
e4ec6fb518 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
David E. O'Brien
8368cf8f75 Use __FBSDID rather than rcsid[]. 2003-04-03 21:36:33 +00:00
Marcel Moolenaar
59c9bb54ee 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
David E. O'Brien
a8896ec82d Consistently use NOFORTH to control the usage of ficl. 2003-02-26 06:18:52 +00:00
Jake Burkholder
7c6c018c0c Renamed the loader's zipfs to gzipfs. zipfs.c was repo-copied to gzipfs.c. 2002-12-19 19:34:59 +00:00
Marcel Moolenaar
414c998fba Add command `hcdp'. This command dumps the DIG64 HCDP table if one
exists.
2002-12-18 08:13:03 +00:00
Marcel Moolenaar
6257165c74 Pass the HCDP table address to the kernel. If no such table exists,
NULL is passed. The address of the HCDP table can be found by
iterating over the configuration tables in the EFI system table.
To avoid more duplication, a function can be called with the GUID
of interest. The function will do the scanning. Use the function
in all places where we iterate over the configuration tables in
an attempt to find a specific one.

Bump the loader version number as the result of this.

Approved by: re (blanket)
2002-12-10 20:11:20 +00:00
Marcel Moolenaar
155dbcacfb Change the startup code to fix a memory leak and to allow us to
accept load options (=command line options).

The call graph changes from *entry*->efi_main->efi_init, where
efi_main is the EFI equivalent of main to *entry*->efi_main->main,
where main is what you'd expect. efi_main now is what efi_init was.
The prototype of main follows that of C. The first argument is argc
and the second is argv. There is no third argument.
Allocation of heap pages is now handled by the EFI library and it
now deallocates the pages when main() returns or when exit() is
called. This allows us to safely return to the boot manager (or
EFI shell) without leaks. EFI applications are responsible to free
all memory themselves.

Handling of the load options is a bit tricky. There are either no
load options, load options in ASCII or load options in Unicode.
The EFI library will translate the ASCII options to Unicode options
as to simplify user code. Since the load options are passed as a
single string (if present) and main() accepts argc and argv, the
startup code also has to split the string into words and build the
argv vector. Here the trickiness starts. When the loader is started
from the EFI shell, argv[0] will automaticly load the program name.
In all other cases (ie through the boot manager), this is not the
case. Unfortunately, there's no trivial way to check. Hence, a
set of conditions is checked to determine if we need to fill in
argv[0] ourselves or not. This checking is not perfect. There are
known cases where it fails to do the right thing. The logic works
for most expected cases, though. This includes the case where no
options are given.

Approved by: re (blanket)
2002-12-10 06:22:25 +00:00
Marcel Moolenaar
4ee2f7cb16 o Make all GUID variables global to maximize reuse.
o  Recognize the HCDP configuration table.
o  Dump the GUID of tables we don't recognize.

Approved by: re (carte blanche)
2002-12-10 04:55:25 +00:00
Marcel Moolenaar
ea16741fc0 The boot manager sets the watchdog timer to 5 minutes before invoking
a boot option. When the timer expires the machine is rebooted.
Disable the watchdog timer for 2 reasons:
o  We're an interactive program. We cannot guarantee that we've
   booted the kernel in the time available to us. There have been
   situations where netbooting the right kernel took 2 tries and
   more time than given. Not to speak of the normal behaviour to
   have the loader sitting at the prompt while the user is off
   doing other things (such as figuring out what to type next ;-)
o  We may not boot a kernel at all. We may exit as the result of
   the user typing quit (assuming it took less than 5 minutes to
   type it :-). It is documented that loaders should have disabled
   the watchdog timer if they return to the boot manager. Not doing
   so would cause a reboot while in the boot manager. This appears
   to be harmless, besides of course the actual reboot.

Approved by: re (weisse karte)
2002-12-08 20:04:00 +00:00
Marcel Moolenaar
aef78848af Remove a left-over virtual mapping of uncached I/O port space.
Previous kernels unwantingly depended on this mapping, but as
of version 1.123 of src/sys/ia64/ia64/machdep.c this dependency
has been removed. Consequently, one has to update the kernel
before updating the loader. The documented/recommended upgrade
will suffice in this case.

Due to a visible (from the kernels point of view) change in
behaviour, bump the loader version number from 0.3 to 1.0.

Approved by: re (carte blanc)
2002-11-28 03:25:51 +00:00
Marcel Moolenaar
689f36d7f9 MFp4:
o  Show the contents of the AP wakeup descriptor when dumping SAL
   information.
o  Increase S/N ratio when listing the itr and dtr. Only show valid
   mappings and give the total number of TRs.

Approved by: re (blanket)
2002-11-24 19:45:05 +00:00
Peter Wemm
296c758b66 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 Wemm
df0e0b8823 Fix printf format errors 2002-07-20 03:44:01 +00:00
David E. O'Brien
d1bdfb40fd -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
Peter Wemm
c21ab46789 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 Wemm
1e7e1ea54d Set BINDIR 2002-04-07 04:26:42 +00:00
Peter Wemm
f3693129ce Add loader bootforth infrastructure and install it. 2002-04-07 04:25:45 +00:00
Peter Wemm
e91ab65ef6 Try and tidy up some very loose ends with paths to various libraries etc. 2002-04-06 04:29:36 +00:00
Peter Wemm
5459842c5e 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 Wemm
a6d81d83a2 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 Wemm
65a0653eb7 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
Marcel Moolenaar
16ed9fd6bb 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 Moolenaar
c459265de7 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
Marcel Moolenaar
a918e110c4 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 Moolenaar
4e357dbc58 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 Moolenaar
95c0f344ee 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
Peter Wemm
436122c232 Boot from efifs first. 2002-03-19 10:50:41 +00:00
Marcel Moolenaar
8daca20f62 s/alpha/${MACHINE_ARCH}/g 2001-10-08 01:41:45 +00:00
Doug Rabson
5f802bfc9f Calculate the valid flag for ITRs and DTRs correctly. Also fix a couple
of minor problems and remove some debugging code.
2001-09-25 19:44:19 +00:00
Doug Rabson
9164a3125a Add commands to dump the itrs and dtrs. 2001-09-24 19:39:34 +00:00
Doug Rabson
0f34719cf5 Add commands to dump the configuration tables and the SAL System Table. 2001-09-23 10:28:01 +00:00
Doug Rabson
e565888bc5 Add EFI network support. 2001-09-22 19:12:30 +00:00
Doug Rabson
28d7d2f0a0 Plug in ELF backend. 2001-09-14 08:28:17 +00:00