History log of /freebsd-10-stable/sys/boot/ia64/efi/main.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 295538 11-Feb-2016 smh

Fix ia64 build failures in EFI platform

The MFC of the recent EFI work to stable/10 caused build breakage
under ia64.

It was not apparent that there was EFI code outside the EFI tree as
this is not the case in HEAD, however in stable/10 there is for ia64.

This change does the following:
* Re-enables libefi for ia64 under gcc.
* Adds the ignore for unsupported pragma's when building libefi for ia64.
* Adds the missing parameter to efi_handle_lookup in the ia64 loader.

This is a direct commit as ia64 is no longer supported after 10.x

Approved by: re (marius)
Sponsored by: Multiplay


# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 222799 06-Jun-2011 marcel

o Bump the EFI loader version to 3.1.
o Add the about, pbvm and reboot commands.
o Trim the banner (suppress maker and date).


# 220313 03-Apr-2011 marcel

Use the new arch_loadaddr I/F to align ELF objects to PBVM page
boundaries. For good measure, align all other objects to cache
lines boundaries.

Use the new arch_loadseg I/F to keep track of kernel text and
data so that we can wire as much of it as is possible. It is
the responsibility of the kernel to link critical (read IVT
related) code and data at the front of the respective segment
so that it's covered by TRs before the kernel has a chance to
add more translations.

Use a better way of determining whether we're loading a legacy
kernel or not. We can't check for the presence of the PBVM page
table, because we may have unloaded that kernel and loaded an
older (legacy) kernel after that. Simply use the latest load
address for it.


# 202552 18-Jan-2010 marcel

Add command-line option -dev to set the default value of the currdev
variable. This is to be used by the EFI boot manager.

While here, re-factor the code a little bit and bump the version to
2.1.


# 201966 09-Jan-2010 marcel

Remove debugging printf(). There's no need to print the image
base address anymore.


# 164010 05-Nov-2006 marcel

Major rework of the ia64 loaders. The two primary objectives are:
1. Make libefi portable by removing ia64 specific code and build
it on i386 and amd64 by default to prevent regressions. These
changes include fixes and improvements over previous code to
establish or improve APIs where none existed or when the amount
of kluging was unacceptably high.
2. Increase the amount of sharing between the efi and ski loaders
to improve maintainability of the loaders and simplify making
changes to the loader-kernel handshaking in the future.

The version of the efi and ski loaders are now both changed to 1.2
as user visible improvements and changes have been made.


# 163897 01-Nov-2006 marcel

Extend struct devdesc with a unit field, called d_unit. Promote the
device (kind) specific unit field to the common field. This change
allows a future version of libefi to work without requiring anything
more than what is defined in struct devdesc and as such makes it
possible to compile said version of libefi for different platforms
without requiring that those platforms have identical derivatives
of struct devdesc.


# 163893 01-Nov-2006 marcel

Don't unconditionally compile-in the bcache code. It's only used on
i386/amd64 and pc98. Remove useless calls to bcache_init() from the
ia64 and sparc64 loaders, as well as from the OFW common code.


# 137999 23-Nov-2004 marcel

This file was repocopied from src/sys/boot/efi/loader.


# 137978 21-Nov-2004 marcel

Remove struct ia64_itir and use a plain old uint64_t instead.


# 135630 23-Sep-2004 marcel

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.


# 133420 10-Aug-2004 marcel

Catch up with change to <machine/pte.h>.


# 118346 02-Aug-2003 marcel

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


# 113038 03-Apr-2003 obrien

Use __FBSDID rather than rcsid[].


# 111693 01-Mar-2003 marcel

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.


# 108025 18-Dec-2002 marcel

Add command `hcdp'. This command dumps the DIG64 HCDP table if one
exists.


# 107733 10-Dec-2002 marcel

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)


# 107723 10-Dec-2002 marcel

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)


# 107722 10-Dec-2002 marcel

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)


# 107683 08-Dec-2002 marcel

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)


# 107203 24-Nov-2002 marcel

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)


# 100387 20-Jul-2002 peter

Fix printf format errors


# 93411 30-Mar-2002 marcel

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.


# 83939 25-Sep-2001 dfr

Calculate the valid flag for ITRs and DTRs correctly. Also fix a couple
of minor problems and remove some debugging code.


# 83904 24-Sep-2001 dfr

Add commands to dump the itrs and dtrs.


# 83857 23-Sep-2001 dfr

Add commands to dump the configuration tables and the SAL System Table.


# 83829 22-Sep-2001 dfr

Add EFI network support.


# 83216 08-Sep-2001 dfr

Add missing entry to memory type name table and adjust field widths.


# 83215 08-Sep-2001 dfr

Add a command 'memmap' to print out the EFI memory map.


# 83192 07-Sep-2001 dfr

Set currdev and loaddev variables.


# 78332 16-Jun-2001 obrien

style(9) and remove a left over Alpha comment


# 77943 09-Jun-2001 dfr

First approximation of an ia64 EFI loader. Not functional.