summaryrefslogtreecommitdiffstats
path: root/sys/boot/efi/libefi
Commit message (Collapse)AuthorAgeFilesLines
* Make efi_time and EFI_GetTimeOfDay static, neither are used by other partsandrew2016-02-211-2/+2
| | | | | | of the efi code. Sponsored by: ABT Systems Ltd
* Still open the network interface when EFI_OPEN_PROTOCOL_EXCLUSIVE failed.andrew2016-02-031-2/+2
| | | | Not all UEFI implementations support this protocol.
* Add suppor to loader.efi to load files off hte network. For this we needandrew2016-02-021-3/+27
| | | | | | | | | to open the device in exclusive mode as, without this, the firmware may also be reading packets off the interface leading to a race. Reviewed by: emaste Sponsored by: ABT Systems Ltd Differential Revision: https://reviews.freebsd.org/D4132
* Allow new lines as white space for arguments that are parsed to allowimp2016-01-261-2/+2
| | | | | | | | boot1 to pass in files with newlines in them. Now that the EFI loader groks foo=bar on the command line, this can allow a more general setup than traditional boot loader args will allow. Differential Revision: https://reviews.freebsd.org/D5038
* Add EFI ZFS boot supportsmh2016-01-151-1/+23
| | | | | | | | | | | | | | | | | | | This builds on the modular EFI loader support added r294060 adding a module to provide ZFS boot support on EFI systems. It should be noted that EFI uses a fixed size memory block for all allocations performed by the loader so it may be necessary to tune this size. For example when building an image which uses mfs_root e.g. mfsbsd, adding the following to /etc/make.conf would be needed to prevent EFI from running out of memory when loading the mfs_root image. EFI_STAGING_SIZE=128 Submitted by: Eric McCorkle MFC after: 2 weeks X-MFC-With: r293268 Sponsored by: Multiplay
* Revert r293903smh2016-01-141-1/+0
| | | | | | | Revert r293903 as EFI shouldn't be built on this platform that the this was reported on. Sponsored by: Multiplay
* Fix GCC warnings causing build failure after r293724smh2016-01-141-0/+1
| | | | | | | | | | | Disable some compiler warnings for GCC (non-standard compiler) fixing build failures introduced by r293724, which enabled WARNS in the EFI boot code, when compiling with none standard compiler (GCC). Raised by: ian MFC after: 2 weeks X-MFC-With: r293268 Sponsored by: Multiplay
* Fix typo in libefi.csmh2016-01-131-1/+1
| | | | | | | | Fix a typo in libefl.c (removal or L) introduced by r293724 MFC after: 2 weeks X-MFC-With: r293268 Sponsored by: Multiplay
* Enable warnings in EFI boot codesmh2016-01-124-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Set WARNS if not set for EFI boot code and fix the issues highlighted by setting it. Most components are set to WARNS level 6 with few being left at lower levels due to the amount of changes needed to fix at higher levels. Error types fixed: * Missing / invalid casts * Missing inner structs * Unused vars * Missing static for internal only funcs * Missing prototypes * Alignment changes * Use of uninitialised vars * Unknown pragma (intrinsic) * Missing types etc due to missing includes * printf formatting types Reviewed by: emaste (in part) MFC after: 2 weeks X-MFC-With: r293268 Sponsored by: Multiplay Differential Revision: https://reviews.freebsd.org/D4839
* loader.efi: add terminal emulation supportemaste2016-01-062-18/+403
| | | | | | | | | | This is based on the vidconsole implementation. Submitted by: Toomas Soome <tsoome@me.com> Reviewed by: adrian MFC after: 2 weeks Relnotes: Yes Differential Revision: https://reviews.freebsd.org/D4797
* Revert accidental whitespace changes included with r292623emaste2015-12-223-18/+18
|
* Support a.out format in nlist only on i386emaste2015-12-223-18/+18
| | | | | | | | | i386 is the only current FreeBSD architecture that ever used a.out format. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D4687
* META_MODE: Remove DEP_MACHINE from Makefile.depend files.bdrewery2015-09-251-2/+0
| | | | | | This has not been needed since r246865 in projects/bmake. Sponsored by: EMC / Isilon Storage Division
* META_MODE: Remove DEP_RELDIR from Makefile.depend files.bdrewery2015-09-251-2/+0
| | | | | | This has not been needed since r284171 in projects/bmake. Sponsored by: EMC / Isilon Storage Division
* Avoid creating invalid UEFI device pathemaste2015-07-071-5/+18
| | | | | | | | | | | | | | The UEFI loader on the 10.1 release install disk (disc1) modifies an existing EFI_DEVICE_PATH_PROTOCOL instance in an apparent attempt to truncate the device path. In doing so it creates an invalid device path. Perform the equivalent action without modification of structures allocated by firmware. PR: 197641 MFC After: 1 week Submitted by: Chris Ruffin <chris.ruffin@intel.com>
* Add META_MODE support.sjg2015-06-131-0/+17
|\ | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp
| * Merge sync of headsjg2015-05-273-11/+12
| |\ | |/ |/|
| * Merge from head@274682sjg2014-11-192-0/+14
| |\
| * \ Merge head from 7/28sjg2014-08-191-0/+4
| |\ \
| * \ \ Merge headsjg2014-04-284-11/+54
| |\ \ \
| * \ \ \ Sync with HEAD.obrien2013-02-081-1/+1
| |\ \ \ \
| * | | | | Updated/new Makefile.dependsjg2012-11-081-0/+16
| | | | | |
* | | | | | Disable the use of floating-point and vector registers in the loader. Theyandrew2015-05-051-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | need the vfp unit to be enabled which may not be the case.
* | | | | | Use MACHINE in the efi loader when it is what we mean, it may not be theandrew2015-04-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | same as MACHINE_CPUARCH, it just happened to be the case the architectures this code currently supports. Sponsored by: The FreeBSD Foundation
* | | | | | Move the x86 specific files to be built in the amd64 loader.efi. This willandrew2015-03-151-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | help with importing the arm and arm64 versions of loader.efi.
* | | | | | Merge ^/head r279893 through r279984.dim2015-03-142-2/+2
|\ \ \ \ \ \
| * | | | | | Enable bzipfs support in the EFI loader.jhb2015-03-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add bzipfs to the list of supported filesystems in the EFI loader. - Increase the heap size allocated for the EFI loader from 2MB to 3MB. Differential Revision: https://reviews.freebsd.org/D2053 Reviewed by: benno, emaste, imp MFC after: 2 weeks Sponsored by: Cisco Systems, Inc.
| * | | | | | The System V ABI for amd64 allows functions to use space in a 128 bytejhb2015-03-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | redzone below the stack pointer for scratch space and requires interrupt and signal frames to avoid overwriting it. However, EFI uses the Windows ABI which does not support this. As a result, interrupt handlers in EFI push their interrupt frames directly on top of the stack pointer. If the compiler used the red zone in a function in the EFI loader, then a device interrupt that occurred while that function was running could trash its local variables. In practice this happens fairly reliable when using gzipfs as an interrupt during decompression can trash the local variables in the inflate_table() function resulting in corrupted output or hangs. Fix this by disabling the redzone for amd64 EFI binaries. This requires building not only the loader but any libraries used by the loader without redzone support. Thanks to Jilles for pointing me at the redzone once I found the stack corruption. Differential Revision: https://reviews.freebsd.org/D2054 Reviewed by: imp MFC after: 2 weeks Sponsored by: Cisco Systems, Inc.
| * | | | | | Fix UEFI PXE boot on a NIC that isn't the first NIC.ambrisko2015-01-301-1/+4
| | |_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In UEFI it appears all available NICS are present to pass network traffic. This gives the capability to load the loader.efi from disk then set currdev="net3:" and then all I/O will over over the 2nd NIC. On this machine is appears the first handle is the first NIC in IPv4 mode and then the 2nd handle is the first NIC in IPv6 mode. The 3rd handle is the 2nd NIC in IPv4 mode. The fix is to index into the handle based on the unit cached from boot device passed into the loader. Some testing info from a test boot via kenv: currdev="net3:" loaddev="net3:" boot.netif.name="igb1"
* | | | | | Merge ^/head r277902 through r277944.dim2015-01-301-1/+4
| | | | | |
* | | | | | Since clang 3.6.0 now implements the archetype 'freebsd_kprintf' fordim2015-01-281-3/+2
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | __attribute__((format(...))), and the -fformat-extensions flag was removed, introduce a new macro in bsd.sys.mk to choose the right variant of compile flag for the used compiler, and use it. Also add something similar to kern.mk, since including bsd.sys.mk from that file will anger Warner. :-) Note that bsd.sys.mk does not support the MK_FORMAT_EXTENSIONS knob used in kern.mk, since that knob is only available in kern.opts.mk, not in src.opts.mk. We might want to add it later, to more easily support external compilers for building world (in particular, sys/boot).
* | | | | Switch to text mode in UEFI bootemaste2014-09-181-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The loader previously failed to display on MacBooks and other systems where the UEFI firmware remained in graphics mode. Submitted by: Rafael EspĂ­ndola
* | | | | Add support for serial and null console to UEFI boot loader.ambrisko2014-09-121-0/+4
| |_|_|/ |/| | |
* | | | Supress clang warning for FreeBSD printf %b and %D formatssbruno2014-07-221-0/+4
| |_|/ |/| | | | | | | | MFC after: 2 weeks
* | | Add explicit casts to quiet warnings in libefiemaste2014-04-081-4/+6
| | | | | | | | | | | | Sponsored by: The FreeBSD Foundation
* | | Add -fPIC for amd64emaste2014-04-031-0/+3
| | | | | | | | | | | | Sponsored by: The FreeBSD Foundation
* | | Merge efilib changes from projects/uefiemaste2014-04-033-7/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r247216: Add the ability for a device to have an "alias" handle. r247379: Fix network device registration. r247380: Adjust our load device when we boot from CD under UEFI. The process for booting from a CD under UEFI involves adding a FAT filesystem containing your loader code as an El Torito boot image. When UEFI detects this, it provides a block IO instance that points at the FAT filesystem as a child of the device that represents the CD itself. The problem being that the CD device is flagged as a "raw device" while the boot image is flagged as a "logical partition". The existing EFI partition code only looks for logical partitions and so the CD filesystem was rendered invisible. To fix this, check the type of each block IO device. If it's found to be a CD, and thus an El Torito boot image, look up its parent device and add that instead so that the loader will then load the kernel from the CD filesystem. This is done by using the handle for the boot filesystem as an alias. Something similar to this will be required for booting from other media as well as the loader will live in the EFI system partition, not on the partition containing the kernel. r247381: Remove a scatalogical debug printf that crept in.
* | | Add amd64 EFI headersemaste2014-03-131-1/+1
| |/ |/| | | | | Sponsored by: The FreeBSD Foundation
* | Typo in a comment.rpaulo2012-12-071-1/+1
|/
* MFaltix:marcel2011-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Add support for Pre-Boot Virtual Memory (PBVM) to the loader. PBVM allows us to link the kernel at a fixed virtual address without having to make any assumptions about the physical memory layout. On the SGI Altix 350 for example, there's no usuable physical memory below 192GB. Also, the PBVM allows us to control better where we're going to physically load the kernel and its modules so that we can make sure we load the kernel in memory that's close to the BSP. The PBVM is managed by a simple page table. The minimum size of the page table is 4KB (EFI page size) and the maximum is currently set to 1MB. A page in the PBVM is 64KB, as that's the maximum alignment one can specify in a linker script. The bottom line is that PBVM is between 64KB and 8GB in size. The loader maps the PBVM page table at a fixed virtual address and using a single translations. The PBVM itself is also mapped using a single translation for a maximum of 32MB. While here, increase the heap in the EFI loader from 512KB to 2MB and set the stage for supporting relocatable modules.
* Revert previous commit: EFI_STATUS is a 64-bit integral on ia64. Fix themarcel2011-03-161-1/+1
| | | | | | | | compile warning on i386 (where EFI_STATUS is a 32-bit integral) by casting the status argument to u_long instead. Pointy hat: brucec MFC after: 3 days
* Handle memory allocation failures in include().brucec2011-02-231-1/+1
| | | | | | PR: i386/85652 Submitted by: Ben Thomas <bthomas at virtualiron.com> MFC after: 3 days
* Help static analysis by initializing variables that we know cannot bemarcel2011-01-062-0/+2
| | | | used uninitialized, but which cannot be inferred from the code itself.
* MF tbemd: move to using specific architecture makefilesimp2010-08-231-1/+1
|
* Remove file system support based on the simple file system protocolmarcel2010-01-093-443/+267
| | | | | | | | | | | | | | | | | | | | | | | as this only allows us to access file systems that EFI knows about. With a loader that can only use EFI-supported file systems, we're forced to put /boot on the EFI system partition. This is suboptimal in the following ways: 1. With /boot a symlink to /efi/boot, mergemaster complains about the mismatch and there's no quick solution. 2. The EFI loader can only boot a single version of FreeBSD. There's no way to install multiple versions of FreeBSD and select one at the loader prompt. 3. ZFS maintains /boot/zfs/zpool.cache and with /boot a symlink we end up with the file on a MSDOS file system. ZFS does not have proper handling of file systems that are under Giant. Implement a disk device based on the block I/O protocol instead and pull in file system code from libstand. The disk devices are really the partitions that EFI knows about. This change is backward compatible. MFC after: 1 week
* Major rework of the ia64 loaders. The two primary objectives are:marcel2006-11-0513-1312/+516
| | | | | | | | | | | | | | 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.
* Make this compile on EFI32. The EFI_PHYSICAL_ADDRESS type is alwaysmarcel2006-11-031-1/+1
| | | | 64-bit, even when sizeof(void *) is 32-bit.
* Extend struct devdesc with a unit field, called d_unit. Promote themarcel2006-11-023-9/+6
| | | | | | | | | 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.
* Remove more Alpha bits from the boot code including fixing severaljhb2006-05-121-1/+1
| | | | stale comments.
* Add loader(8) variables for RB_DFLTROOT, RB_MUTE, and RB_PAUSE:ru2005-09-221-2/+8
| | | | "boot_dfltroot", "boot_mute", and "boot_pause" respectively.
OpenPOWER on IntegriCloud