summaryrefslogtreecommitdiffstats
path: root/sys/boot/efi/loader
Commit message (Collapse)AuthorAgeFilesLines
* Add a missing call to dev_cleanup from the arm64 loader.efi.andrew2016-02-201-0/+2
| | | | Sponsored by: ABT Systems Ltd
* Ensure the bss is aligned to a 4-byte address as we use 4-byte alignedandrew2016-02-091-1/+3
| | | | | | | | | stores to clear it. While here reduce the alignment of the data from 4k to 16 byte aligned. This should be more than enough, without wasting too much space. Sponsored by: ABT Systems Ltd
* Implement -P for boot loader. It's a bit easier to implement here thanimp2016-02-081-3/+93
| | | | | | | | | | | in boot1, like is normally done. When a keyboard appears in the UEFI device tree, assume -D -h, just like on a BIOS boot. # It is unclear if an ACPI keyboard appearing in the tree means there's # a real keyboard or not. A USB keyboard doesn't seem to appear unless # it is really there. Differential Revision: https://reviews.freebsd.org/D5223
* Parse the command line arguments, and do it before we initialize theimp2016-01-261-13/+94
| | | | | | console so it can be changed by the command line arguments. Differential Revision: https://reviews.freebsd.org/D5038
* Connect the ZFS boot environment menu to the UEFI loaderallanjude2016-01-151-0/+33
| | | | | MFC after: 3 days Sponsored by: ScaleEngine Inc.
* Add EFI ZFS boot supportsmh2016-01-154-1/+122
| | | | | | | | | | | | | | | | | | | 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
* Modularise EFI boot loadersmh2016-01-152-32/+68
| | | | | | | | | | | | | Make EFI boot loader modular in preparation for adding ZFS support. This is a partial commit of the D4515. Submitted by: Eric McCorkle Reviewed by: emaste (in part) MFC after: 2 weeks X-MFC-With: r293268 Sponsored by: Multiplay Differential Revision: https://reviews.freebsd.org/D4515
* Only build EFI components on supported compilerssmh2016-01-141-5/+0
| | | | | | | | | | | | | | As the in-tree GCC does not support __attribute__((ms_abi)) EFI can only be built with Clang. The EFI loader and boot1 validated this, but unused libefi was still built causing issues under GCC after warnings where enabled by r293724. Disable building all of EFI when the selected compiler is GCC. MFC after: 2 weeks X-MFC-With: r293268 Sponsored by: Multiplay
* Enable warnings in EFI boot codesmh2016-01-1211-22/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* style(9) fixes for EFI bootsmh2016-01-061-2/+2
| | | | | | | | Fix some style(9) nits for EFI boot code, no functional changes. MFC after: 2 weeks X-MFC-With: r293268 Sponsored by: Multiplay
* loader.efi style(9) cleanupemaste2016-01-061-35/+29
| | | | Submitted by: smh
* Introduce and use new EFI_ERROR_CODE macro for EFI errorsemaste2016-01-063-9/+8
| | | | | Submitted by: smh MFC after: 1 week
* loader.efi: add terminal emulation supportemaste2016-01-061-1/+2
| | | | | | | | | | 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
* loader.efi: support non-contiguous console modesemaste2016-01-041-2/+3
| | | | | | Submitted by: Toomas Soome <tsoome@me.com> MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D4760
* Set env vars from values on the efi loader command line.ian2015-12-221-2/+25
| | | | | | | | | | | | Examine each cmdline arg and if it contains an '=' convert it to ascii and pass it to putenv(). This allows var=value settings to come in on the command line. This will allow overriding dhcp server-provided data in loader(8), as discussed in PR 202098 PR: 202098 Differential Revision: https://reviews.freebsd.org/D4561
* loader.efi: strip trailing whitespaceemaste2015-12-213-3/+3
| | | | Sponsored by: The FreeBSD Foundation
* loader.efi: refresh size in GetMemoryMap retry loopemaste2015-12-201-67/+55
| | | | | | | | | | | | | | | | | | | | If ExitBootServices fails due to a changed efi_mapkey then GetMemoryMap must be called again. In this case it is also possible for the memory map to grow, so repeat the initial GetMemoryMap call to fetch the new size. Also roll bi_add_efi_data_and_exit into bi_load_efi_data as there's no need for it to be a separate function. PR: 202455 Reported by: Berislav Purgar <bpurgar@gmail.com> Tested by: Berislav Purgar <bpurgar@gmail.com> Reviewed by: kib MFC after: 1 week MFC with: r292338 Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D4621
* Pass the UEFI system table into the kernel from the boot loader viaimp2015-12-191-0/+3
| | | | | the FW_HANDLE metadata item. The kernel can get the rest of what it needs from this.
* loader.efi: show EFI error number, not full status valueemaste2015-12-181-5/+6
| | | | | | | | | | EFI return values set the high bit to indicate an error. The log messages changed here are printed only in the case of an error, so including the error bit is redundant. Also switch to decimal to match the error definitions (in sys/boot/efi/include/efierr.h). MFC after: 1 week Sponsored by: The FreeBSD Foundation
* UEFI: combine GetMemoryMap and ExitBootServices and retry on erroremaste2015-12-165-38/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | The EFI memory map may change before or during the first ExitBootServices call. In that case ExitBootServices returns an error, and GetMemoryMap and ExitBootServices must be retried. Glue together calls to GetMemoryMap(), ExitBootServices() and storage of (now up-to-date) MODINFOMD_EFI_MAP metadata within a single function. That new function - bi_add_efi_data_and_exit() - uses space previously allocated in bi_load_efi_data() to store the memory map (it will fail if that space is too short). It handles re-calling GetMemoryMap() once to update the map key if necessary. Finally, if ExitBootServices() is successful, it stores the memory map and its header as MODINFOMD_EFI_MAP metadata. ExitBootServices() calls are now done earlier, from within arch- independent bi_load() code. PR: 202455 Submitted by: Ganael LAPLANCHE Reviewed by: kib MFC after: 2 weeks Relnotes: Yes Differential Revision: https://reviews.freebsd.org/D4296
* META MODE: Update dependencies with 'the-lot' and add missing directories.bdrewery2015-12-011-0/+18
| | | | | | | | | | | | | | This is not properly respecting WITHOUT or ARCH dependencies in target/. Doing so requires a massive effort to rework targets/ to do so. A better approach will be to either include the SUBDIR Makefiles directly and map to DIRDEPS or just dynamically lookup the SUBDIR. These lose the benefit of having a userland/lib, userland/libexec, etc, though and results in a massive package. The current implementation of targets/ is very unmaintainable. Currently rescue/rescue and sys/modules are still not connected. Sponsored by: EMC / Isilon Storage Division
* Use EFI page size constants instead of hardcoding 4096.jhb2015-09-291-3/+3
| | | | | | Reviewed by: emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D3692
* The EFI boot loader allocates a single chunk of contiguous memory tojhb2015-09-171-1/+1
| | | | | | | | | | | | | | | hold the kernel, modules, and any other loaded data. This memory block is relocated to the kernel's expected location during the transfer of control from the loader to the kernel. The GENERIC kernel on amd64 has recently grown such that a kernel + zfs.ko no longer fits in the default staging size. Bump the default size from 32MB to 48MB to provide more breathing room. PR: 201679 Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D3666
* Various small cleanups to EFI loader Makefiles.jhb2015-09-171-2/+1
| | | | | Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D3641
* As expected, things aren't as simple as hoped. Consequently, we havemarcel2015-09-071-22/+76
| | | | | | | | | | | | | | | | | | | | | | no option but to use the smbios information to fill in the blanks. It's a good thing UGA is a protocol of the past and GOP has all the info we need. Anyway, the logic has been tweaked a little to get the easier bits of information up front. This includes the resolution and the frame buffer address. Then we look at the smbios information and define expected values as well as the missing bits (frame buffer offset and stride). If the values obtained match the expect values, we fill in the blanks and return. Otherwise we use the existing detection logic to figure it out. Rename the environment variables from uga_framebuffer abd uga_stride to hw.efifb.address and hw.efifb.stride. The latter names are more in line with other variable names. We currently have hardcoded settings for: 1. Mid-2007 iMac (iMac7,1) 2. Late-2007 MacBook (MacBook3,1)
* Auto-detect the UGA frame buffer and stride on a MacBook. We'remarcel2015-09-051-47/+88
| | | | | | | | striking a delicate balance between exhaustive searching and banking on assumptions. The environment variables can be used as a fall-back anyway. With this change, all known and tested Macs with only UGA should have a working console out of the box... for now...
* My MacBook has UGA only, but we fail to detect any changesmarcel2015-09-051-24/+50
| | | | | | | | | in the frame buffer when we flip pixels. Allow the detection to be bypassed by setting the uga_framebuffer and uga_stride variables. The kernel console works fine even when we can't detect pixel changes in the frame buffer, which indicates that the problem could be with reading from the frame buffer and not writing to it.
* For UGA, the frame buffer address obtained by scanning themarcel2015-09-031-52/+175
| | | | | | | | | | | | PCI BARs does not necessarily correspond to the upper-left most pixel. Scan the frame buffer for which byte changed when changing the pixel at (0,0). Use the same technique to determine the stride. Except for changing the pixel at (0,0), we change the pixel at (0,1). PR: 202730 Tested by: hartzell (at) alerce.com
* Install the forth bits on arm64. For now limit it to just arm64 as on x86andrew2015-09-012-2/+15
| | | | these should have been installed as part of the regular loader.
* Add support for the UGA draw protocol. This includes adding amarcel2015-08-301-56/+196
| | | | | | | | | | | | | | | | | command called 'uga' to show whether UGA is implemented by the firmware and what the settings are. It also includes filling the efi_fb structure from the UGA information when GOP isn't implemented by the firmware. Since UGA does not provide information about the stride, we set the stride to the horizontal resolution. This is likely not correct and we should determine the stride by trial and error. For now, this should show something on the console rather than nothing. Refactor this file to maximize code reuse. PR: 202730
* Add a gop command to help diagnose VT efifb problems. The gopmarcel2015-08-301-0/+95
| | | | | | | command has the following sub-commands: list - list all possible modes (paged) get - return the current mode set <mode> - set the current mode to <mode>
* Pass the ACPI table pointer to the arm64 kernel from loader.efi.andrew2015-06-111-1/+39
| | | | Sponsored by: The FreeBSD Foundation
* Remove OUTPUT_FORMAT from theARM EFI linker script, it breaks buildingandrew2015-05-141-2/+0
| | | | for big-endian arm.
* Don't check the return value from self_reloc(), it can't fail and doesn'tian2015-05-101-2/+0
| | | | | | | | return a value. Despite what I said in my prior commit, it turns out this one platform was checking the return value from the old self-reloc code (which returned a hard-coded 0).
* The self-relocation code is not efi-specific, move it to boot/common.ian2015-05-106-133/+5
| | | | | | | | | | | | | | | | The function was defined as taking 4 parameters and returning EFI_STATUS, but all existing callers (in asm code) passed only two parameters and don't use the return value. The function signature now matches that usage, and doesn't refer to efi-specific types. Parameters and variables now use the cannonical typenames set up by elf.h (Elf_Word, Elf_Addr, etc) instead of raw C types. Hopefully this will prevent suprises as new platforms come along and use this code. The function was renamed from _reloc() to self_reloc() to emphasize its difference from the other elf relocation code found in boot/common. Differential Revision: https://reviews.freebsd.org/D2490
* Add FDT to the list of known GUIDs.andrew2015-05-051-0/+3
|
* Disable the use of floating-point and vector registers in the loader. Theyandrew2015-05-051-0/+2
| | | | need the vfp unit to be enabled which may not be the case.
* When cross-building ${LIBSTAND} may be set to the host copy. Point to theandrew2015-05-051-0/+6
| | | | | | | version built with the toolchain. Differential Revision: https://reviews.freebsd.org/D2312 Submitted by: jhb
* * Remove the wfi when the efi loader returns, it's unneeded and is notandrew2015-04-141-2/+1
| | | | | available on older designs. * Enable the efi loader on arm
* Add support for arm64 to loader.efi and boot1.efiandrew2015-04-146-3/+372
| | | | | Reviewed by: emaste Sponsored by: The FreeBSD Foundation
* Use MACHINE in the efi loader when it is what we mean, it may not be theandrew2015-04-141-7/+7
| | | | | | | same as MACHINE_CPUARCH, it just happened to be the case the architectures this code currently supports. Sponsored by: The FreeBSD Foundation
* Create the correct symlinks for the machine directory, and only create theandrew2015-04-131-3/+8
| | | | | | | | | x86 symlink on i386 and amd64. Before this incorrect symlinks were being created on armi and i386. Differential Revision: https://reviews.freebsd.org/D2283 Reviewed by: emaste, imp Sponsored by: The FreeBSD Foundation
* Add fdt support to the arm loader.efiandrew2015-04-111-0/+2
|
* Only add -fPIC to CFLAGS and -Wl,-znocombreloc to LDFLAGS on x86, theyandrew2015-04-113-2/+7
| | | | shouldn't be used on arm.
* Move reloc.c to the top level Makefile as it has become generic.andrew2015-04-114-6/+4
|
* Update the arm efi ldscript to generate a valid efi binaryandrew2015-04-111-44/+20
|
* Add build support for i386 loader.efiemaste2015-04-102-0/+17
| | | | | | | Kernel changes are required for this to be useful but this will allow others to experiment. Differential Revision: https://reviews.freebsd.org/D2276
* Limit EFI framebuffer metadata to amd64 for nowemaste2015-04-101-2/+2
| | | | | The i386 loader.efi does not yet exist. Avoid dealing with vt and framebuffer issues there until the initial bootstrapping is done.
* Port the EFI reloc codeto work on arm64. This used the rela relocationandrew2015-04-101-2/+14
| | | | | | table so wiill need the addend included in the relocation calculation. Sponsored by: The FreeBSD Foundation
* Remove EOL whitespace from i386 EFI loader sourceemaste2015-04-094-5/+5
|
OpenPOWER on IntegriCloud