summaryrefslogtreecommitdiffstats
path: root/sys/boot/efi/libefi
Commit message (Collapse)AuthorAgeFilesLines
* Start each of the license/copyright comments with /*-imp2005-01-052-2/+2
|
* Remove the last vestiges of the userconfig option. None of this actuallyscottl2004-12-011-4/+0
| | | | did anything, so this commit should be considered a NO-OP.
* o Introduce efimd_va2pa() to translate addresses in efi_copy{in|out}()marcel2004-11-282-32/+19
| | | | | and efi_readin(). This removes MD code from copy.c. o Don't unconditionally add pal.S to SRCS. It's specific to ia64.
* This file was repocopied to src/sys/boot/ia64/efi.marcel2004-11-232-387/+0
|
* For variables that are only checked with defined(), don't provideru2004-10-241-1/+1
| | | | any fake value.
* Redefine a PTE as a 64-bit integral type instead of a struct ofmarcel2004-09-231-13/+5
| | | | | bit-fields. Unify the PTE defines accordingly and update all uses.
* o Support the REL32LSB relocation. It's in the ELF file from whichmarcel2004-07-201-9/+18
| | | | | | | | | we construct the EFI image. It doesn't seem to actually end up in the EFI image, AFAICT. o Replace .quad, .long and .short with data8, data4 and data2 resp. The former are gnuisms. o Redefine _start_plabel as a data16 with @iplt(_start) as its value. This is the preferred way to create user PLT entries.
* Fix the creation of EFI images that got broken by the import ofmarcel2004-07-201-1/+1
| | | | | | | | | 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.
* Remove advertising clause from University of California Regent's license,imp2004-04-051-4/+0
| | | | | | per letter dated July 22, 1999. Approved by: core
* Reset the text attributes when initializing the console. The EFImarcel2004-03-091-0/+1
| | | | | loader typically doesn't do this so that we end up booting the with whatever the EFI loader has set it to last.
* o Don't build with -fpic. It's not needed and inconsistent with howmarcel2004-02-131-5/+0
| | | | | other constributions are compiled. o Remove powerpc specific additions to CFLAGS.
* Tidy up makefiles.ru2004-02-121-11/+4
| | | | Tested by: marcel
* Convert to __FBSDID.obrien2004-01-045-10/+15
|
* Don't hardcode unit 0 for the current device if we're loaded from anmarcel2003-08-022-1/+15
| | | | | | | | | | | | 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
* Have the linker script look more like the default linker scriptmarcel2003-07-171-46/+39
| | | | | on ia64. This fixes the breakage caused by the gcc upgrade that resulted in a broken executable.
* sys/ia64/ia64/pal.s has been repocopied to pal.S.ru2003-07-021-1/+1
| | | | | Approved by: marcel Repocopied by: joe
* Enable the i386 loader to load and run an amd64 kernel. If this putspeter2003-05-011-3/+3
| | | | | | | | | | | | | | | 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.
* Use __FBSDID rather than rcsid[].obrien2003-04-036-24/+12
|
* Paranoia: Don't use the length of the option string alone tomarcel2003-03-011-1/+1
| | | | | determine whether we have command line options. We expect a valid string pointer as well.
* Increase the block size for reading and writing from 8KB to 1MB andmarcel2003-02-261-4/+7
| | | | | | | 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>
* Simplify page alignment.marcel2003-02-201-11/+4
|
* Pass the HCDP table address to the kernel. If no such table exists,marcel2002-12-102-0/+17
| | | | | | | | | | | | | 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)
* The exit() function has been moved to libefi.c to better deal withmarcel2002-12-101-39/+0
| | | | | | | cleaning up after ourselves. Approved by: re (blankoscheck) German corrections: Alexander (both :-)
* Change the startup code to fix a memory leak and to allow us tomarcel2002-12-102-2/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* Remove _putchar, _puts and _puthex. These functions are unused.marcel2002-12-101-101/+2
| | | | Approved by: re (blanket)
* In efi_cons_poll we check if a key is present (pending) by checkingmarcel2002-12-081-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | the signaled state of the apropriate event. As a side-effect of checking the event, it's signaled state is cleared if it was set. In efi_cons_getchar we used to wait for the apropriate event to be signaled before reading a character. This however does not work if we poll before reading the characteri, such as during autoboot. On a more compliant EFI implementation this resulted in the behaviour that hitting a key during autoboot would stop the countdown, but would then wait for a new character to arrive instead of reading the already pending key that stopped the countdown. The correct behaviour for efi_cons_getchar is to try to read a key and if none is pending, to wait for the apropriate event to signal the arrival of a new key. Note that with the previous behaviour, the second key would determine how the autoboot was interrupted. This would indicate that the first key got lost. This indicates that EFI does not necessarily maintain a queue of pending keys. FWIW... Approved by: re (carte blanche) French corrected by: various people :-)
* Remove a left-over virtual mapping of uncached I/O port space.marcel2002-11-281-17/+0
| | | | | | | | | | | | | 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)
* o Fix a size calculation based on a 8KB page, while under EFImarcel2002-10-243-17/+36
| | | | | | | | | | | | pages are 4KB. o As a second order fix, don't assume we have enough space after the bootinfo block left in a page to hold the memory map. o A third order fix as that we removed the assumption that a bootinfo block fits in a single 8KB page. PR: ia64/39415 submitted by: Espen Skoglund <esk@ira.uka.de>
* Fix printf format errorspeter2002-07-201-3/+3
|
* Work around some nasty bugs on the [beta] Itanium2's E1000 UNDI driver.peter2002-07-201-5/+20
| | | | | | | | | | | | | | 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.
* Add boot_serial and boot_multicons variables to set RB_SERIAL andpeter2002-06-201-0/+2
| | | | | RB_MULTIPLE since this seems to be the easiest way to add these flags for non-forth loaders etc.
* o Remove namespace pollution from param.h:marcel2002-05-192-0/+3
| | | | | | | | | | | - 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.
* Removed now unused INTERNALSTATICLIB.ru2002-05-131-3/+0
| | | | | INTERNALLIB now implies NOPIC and NOPROFILE. Removed gratuitous NOMAN.
* Back out last commit. I expect our bsd.*.mk gods to remove the need forobrien2002-05-121-0/+3
| | | | | defining so many extra things in addition to INTERNALLIB. We don't like repetitive C code and we shouldn't for make code either.
* NOPIC, NOPROFILE, NOMAN, and INTERNALSTATICLIB are redundant when usingobrien2002-05-111-3/+0
| | | | INTERNALLIB now.
* -ffreestanding is the word.obrien2002-05-101-1/+1
| | | | | (also resort some CFLAGS such that the more "important" value are first so they are easier to see)
* Improve self-relocation:marcel2002-04-211-105/+135
| | | | | | | | | | | | | | | | | | | 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),
* Allocate sufficient pages to hold the bootinfo block and stopmarcel2002-04-191-7/+10
| | | | hardwiring the location.
* Finally fix loader completely for IA64. efifs_stat() wasn't settingpeter2002-04-111-0/+2
| | | | | | 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)
* Fix self hosted loader building. When you use a self configured gcc, itpeter2002-04-061-3/+4
| | | | | | | | | | | | | 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.
* Pass the physical address of the bootinfo block to the kernel inmarcel2002-03-301-1/+1
| | | | | | | | | 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.
* Fix the initialization of the protocol:marcel2002-03-301-2/+68
| | | | | | | | | | | | | | | | | 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.
* Don't blindly dereference f->f_devdata as if it's always a pointer tomarcel2002-03-301-1/+6
| | | | | | | | | | | 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.
* o Make efinet_put a blocking call by waiting for the protocolmarcel2002-03-291-12/+22
| | | | | | | | | | | | | | | 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.
* o Don't include sys/cdefs.hmarcel2002-03-281-1/+0
|
* Add EFI write support to loaderpeter2002-03-191-2/+30
|
* Lookup the EFI_FPSWA driver and pass the interface pointer through to thepeter2001-11-194-0/+67
| | | | | kernel before we call ExitBootServices(). I've typed the definitions in efifpswa.h from the Intel FPSWA manual (urk).
* Remove bootinfo.bi_kernel. It isn't used by the kernel. struct bootinfopeter2001-11-191-6/+0
| | | | | should go away on ia64, we should be loader metadata based since that is the only way we can boot (loader, skiload).
* Set RB_MULTIPLE (multiple console support) if the kernel is bootedmarcel2001-10-291-0/+3
| | | | with the -D flag.
* Call ExitBootServices and disable interrupts before we start hackingdfr2001-10-251-11/+12
| | | | the VM registers. This ought to make things slightly more reliable here.
OpenPOWER on IntegriCloud