367457 |
07-Nov-2020 |
dim |
MFC r344855 (by jhb):
Drop "All rights reserved" from my copyright statements.
Reviewed by: rgrimes Differential Revision: https://reviews.freebsd.org/D19485 |
358208 |
21-Feb-2020 |
kevans |
MFC r357845: efiloader: don't execute hooks when setting currdev/loaddev
We still need to set the hooks to prevent improper manipulations thereafter at the loader prompt, but as it is we're actively preventing loaddev from being set correctly in some circumstances (ZFS in particular) and doing more work than needed with currdev -- that hook in particular validates it as a correct device, which we can assume isn't needed in this context. |
346483 |
21-Apr-2019 |
kevans |
MFC r343911, r344238-r344241, r344247, r344254-r344255, r344260, r344268, r344335, r344839, r345066, r345330
r343911: Allow reading the UEFI variable size
When loading bigger variables form UEFI it is necessary to know their size beforehand, so that an appropriate amount of memory can be allocated. The easiest way to do this is to try to read the variable with buffer size equal 0, expecting EFI_BUFFER_TOO_SMALL error to be returned. Allow such possible approach in efi_getenv routine.
Extracted from a bigger patch as suggested by imp.
r344238: Restore loader(8)'s ability for lsdev to show partitions within a bsd slice.
I'm pretty sure this used to work at one time, perhaps long ago. It has been failing recently because if you call disk_open() with dev->d_partition set to -1 when d_slice refers to a bsd slice, it assumes you want it to open the first partition within that slice. When you then pass that open dev instance to ptable_open(), it tries to read the start of the 'a' partition and decides there is no recognizable partition type there.
This restores the old functionality by resetting d_offset to the start of the raw slice after disk_open() returns. For good measure, d_partition is also set back to -1, although that doesn't currently affect anything.
I would have preferred to make disk_open() avoid such rude assumptions and if you ask for partition -1 you get the raw slice. But the commit history shows that someone already did that once (r239058), and had to revert it (r239232), so I didn't even try to go down that road.
r344239: Use a couple local variables to avoid repetitive long expressions that cause line-wrapping.
r344240: Make lsdev -v output line up in neat columns by using a fixed width for the size field and a tab between the partition type and the size.
Changes this
disk devices: disk0 (MMC) disk0s1: DOS/Windows 49MB disk0s2: FreeBSD 14GB disk0s2a: FreeBSD UFS 14GB disk0s2b: Unknown 2048KB disk0s2d: FreeBSD UFS 2040KB
to this
disk devices: disk0 (MMC) disk0s1: DOS/Windows 49MB disk0s2: FreeBSD 14GB disk0s2a: FreeBSD UFS 14GB disk0s2b: Unknown 2048KB disk0s2d: FreeBSD UFS 2040KB
r344241: Garbage collection no-longer-used constant.
r344247: Make uboot_devdesc properly alias disk_devdesc, so that parsing the u-boot loaderdev variable works correctly.
The uboot_devdesc struct is variously cast back and forth between uboot_devdesc and disk_devdesc as pointers are handed off through various opaque interfaces. uboot_devdesc attempted to mimic the layout of disk_devdesc by having a devdesc struct, followed by a union of some device-specific stuff that included a struct that contains the same fields as a disk_devdesc. However, one of those fields inside the struct is 64-bit which causes the entire union to be 64-bit aligned -- 32 bits of padding is added between the struct devdesc and the union, so the whole mess ends up NOT properly mimicking a disk_devdesc after all. (In disk_devdesc there is also 32 bits of padding, but it shows up immediately before the d_offset field, rather than before the whole collection of d_* fields.)
This fixes the problem by using an anonymous union to overlay the devdesc field uboot network devices need with the disk_devdesc that uboot storage devices need. This is a different solution than the one contributed with the PR (so if anything goes wrong, the blame goes to me), but 95% of the credit for this fix goes to Pawel Worach and Manuel Stuhn who analyzed the problem and proposed a fix.
r344254: Use DEV_TYP_NONE instead of -1 to indicate no device was specified.
DEV_TYP_NONE has a value of zero, which makes more sense since the device type is a bunch of bits describing the device, crammed into an int.
r344255: Fix more places to use DEV_TYP_NONE instead of -1 to indicate 'no device'.
r344260: Allow the u-boot loaderdev env var to be formatted in the "usual" loader(8) way: device<unit>[s|p]<slice><partition>. E.g., disk0s2a or disk3p12. The code first tries to parse the variable in this format using the standard disk_parsedev(). If that fails, it falls back to parsing the legacy format that has been supported by ubldr for years.
In addition to 'disk', all the valid uboot device names can also be used: mmc, sata, usb, ide, scsi. The 'disk' device serves as an alias for all those types and will match the Nth storage-type device found (where N is the unit number).
r344268: loader: ptable_close() should check its argument
If the passed in table is NULL, just return.
r344335: Fix the handling of legacy-format devices in the u-boot loaderdev variable. When I added support for the standard loader(8) disk0s2a: type formats, the parsing of legacy format was broken because it also contains a colon, but it comes before the slice and partition. That would cause disk_parsedev() to return success with the slice and partition set to wildcard values.
This change examines the string first, and if it contains spaces, dots, or a colon at any position other than the end, it must be a legacy-format string and we don't even try to use disk_parsedev() on it.
r344839: Add retry loop around GetMemoryMap call to fix fragmentation bug
The call to BS->AllocatePages can cause the memory map to become framented, causing BS->GetMemoryMap to return EFI_BUFFER_TOO_SMALL more than once. For example this can happen on the MinnowBoard Turbot, causing the boot to stop with an error. Avoid this by calling GetMemoryMap in a loop.
r345066: stand: Improve some debugging experience
Some of these files using <FOO>_DEBUG defined a DEBUG() macro to serve as a debug-printf. -DDEBUG is useful to enable some debugging output across multiple ELF/common parts, so switch the DEBUG-as-printf macros over to something more like DPRINTF that is more commonly used for this kind of thing and less likely to conflict.
userboot/elf64_freebsd debugging also assumed %llx for uint64; use PRIx64 instead.
r345330: loader: fix loading of kernels with . in path
The loader indended to search the kernel file name (only) for . but instead searched the entire path, so paths like "boot/test.elfv2/kernel" would not work.
PR: 233097 |
346482 |
21-Apr-2019 |
kevans |
MFC r341101, r341231, r341276, r341329, r341433, r341780, r342054-r342055, r342721, r342742, r342840, r343008, r343225
r341101: powerpcspe: Don't crash the loader on ubldr with SPE instructions.
-msoft-float seems to be insufficient for disabling the SPE on powerpcspe. Force it off with -mno-spe as well. This prevents a crash in ubldr on powerpcspe.
r341231: loader: command_bcache() should print unsigned values
All bcache counters are unsigned.
r341276: When handling CMD_CRIT error set command_errmsg to NULL after we dump it out, so that it does not result in error message printed twice.
OK load doodoo can't find 'doodoo' can't find 'doodoo' OK
r341329: loader.efi: fix EFI getchar() for multiple consoles
This fix is ported from illumos (issue #9970), the analysis and initial implementation was done by John Levon.
See also: https://www.illumos.org/issues/9970
Currently, efi_cons_getchar() will wait for a key. While this seems to make sense, the implementation of getchar() in common/console.c will loop across getchar() for all consoles without doing ischar() first.
This means that if we've configured multiple consoles, we can't input into the serial, as getchar() will be sat waiting for input only from efi_console.c
This patch does implement a bit more generic key buffer to support translation of input keys, and we use generic efi_readkey() to reduce duplication from calls from getchar() and poll().
r341433: Move inclusion of src.opts.mk later.
src.opts.mk includes bsd.own.mk. This in turn defines CTFCONVERT_CMD depending on the MK_CTF value. We then set MK_CTF to no, which has no real effect. The solution is to set all the MK_foo values before including src.opts.mk.
This should stop the cdboot binary from exploding in size for releases built WITH_CTF=yes in src.conf.
r341780: powerpc/ubldr: Teach powerpc's ubldr to boot 64-bit kernels
This is just a copy of powerpc/ofw's ppc64_elf_freebsd.c modified to fit ubldr's boot format.
r342054: Print an error message in efi_main.c if we can't allocate memory for the heap
With the default Qemu parameters, only 128MB RAM gets given to a VM. This causes the loader to be unable to allocate the 64MB it needs for the heap. This change makes the cause of the error more obvious.
r342055: Cast error message in efi_main.c to CHAR16* to avoid build error
r342721: loader.efi: update memmap command to recognize new attributes
Also move memory type to string translation to libefi for later use.
r342742: loader.efi: efi variable rework and lsefi command added
This update does add diag and debug capabilities to interpret the efi variables, configuration and protocols (lsefi).
The side effect is that we add/update bunch of related headers.
r342840: Create MK_LOADER_VERBOSE and connect it to ELF_VERBOSE in the loader code.
r343008: Add Dell Chromebook to the list of devices with E820 extmem quirk enabled
Just like for Acer C270 chromebook the E820 extmem workaround is required for FreeBSD to boot on Dell chromebook.
r343225: Unbreak mip64 build after r328437
Add exit and getchar functions to beri/boot2 code. They are required by panic_action functin introduced in r328437
PR: 18498, 204916 |
346480 |
21-Apr-2019 |
kevans |
MFC r338262, r339334, r339796, r340240, r340857, r340917, r341007
r338262: stand: fdt: Drop some write-only assignments/variables and leaked bits
Generally straightforward enough; a copy of argv[1] was being made in command_fdt_internal, solely used for a comparison within the handler-search, then promptly leaked.
r339334: loader.efi: add poweroff command
Add poweroff command to make life a bit easier.
r339796: Simplify the EFI delay() function by calling BS->Stall()
r340240: loader: ptable_open() check for ptable_cd9660read result is wrong
The ptable_*read() functions return NULL on read errors (and partition table closed as an side effect). The ptable_open must check the return value and act properly.
r340857: Nuke out buffer overflow safety marker code, it duplicates similar code in the malloc()/free() as well as having potential of softening the handling in case error is detected down to a mere warning as compared to hard panic in free().
r340917: Update pxeboot(8) manual page to reflect the next-server change in the ISC DHCP v3 server.
r341007: Bump the date of pxeboot(8) manual page for r340917.
PR: 123484, 232483 |
346472 |
21-Apr-2019 |
kevans |
MFC r336424-r336425: loader command typos
r336424: Fix typo in the command summary.
Of course, I can't get the command to work, but it's a start...
r336425: More typos |
346302 |
16-Apr-2019 |
kevans |
MFC r346132: stand: refactor overlay loading a little bit
It was pointed out that manually loading a .dtb to be used rather than relying on platform-specific method for loading .dtb will result in overlays not being applied. This was true because overlay loading was hacked into fdt_platform_load_dtb, rather than done in a way more independent from how the .dtb is loaded.
Instead, push overlay loading (for now) out into an fdt_platform_load_overlays. This method easily allows ubldr to pull in any fdt_overlays specified in the ub env, and omits overlay-checking on platforms where they're not tested and/or not desired (e.g. powerpc). If we eventually stop caring about fdt_overlays from ubenv (if we ever cared), this method should get chopped out in favor of just calling fdt_load_dtb_overlays() directly. |
344413 |
21-Feb-2019 |
kevans |
MFC Loader Interpreter Coexistance: r337806, r337868, r337914, r337927, r337989, r338052, r338064, r338407, r338418, r338474
r337806: Create a loader for each interpreter for x86 BIOS and all EFI
Create loader_{4th,lua,simp}{,.efi}. All of these are installed by default. Create LOADER_DEFAULT_INTERP to specify the default interpreter when no other is specified. LOADER_INTERP is the current interpreter language building. Turn building of lua on by default to match 4th. simploader is a simplified loader build w/o any interpreter language (but with a simple loader). This is the historic behavir you got with WITHOUT_FORTH. Make a hard link to the default loader. This has to be a hard link rather than the more desirable soft link because older zfsboot blocks don't support symlinks.
r337868: stand: Use -Oz/-Os for all loader/stand builds.
While we're not super size constrained, the x86 BIOS /boot/loader has to be less than about 520k-530k to be reliable. The LUA loader is at this size today. -Oz saves 15-20% on the size, keeping us safely small enough (comparable to where we were with the 4th loader). This will also help with sjg's work on bringing in bearssl, though we may again be looking for space in the LUA loader.
Size table for clang 6.0.0: default -O1 -Os -Oz 4th 442368 417792 389120 376832 lua 524288 479232 446464 430080
r337914: Install links for loader.efi.
r337927: Add ashldi3 and ashrdi3 to mips.
Now that we're using -Os, mips needs these routines.
r337989: Copy the boot loader from the new location for the co-existing loaders.
r338052: libsa: Add lshrdi3.c for powerpc* and mips
r338064: Turn back the clock just a little: make userboot.so always be 4th
Turns out there was a hidden dependency we hasn't counted upon. The host load /boot/userboot.so to boot the VMs it runs. This means that the change to lua meant suddently that nobody could run their older VMs because LUA wasn't in 10.0, last month's HardenedBSD, 11.2 or whatever. Even more than for the /boot/loader* binaries, we need a good coexistance strategy for this. While that's being designed and implemented, drop back to always 4th for userboot.so. This will fail safe in all but the most extreme environments (but lua-only hacks to .lua files won't be processes in VMs until we fix it).
r338407: lualoader: Print error messages from command failures at the prompt
Previously lualoader would remain silent, rather than printing command_errmsg or noting that a command had failed or was not found.
r338418: userboot: handle guest interpreter mismatches more intelligently
The switch to lualoader creates a problem with userboot: the host is inclined to build userboot with Lua, but the host userboot's interpreter must match what's available on the guest. For almost all FreeBSD guests in the wild, Lua is not yet available and a Lua-based userboot will fail.
This revision updates userboot protocol to version 5, which adds a swap_interpreter callback to request a different interpreter, and tries to determine the proper interpreter to be used based on how the guest /boot/loader is compiled. This is still a bit of a guess, but it's likely the best possible guess we can make in order to get it right. The interpreter is now embedded in the resulting executable, so we can open /boot/loader on the guest and hunt that down to derive the interpreter it was built with.
Using -l with bhyveload will not allow an intepreter swap, even if the loader specified happens to be a userboot with the wrong interpreter. We'll simply complain about the mismatch and bail out.
For legacy guests without the interpreter marker, we assume they're 4th. For new guests with the interpreter marker, we'll read it and swap over to the proper interpreter if it doesn't match what the userboot we're using was compiled with.
Both flavors of userboot are installed by default, userboot_4th.so and userboot_lua.so. This fixes the build WITHOUT_FORTH as a coincidence, which was broken by userboot being forced to 4th.
r338474: Be a little conservative about when to force size optimizations.
Reports have come in that there's issue with powerpc and sparc64 since we've switched to using -Oz / -Os. We don't strictly need them for !x86, so be conservative about when we enable them. |
344412 |
21-Feb-2019 |
kevans |
MFC r336837: Be more conservative about setting hw.uart.console
Note when we've found a 8250 PNP node. Only try to set hw.uart.console if we see one (otherwise ignore serial hints). The 8250 is the only one known to have I/O ports, so limit the guessing to when we've positively seen one. And limit this to x86 since that's the only platform where we have I/O ports. Otherwise, we'd set the serial port to something crazy for the platform and fall off the cliff early in boot. |
344411 |
21-Feb-2019 |
kevans |
MFC r336431: stand: Fix UEFI console scrolling
Remove bogus attempt to simulate scrolling. It's not needed and messes up serial output. Setting the cursor position after every character is inefficient, and causes all lines to be over-printed in the serial console for the boot loader. Allow the terminal to do the emulation.
This isn't completely perfect when the size of the terminal attached to the serial port isn't the same as 80x25 to match the viedoe console (or whatever the video console is). While imperfect still, these changes make it much better.
This makes the serial port useful with UEFI. |
344410 |
21-Feb-2019 |
kevans |
MFC r337131, r337231: stand: efipart fixes
r337131: loader.efi: efipart_inithandles() failure should not prevent devsw initialization
The efipart_inithandles() can return error code when there are no block devices, however, we still should walk and initialize devsw.
r337231: loader.efi: clean up misleading noise from missing block devices
If there are no block devices, there is no need to printout error (ENOENT).
In case of netboot, our image path has no block device, no need to make noise about it. |
344409 |
21-Feb-2019 |
kevans |
MFC r338337: Fix lualoader on arm64
Lua has a few places where it allocates a large buffer on the stack. This is normally fine, except there are a few places where there can be multiple frames with this buffer. This can cause a stack overflow on some arm64 SoCs.
Fix this by allocating our own stack in loader.efi large enough for these objects. The required size has been found by tracing how the stack pointer changes in a virtual machine and found to be no larger than 50kB. A larger stack is allocated to reduce the likelihood of overflow from future changes. |
344406 |
21-Feb-2019 |
kevans |
MFC r336651-r336655: stand: libefi: various boot protocol aux impl.
r336651: Implement efi_devpath_to_media_path
Takes a generic device path as its input. Scans through it to find the first media_path node in it and returns a pointer to it. If none is found, NULL is returned.
r336652: Store the number of handles we get back in efipart_nhandles rather than the number of bytes. Don't divide by the element size every time we have to iterate. Eliminate now-unused variables.
r336653: Implement efi_devpath_match_node
Returns true if the first node pointed to by devpath1 is identical to the first node pointed to by devpath2, with care taken to not read past the end of the valid parts of either devpath1 or devpath2. Otherwise, returns false.
r336654: Implement efi_devpath_length
Return the total length, in bytes, of the device path (including the terminating node at the end).
r336655: Implement efiblk_get_pdinfo_by_device_path
Lookup a block device by it's device path. We use a 'loose' lookup whereby we scan forward to the first Media Path portion of the device path, then look at all our handles for one whose first Media Path matches. This will also work if the device path pointed to has a following file path (or paths) as that's ignored. It assumes that there's only one media path node that describes the entire device, which is true as of the latest UEFI spec (2.7 Errata A) as far as I've been able to determine. |
344405 |
21-Feb-2019 |
kevans |
MFC r336535: Hoist EFI_TARGET and SOURCE_DATE_EPOCH up into efi/Makefile.inc |
344404 |
21-Feb-2019 |
kevans |
MFC r336463: If rootdev is set, use it as currdev.
Setting rootdev in the enviornment should specify things completely. If it is set, then have it override everything else. |
344403 |
21-Feb-2019 |
kevans |
MFC r336264, r336270-r336272, r336464, r336627: UEFI Console Improvements
r336264: Define ADR subtype of ACPI type for a device path.
r336270: uefi stand: Guess the console better
For server machines, ComOut is set to the set of devices that the efi console suppots. Parse it to see if we have serial, video or both. Make that take precidence over the command line args. boot1.efi parses them, but loader.efi doesn't. It's not clear where to read boot.conf from, so we don't do that. The command line args can still be set via efibootmgr, which is more inline with the UEFI boot manager to replace that. These args are typically used only to set serial vs video and the com speed line. We can infer that from ComOut, so do so. Remember the com speed and hw.uart.console to match.
r336271: Add reporting of whether or not a keyboard is detected. In addition, note that r336270's commit message was slightly incorrect. It changed the default setting of the console to honor the ConOut variable. Overrides via the command line are still possible, and we use the devices in ConOut to set the proper console. If, for example, serial cosnole is specified, we'll set console to "efi" if ConOut has a serial port list and to either "efi comconsole" or "comconsole efi" if not depending on whether -D or -D -h was specified.
r336272: Minor adjustments:
o Fix the parsing of the device path. a last minute change terminated it too soon. o Kill setting LINES. We don't need to do it, and even if we did hard coding it to 24 is wrong. o Now that the console is working again for the loader, adjust the printfs to be more in line with other platforms.
r336464: If the console is already set, don't override it.
If console=X is specified on the command line, it's effectively overridden by the current code. It shouldn't do that.
r336627: Fix the attempt to see if we're overriding the console in the command line args. I had thought console would be NULL, but it's efi. Set it to efi (as a clue) before we initialize the console, then test it to see if it changed on the command line to do the automatic override. This gets my serial console back.
RelNotes: yes |
344399 |
21-Feb-2019 |
kevans |
MFC GELI Loader Improvements: r336252, r336254, r336256, r336354, r336532-r336534, r336537, r336626, r337326, r337349, r341071, r341160, r341420, r341473, r341651, r342793
Note that this MFC contains some seemingly unrelated zfsloader bits -- this was needed in order to pull in some later fixes for GELI hand-off w/ ZFS bits included.
r336252: Extend loader(8) geli support to all architectures and all disk-like devices.
This moves the bulk of the geli support from lib386/biosdisk.c into a new geli/gelidev.c which implements a devsw-type device whose dv_strategy() function handles geli decryption. Support for all arches comes from moving the taste-and-attach code to the devopen() function in libsa.
After opening any DEVT_DISK device, devopen() calls the new function geli_probe_and_attach(), which will "attach" the geli code to the open_file struct by creating a geli_devdesc instance to replace the disk_devdesc instance in the open_file. That routes all IO for the device through the geli code.
A new public geli_add_key() function is added, to allow arch/vendor-specific code to add keys obtained from custom hardware or other sources.
With these changes, geli support will be compiled into all variations of loader(8) on all arches because the default is WITH_LOADER_GELI.
r336254: Use if rather than case for a simple boolean. gcc thinks blks is undefined sometimes with the case, but enc is always 0 or 1, so and if / else is better anyway.
r336256: Fix glitched indentation (and rewrap as needed due to deeper indent). No functional changes.
r336354: zfsboot: fix build with WITHOUT_LOADER_GELI
r336532: Collapse zfsloader functionality back down into loader.
We no longer really need a separate zfsloader. It was useful when we were first supporting ZFS and had limited ability to properly boot off of ZFS without the special boot loader. Now that the boot loader has matured, go the way loader.efi pioneered and just build one binary. Change the name of the loader to load in the secondary boot blocks to be just /boot/loader. Provide a symbolic link from zfsloader to loader so people who have not upgraded their boot blocks are not affected. This has the happy benefit of making coexistence easier as well (fewer binaries in the matrix).
r336533: Eliminate zfsloader man page.
Remove all cross references to zfsloader.8 and /boot/zfsloader. Move ZFS specific info into loader.8.
r336534: NM and OBJCOPY are already defined for all builds. There's no need to conditionally define them here.
r336537: Mention zfsloader being folded into loader in UPDATING.
r336626: Older zfs boot blocks don't support symlinks. install the link to zfsloader as a hard link. While newer ones do, the whole point of the link was to transition to the new world order smoothly. A hard link is less flexible, but it works and will result in fewer bumps. Adjust UPDATING entry to match.
r337326: loader: biosdisk.c has leftover geli header.
A small cleanup, remove unneeded #include.
r337349: zfsboot: Fix startup crash
On a FreeNAS mini XL, with geli encrypted drives the loader crashed in geli_read().
When we iterate over the list of disks and allocate the zfsdsk structures we don’t zero out the gdev pointer. In one case that resulted in geli_read() (called on the bogus pointer) dividing by zero.
Use calloc() to ensure the zfsdsk structure is always zeroed, so the pointer is initialised to NULL. As a side benefit it gets rid of one #ifdef LOADER_GELI_SUPPORT.
r341071: Restore the ability to override the disk unit/partition at the boot: prompt in gptboot.
When arch-independent geli support was added, a new static 'gdsk' struct was added, but there was still a static 'dsk' struct, and when you typed in an alternate disk/partition, the string was parsed into that struct, which was then never used for anything. Now the string gets parsed into gdsk.dsk, the struct that's actually used.
r341160: Add comments describing the bootargs handoff between loader(8) and gptboot or zfsboot, when loader(8) is the BTX loader. No functional changes.
r341420: Eliminate duplicated code and struct member definitions in the handoff of args data between gptboot/zfsboot and loader(8).
Despite what seems like a lot of changes here, there are no actual changes in behavior, or in the data layout in the structures involved. This is just eliminating identical code pasted into multiple locations.
In detail, the changes are...
- Move struct zfs_boot_args definition from libsa/zfs/libzfs.h to i386/common/bootargs.h because it is specific to x86 booting and the handoff between zfsboot and loader, and has no relation to the zfs library code in general.
- The geli_boot_args and zfs_boot_args structs both contain an identical set of member variables containing geli information. Extract this out to a new geli_boot_data struct, and embed it in the arg-passing structs.
- Provide new routines geli_import_boot_data() and geli_export_boot_data() that can be shared between gptboot, zfsboot, and loader instead of pasting identical code into several different .c files.
- Remove some checks for a NULL pointer that can never be true because the pointer being tested was set using pointer math (kargs + 1) and that can never result in NULL in this code.
r341473: Fix args cross-threading between gptboot(8) and loader(8) with zfs support.
When loader(8) is built with zfs support enabled, it assumes that any extarg data present is a zfs_boot_args struct, but if the first-stage loader was gptboot(8) the extarg data is actually a geli_boot_args struct. Luckily, zfsboot(8) and gptzfsboot(8) have always passed KARGS_FLAGS_ZFS along with KARGS_FLAGS_EXTARG, so we can use KARGS_FLAGS_ZFS to decide whether the extarg data is a zfs_boot_args struct.
To avoid similar problems in the future, gptboot(8) now passes a new KARGS_FLAGS_GELI to indicate that extarg data is geli_boot_args. In loader(8), if the neither KARGS_FLAGS_ZFS nor KARGS_FLAGS_GELI is set but extarg data is present (which will be the case for gptboot compiled before this change), we now check for the known size of the geli_boot_args struct passed by the older versions of gptboot as a way of confirming what type of extarg data is present.
In a semi-related tidying up, since loader's main() has already decided what type of extarg data is present and set the global 'zargs' var accordingly, don't repeat the check in extract_currdev, just check whether zargs is NULL or not.
r341651: Don't reference zfs-specific variables if LOADER_ZFS_SUPPORT is undefined because the variables will be undefined too.
r342793: MK_ZFS -> {MK_ZFS|MK_LOADER_ZFS}, this is so we can diable userland / kernel ZFS but keep the boot-loaders when using ZoL port.
Relnotes: yes (GELI support extended) Relnotes: yes (zfsloader has been collapsed into loader and may be removed after boot blocks have been updated) |
344378 |
20-Feb-2019 |
kevans |
MFC r336244, r336246-r336247: Standardize boot arg parsing
r336244: Create helper functions for parsing boot args.
boot_parse_arg to parse a single arg boot_parse_cmdline to parse a command line string boot_parse_args to parse all the args in a vector boot_howto_to_env Convert howto bits to env vars boot_env_to_howto Return howto mask mased on what's set in the environment.
All these routines return an int that's the bitmask of the args translated to RB_* flags. As a special case, the 'S' flag sets the comconsole_speed env var. Any arg that looks like a=b will set the env key 'a' to value 'b'. If =b is omitted, 'a' is set to '1'. This should help us reduce the number of redundant copies of these routines in the tree. It should also give a more uniform experience between platforms.
Also, invent a new flag RB_PROBE that's set when 'P' is parsed. On x86 + BIOS, this means 'probe for the keyboard, and if it's not there set both RB_MULTIPLE and RB_SERIAL (which means show the output on both video and serial consoles, but make serial primary). Others it may be some similar concept of probing, but it's loader dependent what, exactly, it means.
These routines are suitable for /boot/loader and/or the kernel, though they may not be suitable for the tightly hand-rolled-for-space environments like boot2.
r336246: Eliminate boot loader copies of boot arg parsing.
Eliminate 4 of the copies of the arg parsing in /boot/laoder by using boot_parse_cmdline.
r336247: Transition to boot_env_to_howto and boot_howto_to_env in the boot loader. |
344377 |
20-Feb-2019 |
kevans |
MFC r336084-r336085, r336118: Move zfs impl into libsa
r336084: Move ZFS files into libsa
Move the libzfs stuff into libsa. There's no need for it to be a separate library. The separate library adds to the issues of build ordering that we see from time to time. Move the filesystem support into libsa, like all the other filesystem support rather than making zfs the odd-duck out.
Discussed with: allanjude@
r336085: Stop using ../zfs/libzfs.h but instead use libzfs.h.
While ../zfs/libzfs.h mostly works, there are a few situations where it does not. Eliminate the problem by using plain libzfs.h, like we do for ufs support. This fixes the weird cases, and is easier to understand. It also follows the general style convetion of avoiding ../ in #includes.
r336118: Remove dirs that git svn should have removed but didn't. |
344374 |
20-Feb-2019 |
kevans |
MFC r335773: Revert preference to be an int.
While in base we use it as a boolean (of the wrong spelling), there's at least one out of tree user that needs it to be int since priorirty is a small int, not a 0/1. In deference to the time it's wasted me and my team, push this up into FreeBSD for whatever short life boot1 may have in the tree. |
344371 |
20-Feb-2019 |
kevans |
MFC r335228-r335231, r335272: stand: efiloader fixes
r335228: Migrate has_keyboard to bool.
r335229: Provide a more direct interface to tell ZFS what the preferred handle is. We tell the ZFS code now, and it checks rather than having a callback to do the checks.
This will allow us to have a more graceful fallback code. In the future, it's anticipated that we may fallback to a more global search (or implement a command to do so) when reqeusted by the user, or we detect a violation of the UEFI Boot Manager protocol severe enough to warrant this backstop. For now, it just allows us to get rid of img as a global.
r335230: Move arg parsing into its own routine for possible later reuse.
r335231: There's no need to walk through the tables looking for the smbios table if we're just going to ignore it on arm, so expand, slightly, the reach of the ifdef. Move the buffer to the inner block so we don't have a separate #ifdef far away from these lines.
The issue on arm is that smbios_detect does unaligned accesses, which in the u-boot implementing EFI context causes a crash.
r335272: Many netboot scenarios don't have /boot/defaults/loader.conf. As a fallback, also check /boot/kernel/kernel existing as well, since that's the fallback behavior of the loader. |
344290 |
19-Feb-2019 |
kevans |
MFC r335117: stand bootprog_info consolidation
bootprog_info is generated in vers.c. Move it's definition to bootstrap.h and remove all the redundant copies. |
344289 |
19-Feb-2019 |
kevans |
MFC r335069-r335071, r335110, r335116: stand housecleaning
r335069: Remove fail: label. It's unused.
r335070: Remove unused variables.
[kevans@: removed ufs.c modifications; those depend on ufs rewrite bits]
r335071: Initialize variables we later free so they aren't used uninitialized in the error path. Remove unused variables.
r335110: Remove redundant defs.mk includes. They aren't needed.
r335116: Use bool for vargood, since it's a boolean. |
339210 |
05-Oct-2018 |
jhb |
MFC 338022: Fix casts between 64-bit physical addresses and pointers in EFI.
Compiling FreeBSD/i386 with modern GCC triggers warnings for various places that convert 64-bit EFI_ADDRs to pointers and vice versa. - Cast pointers to uintptr_t rather than to uint64_t when assigning to a 64-bit integer. - Cast 64-bit integers to uintptr_t before a cast to a pointer. |
339161 |
03-Oct-2018 |
kevans |
MFC r338219, r338250: FDT in Loader fixes
r338219: fdt_fixups: relocate the /chosen node after applying fixups
As indicated by the comment, any fixups applied (which might include overlays) can invalidate the previously located node by adding nodes or setting/adding properties. The later fdt_setprop of fixup-applied property would then fail because of the bad/wrong node offset.
This would have generally been harmless, but potentially caused multiple applications of fixups and caused a little bit of bloat.
r338250: efiloader: Setup FDT in autoload to fix overlays clobbering kenv
manu found in the noted PR that overlays seemed to be clobbering the kenv and killing the boot. Further inspection revealed that one can `fdt ls` at the loader prompt for a successful boot, but autoboot breaks it.
In the autoboot case, first setup of FDT is happening in the middle of bi_load, which triggers loading of the DTBO from /boot.
This is bad, bad, bad. Files in the loader are loaded somewhere in the middle of the address space one after another. bi_load starts building the needed kernel bootinfo immediately after the highest-addr loaded file. File loads in the middle of bi_load suddenly clobber bootinfo and everything goes off the rails.
The solution to this is to use take advantage of arch_autoload to setup FDT in efiloader compiled with LOADER_FDT_SUPPORT. This matches how it works in ubldr land, and is how it should have worked when overlay support was added to efiloader since fdt_setup_fdtp now has the potential to load files (courtesy of fdt_platform_load_dtb). |
335755 |
28-Jun-2018 |
kevans |
MFC r334882, r334884-r334885: loader(8) boot flag <-> environment fixes
r334882: stand: Consolidate checking for boot flags driven by environment vars
e.g. boot_mute, boot_single, boot_verbose, and friends; we checked for these in multiple places, consolidate into common/ and allow a setting of "NO" for any of these to turn them off. This allows systems with multiple loader.conf(5) or loader.conf(5) overlay systems to easily turn off variables in later processed files by setting it to NO.
Reported by: Nick Wolff @ iXsystems Reviewed by: imp
r334884: stand: Fix build after r334882
Not sure how this was not caught in Universe.
r334885: stand: One more trivial consolidation (setting environment from howto) |
334444 |
31-May-2018 |
gjb |
MFC r334310, r334337:
r334310 (imp): Teach ufs_module.c about bsd labels and probe 'a' partition.
If the check for a UFS partition at offset 0 on the disk fails, check to see if there's a BSD disklabel at block 1 (standard) or at offset 512 (install images assume 512 sector size). If found, probe for UFS on the 'a' partition.
This fixes UEFI booting images from a BSD labeled MBR slice when the 'a' partiton isn't at offset 0. This is a stop-gap fix since we plan on removing boot1.efi in FreeBSD 12. We can't easily do that for 11.2, however, hence the short MFC window.
r334337 (emaste): switch amd64 memstick installer images to MBR
A good number of BIOSes have trouble booting from GPT in non-UEFI mode.
With this change amd64 memsticks remain dual-mode (booting from either UEFI or CSM); the partitioning type is just switched from GPT to MBR.
PR: 227954
Note, there are two changes specific to stable/11 where there is code that had diverged from head and never merged back. The two changes are an include in stand/efi/boot1/ufs_module.c, replacing sys/disk/bsd.h with sys/disklabel.h and replacing BSD_MAGIC with DISKMAGIC in the same file. The latter two are direct commits to stable/11 in order to avoid unexpected regressions at this point of the 11.2 cycle. Thank you to imp@ for pointing out what changes needed to be made.
Approved by: re (marius)
Sponsored by: The FreeBSD Foundation |
332748 |
19-Apr-2018 |
kevans |
MFC r332416: Refactor currdev setting
Refactor the currdev setting to find the device we booted from. Limit searching when we don't already have a reasonable currdev from that to the same device only. Search a little harder for ZFS volumes as that's needed for loader.efi to live on an ESP. |
332746 |
19-Apr-2018 |
kevans |
MFC r332561,r332573: Rename volume label for ESP
MFC r332561: Rename volume label for ESP
Harry Schmalzbauer reports that some firmware, in his experience, trips over the ESP we install due to the volume label. It has been theorized that this is due to some confusion with the label and the path on the ESP to boot1.efi.
Regardless, Harry found that renaming the label seems to fix it.
MFC r332573: Regenerate FAT templates after r332561
PR: 214282 |
332156 |
06-Apr-2018 |
kevans |
MFC r330970, r331067, r331767, r331852, r331858
r330970: libefi: UEFI_BOOT_VAR_GUID duplicates EFI_GLOBAL_VARIABLE
Drop UEFI_BOOT_VAR_GUID and use EFI_GLOBAL_VARIABLE.
r331067: Only print boot order / boot current if we can get the variables from the loader. Some UEFI implementations don't return all of them.
Sponsored by: Netflix
r331767: efinet: Do not return only if ReceiveFilter fails
If the network interface or the uefi implementation do not support the ReceiveFilter interface do not return only and just print a message. U-Boot doesn't support is and likely never will. Also even if this fails it doesn't mean that network in EFI isn't supported.
r331852: fwohcireg.h is 99% the same between the boot loader and the kernel. Delete it and fix up the 1% difference because there's no need for them to be different.
r331858: The Uninorth ID was really for Uninorth 2. |
332154 |
06-Apr-2018 |
kevans |
MFC r330806-r330815, r330837, r330864, r330883
pc98 changes associated with the named commits are also included in this commit, despite not having been made with the original commits due to its removal in head.
r330806: Minor cosmetic changes.
Make sure { on the same line as struct for all struct *devdesc. Move some type definitions to next to the dv_type define, since that's what sets the d_type.
r330807: We can't use d_opendata for blkio storage.
open_disk uses d_opendata for it's own purpse. We can't store blkio there. Fortunately, blkio is stored elsewhere and we never actually retrieve blkio from d_opendata. Eliminate it as a source of confusion. Eliminate all stores of d_opendata in efi since this layer doesn't own that field.
r330808: Make struct libi386_devdesc match the struct devdesc better
Move data to top and call it d_opendata.
r330809: Use the actual struct devdesc at the start of all *_devdesc structs
The current system is fragile and requires very careful layout of all *_devdesc structures. It also makes it hard to change the base devdesc. Take a page from CAM and put the 'header' in all the derived classes and adjust the code to match.
For OFW, move the iHandle h_handle out of a slot conflicting with d_opendata. Due to quirks in the alignment rules, this worked. However changing the code to use d_opendata storage now that it's a pointer is hard, so just have a separate field for it.
All other cleanups were to make the *_devdesc structures match where they'd taken some liberties that were none-the-less compatible enough to work.
r330810: Remove d_type from devdesc. It's not needed as we can fetch it from d_dev->dv_type when we need it.
r330811: GC unused routines.
Sponsored by: Netflix
r330812: Use the one-line-per-file pattern here, and sort the file names.
Sponsored by: Netflix
r330813: Move the env convenience routines out of boot1.c.
These routines are more generally useful. Even though boot1 is on its way out, it's better to make these common during the transition than copy them.
r330814: Star BootCurrent entry when booting.
Sponsored by: Netflix
r330815: Print the load and device path as well as BootCurrent and BootOrder
Sponsored by: Netflix
r330837: biosdisk.c should not set d_opendata.
Same as 330807, d_opendata is owned by open_disk and we should not set it.
M stand/i386/libi386/biosdisk.c
r330864: Prefer uintXX_t to u_intXX_t
A foolish consistency is the hobgoblin of little minds, adored by little statesmen and philosophers and divines. With consistency a great soul has simply nothing to do. -- Ralph Waldo Emerson
r330883: Fix typo that misteriously passes compilation. |
332148 |
06-Apr-2018 |
kevans |
MFC r330249-r330250
r330249: stand: Makefile SUBDIR cleanup
Use SUBDIR.${MK_*} where appropriate. r330248 eliminated most of the offenders, sweep the rest under the rug.
Differential Revision: https://reviews.freebsd.org/D14545
r330250: stand: Fix build after r330249
One does not simply convert to SUBDIR.yes in stand without making everything else in the affected files SUBDIR.yes -- there are better ways to do this. |
332144 |
06-Apr-2018 |
kevans |
MFC r330077, r330248
r330077: Move EFI up to common makefile. There's no need for all these .if's based on architecture.
Sponsored by: Netflix
r330248: Create LOADER_UBOOT, and LOADER_OFW. Move these options out of Makefile.${MACHINE_ARCH} and remove the now-empty files. Generate the *32 directories on the necessary architectures (well, currently only amd64) on the fly. Remove LOADER_EFI variable and co-locate it with EFI. |
332128 |
06-Apr-2018 |
kevans |
MFC r329725, r329831
r329725: Consolidate three copies of ZFS commands into a central location.
There's no reason to have multiple copies of lszfs and reloadbe. Consolidate them into one location. Also ldi_get_size is the same everywhere (except sparc64). Make it the same everywhere as the common definition is more general and will work on spar64.
r329831: Fix userboot w/ ZFS after r329725
r329725 cleaned up ZFS commands duplicated in multiple places, but userboot was not setting HAVE_ZFS when MK_ZFS != "no". This resulted in a failure to boot (as seen in PR 226118) in bhyve, with the following message:
/boot/userboot.so: Undefined symbol "ldi_get_size" |
332127 |
06-Apr-2018 |
kevans |
MFC r329268, r329517
r329268: efi: Only scan the BLKIO MEDIA once
Scan only the BLOCK IO MEDIA once instead of each time for each type of device (fd, cd and hdd). Leave the mechanism to free and reprobe all devices if one day we want to implement a "dev rescan" thing.
r329517: efi: Do not pad the efi devpath structure
This solve problem when booting with efi on armv7 |
332028 |
04-Apr-2018 |
kevans |
MFC r330868, r331241, r331361, r331365: EFIRT Fixes
r330868: EFIRT: SetVirtualAddressMap with 1:1 mapping after exiting boot services
This fixes a problem encountered on the Lenovo Thinkpad X220/Yoga 11e where runtime services would try to inexplicably jump to other parts of memory where it shouldn't be when attempting to enumerate EFI vars, causing a panic.
The virtual mapping is enabled by default and can be disabled by setting efi_disable_vmap in loader.conf(5).
r331241: Check if the gettime runtime service is valid.
The U-Boot efi runtime service expects us to set the address map before calling any runtime services. It will then remap a few functions to their runtime version. One of these is the gettime function. If we call into this without having set a runtime map we get a page fault.
Add a check to see if this is valid in efi_init() so we don't try to use the possibly invalid pointer.
r331361: Enter into the EFI environment before dereferencing the runtime services pointer. This may be within the EFI address space and not the FreeBSD kernel address space.
r331365: Re-work efidev ordering to fix efirt preloaded by loader on amd64
On amd64, efi_enter calls fpu_kern_enter(). This may not be called until fpuinitstate has been invoked, resulting in a kernel panic with efirt_load="YES" in loader.conf(5).
Move fpuinitstate a little earlier in SI_SUB_DRIVERS so that we can squeeze efirt between it and efirtc at SI_SUB_DRIVERS, SI_ORDER_ANY. efidev must be after efirt and doesn't really need to be at SI_SUB_DEVFS, so drop it at SI_SUB_DRIVER, SI_ORDER_ANY.
The not immediately obvious dependency of fpuinitstate by efirt has been noted in both places. |
331615 |
27-Mar-2018 |
kevans |
MFC r331475: loader consoles: Implement SGR 24, 25
Mostly for completeness sake- implement 24 (no underline) and 25 (no blink) |
331539 |
26-Mar-2018 |
kevans |
MFC r331416, r331440: Loader consoles: Implement SGR 22, reste intensity
r331416: Loader consoles: Implement SGR 22, reset intensity
r331440: Match broken style of vidconsole.c
This particular function uses a broken mix of indentation styles. Match it for the newly added SGR 22 bits. |
330123 |
28-Feb-2018 |
kevans |
MFC r330004: Add NO_OBJ to those directories that don't make anything.
For directories that don't many anything, add NO_OBJ=t just before we include bsd.init.mk. This prevents them from creating an OBJ directory. In addition, prevent defs.mk from creating the machine related links in these cases. They aren't needed and break, at least on stable, the read-only src tree build.
PR: 226074 |
329192 |
13-Feb-2018 |
kevans |
stand: Clean up some unintentional inconsistencies
This is a direct commit to stable/11 to address the following final unintended inconsistencies between stable/11 and head:
- Some unused LIBSTAND= cruft left in efi/loader/Makefie - A comment that flew in with unrelated changes - An #include that may go away now that stand is basically self-contained |
329183 |
12-Feb-2018 |
kevans |
MFC Loader Fixes Final: r327612,r327703,r327704,r327878,r327879,r327881, r328007,r328029,r328030,r328031,r328061,r328156,r328169,r328288,r328289, r328290,r328291,r328292,r328411,r328536,r328603,r328614,r328642,r328769, r328779,r328780,r328781,r328782,r328783,r328806,r328808,r328826,r328835, r328911,r328986,r328987,r328990,r328999,r329000,r329019,r329050,r329054, r329060
r327612: Invent new #defines for the biospci_{read,write}_config function
r327703: Define __dmadat after #include'ing ufsread.c.
r327704: Fix printf missing format variables warnings.
r327878: Add GUID for UEFI boot manager variables.
r327879: Report the boot order and where we are in that boot order.
r327881: Allow this file to be included
r328007: Fix booting on some arm64 systems after r327879 by fixing the call to utf8_to_ucs2
r328029: When returning an error and freeing allocated memory from ucs2_to_utf8, NULL the return pointer.
r328030: Check the return value from utf8_to_ucs2 instead of whether or not uv is NULL.
r328031: Need to free uv after we're done using it.
r328061: utf8_to_ucs2() should check for malloc failure
r328156: stand: Move sections around to fix stand/ build with ld.lld on armv7
r328169: Remove extra copy of bootinfo.c. It's a bit rotted copy of the one in efi/loader.
r328288: Fix some resource leaks.
r328289: Don't leak memory when displaying help.
r328290: On malloc failure, be sure to close the include file that triggered it.
r328291: getenv does not return tainted data in the boot loader. Attempt to clue Coverity into that fact.
r328292: There's no tainted data here, tag it as such to avoid false positives.
r328411: loader.efi: add missing EFI GUIDs
r328536: loader: support for mixed-endianness ELF/loader and POWER8
r328603: Add missing non-POWERPC case to give the scr value something non-zero.
r328614: Move libstand.3 to libsa.3. Update libsa.3 to include functions
r328642: Break out the interpreters (simple and forth) w/o ifdefs.
r328769: Centralize several variables.
r328779: Retire pnp.4th and the code needed only for 4th words used here.
r328780: These 4th words were an attempt to allow integration into the boot loader scripts. However, that path won't be taken after all it seems.
r328781: Remove pcibios forth support.
r328782: Now that we no longer conditionally compile some files outside of ficl
r328783: Invent new LDR_INTERP for the loader interpreter to use.
r328806: We need more heap space to properly load newer powerpc kernels.
r328808: Implement strcoll as strcmp.
r328826: Make cross-endian loader changes apply only to powerpc
r328835: Fix regression introduced in r328806, preventing boot on many platforms.
r328911: Ignore relocation tables for non-memory-resident sections.
r328986: Fix relative location of USB sources after recent move.
r328987: A more definitions to kernel emulation shim in order to build stand/usb.
r328990: Move the stand/usb test loader into its own directory.
r328999: Fix indentation to FreeBSD standard for interp files
r329000: Move simple interpreter 'perform' into interp.c and call it
r329019: Move to tabs for indentation and to 8-space notches, per style(9).
r329050: Fix build of userboot.so
r329054: Set script.lang in the environment to either 'forth' or 'simple' to reflect what scripting language was compiled into the loader.
r329060: loader: fix endianness conversion
PR: 225323 |
329175 |
12-Feb-2018 |
kevans |
MFC Loader Fixes 2017q4p7: r324844,r326089,r326926,r326440,r326484,r326494, r326588,r326708,r326784,r326914,r327390,r328446,r326090,r326143,r326144, r326182,r326384,r326421,r326440,r326441,r326442,r326443,r326444,r326445, r326446,r326447,r326448,r326484,r326485,r326486,r326487,r326488,r326490, r326491,r326492,r326493,r326494,r326495,r326504,r326507,r326509,r326584, r326585,r326586,r326587,r326588,r326589,r326590,r326591,r326592,r326593, r326594,r326600,r326616,r326671,r326707,r326708,r326709,r326710,r326711, r326712,r326714,r326720,r326768,r326772,r326784,r326792,r326812,r326854, r326855,r326856,r326858,r326886,r326887,r326914,r326926,r326927,r326960, r326961,r326962,r326963,r327351,r327453,r327390,r327523,r327524,r326489, r327880,r328437,r328438,r328439,r328441,r328446,r328448,r328449,r328612, r328613,r328615
While here, undo our libfdt hack of not including <stdlib.h> if we're compiling _STANDALONE.
r324844: When building standalone, don't define errno. Let the definition from stand.h override. This is similar to what we do in the kernel.
r326089: loader.efi: efipart does not recognize partitionless disks
r326090: net_parse_rootpath() has no parameters
r326143: Fix theoretical integer overflow issues. If the product here is
r326144: Mark the func pointer as __dead2. It looks up loader_main, which
r326182: Modify all FreeBSD bootloaders on PowerPC AIM (Book-S) systems
r326384: Use const pointers to avoid casting away constness.
r326421: loader.efi: efipart should exclude iPXE stub block protocol
r326440: Remove stale dependency on ufsread.c
r326441: Minor flags cleanup
r326442: Cleanup CFALGS usage here
r326443: We don't need both _STAND and _STANDALONE, use the latter.
r326444: Move geli to common DO32 stuff
r326445: Fix random() and srandom() prototypes to match the standard.
r326446: Undefine _STANDALONE since this is test code.
r326447: Tweaks to the beri boot loader so that it builds w/o warnings.
r326448: Fix all warnings related to geli and ZFS support on x86.
r326484: Const poison the propname.
r326485: Delcare md_load in libofw.h. Make all prototypes match for ofw
r326486: Include machine/md_var to pick up __syncicache prototype.
r326487: Cast mdp (a vm_offset_t) to void * to match prototype.
r326488: e_entry can be smaller than a pointer. Cast it to an intptr_t
r326490: Declare our strange brand of main().
r326491: Disconnet ps3 from the build. There's too many warnings to fix.
r326492: Cast void * pointer to char * so the arg matches the %s format.
r326493: Provide a md_load64 prototype.
r326494: Mark two things as unused (since they are only sometimes used)
r326495: Now it's safe to bump WARNS to 1.
r326504: Switch to proper MK_LOADER_GELI tests.
r326507: increase maximum size of zfsboot
r326509: loader.efi: add note about iPXE into the efipart.c
r326584: When building standalone, include stand.h rather than the kernel
r326585: Include ficl.h before anything else
r326586: No need to include the userland md5.h, the kernel one is just fine.
r326587: Use the kernel relative paths, rather than the userland relative paths
r326588: Need to include skein in the include path
r326589: Make sure we include the right path for skein.h
r326590: Prefer stdint.h to inttypes.h
r326591: This isn't NetBSD specific code. Include these for any kernel /
r326592: Don't inherit CFLAGS. This a specialized test program.
r326593: Stop building with the standard system headers.
r326594: Now that we offer a semi-sane standards-ish set of #include files, stop hacking includes with sed.
r326600: Since this is contrib code, create an upstreamable version of my
r326616: dhcp_try_rfc1048() is not used any more
r326671: Avoid setting -Wno-tentative-definition-incomplete-type with gcc.
r326707: Add partial support signal.h functioanlity. Pull in machine/signal.h
r326708: Remove _KERNEL hack now that errno.h does the right thing when built standalone.
r326709: Provide implementations for iscntrl, ispunct and isgraph.
r326710: Put the files we're copying over into a few variables and clean hings up.
r326711: Const poison a couple of interfaces.
r326712: Create interp class.
r326714: boot1.c needs EFI_ZFS_BOOT too, so add it globally.
r326720: This path belongs in ficl/Makefile, not the common defines for users
r326768: Fix a comment to be more accurate
r326772: Fix regression with lua import
r326784: Revert part of 362772. It was causing problems for includes
r326792: Attempt to unbreak buildworld
r326812: Revert r326792, r326784, r326772, r326712
r326854: libefi: make efichar.h more usable in stand code
r326855: Cargo cut a fix for the regressions r326585 caused.
r326856: Fix comments after bump in size.
r326858: Revert r326855: Cargo cut a fix for the regressions r326585 caused.
r326886: Panic in sbrk if setheap hasn't been called yet. This is preferable o a mysterious crash
r326887: Remove the 'mini libstand in libstand' that util.[ch] provided.
r326914: Move loader-only defines to loader.mk from defs.mk
r326926: Move loader help file definitions to being 100% inside of loader.mk.
r326927: libficl is only ever used in a loader (never a boot) program. Move it.
r326960: Simplify things a little. The RETURN macro isn't required.
r326961: Interact is always called with NULL. Simplify code a little
r326962: Hoist btx include stuff to i386/Makefile.inc
r326963: No need to use relative paths like this here.
r327351: Fix ubldr. uboot/lib uses defines for the loader.
r327453: Add a validbcd() routine that uses the bcd2bin_data[] array
r327390: Garbage-collect loader.ps3. It is currently disconnected from the build and kboot replaces.
r327523: Don't clobber system LDFLAGS for beri boot loaders.
r327524: Use 'extern uint8_t' instead of 'extern void' for external symbols.
r326489: Allow this file to be used in libsa without warning...
r327880: Move getsecs() prototype to stand.h from net.h so it can be used
r328437: Split panic routine
r328438: Implement abort() as a call to panic.
r328439: Provide abs form stdlib.h.
r328441: abort() should be marked __dead2 since it won't return.
r328446: Now that exit is __dead2, we need to tag ub_exit() as __dead2.
r328448: Make exit() never return until host_exit can be written.
r328449: Tag unreachable places as such. I left the while (1); in place
r328612: Move strtold wrapper from strtol.c to its own strtold.c.
r328613: Kill copies of strtol and strtoul.
r328615: Update stand.h for changes for strto*l
PR: 223969 |
329146 |
12-Feb-2018 |
kevans |
MFC r326038,r326069,r326072: More stand simplification and fixes
r326038: Move some more common stuff up to Makefile.inc.
r326069: Fix gptzfsboot for cases with GELI.
r326072: Unbreak riscv build in universe. |
329145 |
12-Feb-2018 |
kevans |
MFC r325834,r325997,326502: Move sys/boot to stand/
This is effectively a direct commit to stable/11, due to differences between stable/11 and head. Changes to DTS in sys/boot/fdt/dts were often accompanied by kernel changes. Many of these were also risc-v updates that likely had many more dependencies to MFC.
Because of this, sys/boot/fdt/dts remains as-is while everything else in sys/boot relocates to stand/.
r325834: Move sys/boot to stand. Fix all references to new location
r325997: Remove empty directories.
r326502: Document the sys/boot -> stand move in hier.7 and the top-level README. |
329140 |
11-Feb-2018 |
kevans |
MFC Loader Fixes 2017q4p6: r324649,r324650,r324651,r324652,r324653,r324654, r324700,r324702,r324709,r324717,r324719,r324841,r324842,r324843,r324845, r324850,r324876,r324877,r324878,r324879,r324880,r324881,r324883,r324980, r324981,r324982,r324995,r325014,r325093,r325094,r325114,r325170,r325171, r325172,r325173,r325174,r325175,r325176,r325248,r325286,r325310,r325332, r325338,r325339,r325376,r325377,r325379,r325380,r325382,r325478,r325479, r325480,r325482,r325483,r325484,r325485,r325556,r325641,r325681,r325685, r325686,r325687,r325688,r325689,r325690,r325691,r325692,r325693,r325694, r325743,r325744,r325748,r325775,r325779,r325780
r324649: Move common/Makefile.inc to sys/boot/loader.mk.
r324650: tweak style
r324651: create defs.mk for common definitions
r324652: Move all the ficl common code into ficl.mk
r324653: LOADER_foo_SUPPORTED
r324654: Explicitly inlcude SYSDIR in the include path
r324700: loader: initialize dv_cleanup in md.c to eliminate clang warning
r324702: We need to include disk.o in libuboot.a when we're building with support for disk access.
r324709: Revert "Unify boot1 with loader" change r324646
r324717: libsa/ip.c: misplaced comment, ip_v is half char, not ip_p
r324719: libsa/ip: stop read loop on bad fragments
r324841: Use BOOTDIR more consistently in defs.mk rather than repeat sys/boot.
r324842: Introduce BOOTOBJ: The top level object directory for the boot tree
r324843: Stopgap fix to the mistmatch between LOADER_GELI_SUPPORT and LOADER_NO_GELI_SUPPORT.
r324845: Use BOOTOBJ and BOOTDIR to find geli includes and libraries.
r324850: Define LIBSA32 to LIBSA on i386 to fix build.
r324876: Move fdt and uboot defines into common uboot.mk.
r324877: End source directories with SRC rather than a hodgepodge of names
r324878: Make at91 boot loader compile again.
r324879: Prefer SRCTOP paths for bits we're grabbing from libc.
r324880: Use BOOTSRC here.
r324881: Use SYSDIR instead of ${.CURDIR}/../..<etc>/sys.
r324883: Use preferred defined paths, rather than relative paths in fdt.
r324980: Use BOOTDIR consistently.
r324981: Move BINDIR definition to defs.mk, and override where it isn't /boot
r324982: Remove sys/boot/arm/at91 and ixp425
r324995: loader.efi: Make framebuffer commands available for arm64
r325014: Add a 'place holder' arm struct efi_fb until a real one comes
r325093: Define new EFI variables
r325094: Cleanup non-arch Makefiles
r325114: Use defs.mk defins in most MD code
r325170: Use defs.mk values for userboot
r325171: Use defs.mk name and prefer bsd.init.mk
r325172: Remove the -nostdlib stuff I added. Instead, fix LDFLAGS to be honored correctly with the new Makefile.inc include order.
r325173: We don't need to build a special ficl for userboot.
r325174: Minor cleanup
r325175: For amd64, compile both zfs and zfs32 libraries.
r325176: Actually add zfs32/Makefile
r325248: loader ptblread() is broken with >512B sectors
r325286: efipart_strategy is using wrong offset with >512B sectors
r325310: zfs.c:vdev_read() needs to be careful about large sectors
r325332: loader: re-enable gzip support for x86
r325338: loader: fix BOOTSRC -> BOOTOBJ in a library path
r325339: This used to have bzip2 support too.
r325376: WIP: centralize machine links
r325377: mostly libsa
r325379: Revert "mostly libsa"
r325380: Revert "WIP: centralize machine links"
r325382: Cleanup stray libstand names to be libsa names.
r325478: Powerpc is a 32-bit boot loader.
r325479: Define LIBFICL32 to be libficl.a on i386 and libficl32.a on amd64.
r325480: Use DO32 for all the places that we need to flag we're building a 32-bit version of a library.
r325482: Move machine and other link creation to defs.mk
r325483: MACHINE can never be powerpc64, so cleanup code that thinks it can.
r325484: Prefer bsd.init.mk to src.opts.mk
r325485: Centralize all 32-bit builds on 64-bit platform stuff.
r325556: loader: set options before including bsd.init.mk
r325641: loader.efi: efi_devpath_is_prefix should return bool
r325681: boot1: avoid using NULL device path
r325685: libsa32 isn't needed for i386. It's already a 32-bit platform.
r325686: Simplify this if to a direct assignment.
r325687: Remove all the empty help files from the powerpc build.
r325688: FDT support doesn't make sense for ps3, remove it.
r325689: Remove LOADER_FDT_SUPPORT as a Makefile variable.
r325690: Remove LOADER_ZFS_SUPPORT as a Makefile variable
r325691: Remove useless PNP define here.
r325692: Replace LOADER_FIREWIRE_SUPPORT variable
r325693: Move LOADER_{NO,}_GELI_SUPPORT to MK_LOADER_GELI
r325694: Install the 4th files in sys/boot/forth instead of each loader
r325743: Make sure the proper loader.rc gets installed.
r325744: boot1: also check for NULL device
r325748: Use proper include file.
r325775: Add loader.conf to the list of files that are MD.
r325779: Add /boot/dts to the list of default modules.
r325780: Don't add /boot/dt*s* but /boot/dt*b*. Stupid think-o. |
329136 |
11-Feb-2018 |
kevans |
MFC r324648: Rename top level Makefile.ficl to ficl.mk. |
329135 |
11-Feb-2018 |
kevans |
MFC Loader Fixes 2017q4p5: r324557,r324558,r324559,r324646,r324647
r324557: Rename exit to efi_exit to avoid clashing with libsa exit definition
r324558: Define prototype for exit and ensure references
r324559: Move panic back into libsa. It's documented in libstand(3) to belong there.
r324646: Unify boot1 with loader.
r324647: Move orphaned man pages into new man directory from common. |
329134 |
11-Feb-2018 |
kevans |
MFC Loader Fixes 2017q4p4: r324552,r324553,r324554,r324555,r324556
r324552: Kill the userboot copy of libstand.
r324553: Rename libstand.a to libsa.a and libstand32.a to libsa32.a
r324554: Move crc32.c, util.c and gpt.c over to libsa.
r324555: Honor CFLAGS modifications in Makefile.inc by using += here.
r324556: Move ufsread.c |
329131 |
11-Feb-2018 |
kevans |
MFC Loader Fixes 2017q4p3: r324460,r324471
r324460: Rather than laying whack-a-mole with including the path to stand.h, always include it.
r324471: Fix typos: `stand alon{e,g}` should be spelled like `standalone` |
329129 |
11-Feb-2018 |
kevans |
MFC Loader Fixes 2017q4p1: r324321,r324359,r324360,r324388,r324449,r324450, r324451,r324452
r324321: This README file was quite relevant for FreeBSD 3 or 4. No more.
r324359: Add efi_devpath_is_prefix
r324360: Encapsulate ZFS preferences into efi_zfs_is_preferred
r324388: Unbreak building efiboot with MK_ZFS == no
r324449: Prefer ${LIBSTAND} to -lstand
r324450: Define SASRC and use it
r324451: Add missing -I${SASRC} in a couple of places so that stand.h doesn't accidentally come in via host pollution.
r324452: Define LIBSA* and use them instead of overloaded LIBSTAND |
329114 |
11-Feb-2018 |
kevans |
MFC Loader Fixes 2017q3: r320547,r320553,r321621,r321844,r321969,r321991, r322037,r322038,r322039,r322040,r322056,r322074,r322542,r322592,r322593, r322896,r322923,r323671,r322930,r322931,r322932,r322933,r322934,r322935, r322936,r322937,r322938,r322939,r322941,r323062,r323063,r323064,r323065, r323100,r323131,r323174,r323258,r323261,r323272,r323367,r323379,r323389, r323407,r323428,r323436,r323494,r323496,r323497,r323541,r323554,r323589, r323707,r323867,r323885,r323886,r323895,r323896,r323897,r323905,r323906, r323907,r323908,r323909,r323952,r323991,r324099,r324558,r326445,r326609, r326610
This batch includes a special kludge to fix powerpc loader build; <stdlib.h> was included after <stand.h> there, causing problems with DEBUG_MALLOC bits. Include <stdlib.h> a little bit earlier to fix the build with the intention of removing this when eventually libsa silently replaces stdlib.h with stand.h.
r320547: Link EFI/uboot loaders with -znotext
r320553: Integer underflow in efipart_realstrategy when I/O starts after end of disk
r321621: Always set the receive mask in loader.efi.
r321844: Clean up style in print_state(..) and pager_printf(..)
r321969: Fix the return types for printf and putchar to match their libc
r321991: Revert r321969
r322037: Add stpcpy and stpncpy to libstand
r322038: Add definitions and utilities for EFI drivers
r322039: Move EFI ZFS functions to libefi
r322040: Add EFI utility functions to libefi
r322056: Move EFI fmtdev functionality to libefi
r322074: libefi/time.c cstyle cleanup
r322542: loader.efi: repace XXX with real comments in trap.c
r322592: Remove unused defines.
r322593: Define proposed GUID for FreeBSD boot loader variables.
r322896: Make spinconsole platform independent and hook it up into EFI loader
r322923: Hide length of geli passphrase during boot.
r323671: Fix language used in the r322923.
r322930: Move efi_main into efi/loader
r322931: Cleanup efi_main return type
r322932: Use the loader.efi conventions for the various EFI tables.
r322933: No need for MK_ZFS around these: they are by their nature only active when MK_ZFS is true.
r322934: _STAND is sometimes defined on the command line. Make the define here match.
r322935: Fix warnings due to type mismatch.
r322936: Remove useless 'static' for an enum definition.
r322937: Forward declare struct dsk to avoid warnings when building libi386.
r322938: Link in libefi for boot1
r322939: Use efi_devpath_str for debug path info.
r322941: Eliminate redunant device path matching.
r323062: Make efichar.c routines available to libefi.
r323063: boot1.efi: print more info about where boot1.efi is loaded from
r323064: Exit rather than panic for most errors.
r323065: Save where we're booted from
r323100: libstand: nfs_readlink() should return proper return code
r323131: Revert r322941: Eliminate redundant device matching functions
r323174: Fix loader bug causing too many pages allocation when bootloader is U-Boot
r323258: ucs2len
r323261: Fix armv6 build
r323272: Be consistent and do return (1);
r323367: Mark init_chroot and init_script variables as deprecated.
r323379: It's been pointed out that init_script at least is useful w/o
r323389: loader.efi: chain loader should provide proper device handle
r323407: boot1 generate-fat: generate all templates at once
r323428: r323389 breaks the kernel build when WITHOUT_ZFS is defined in src.conf
r323436: boot1: remove BOOT1_MAXSIZE default value
r323494: loader should support large_dnode
r323496: libstand: tftp_open() can leak pkt on error
r323497: libefi: efipart_open should check the status from disk_open
r323541: libefi: efipart_realstrategy rsize pointer may be NULL
r323554: Increase EFI boot file size frok 128k to 384k
r323589: loader: biosmem.c cstyle cleanup
r323707: loader: biosmem allocate heap just below 4GB
r323867: libefi: devicename.c cleanups
r323885: libefi: efi_devpath_match() should return bool
r323886: libefi: efipart.c should use calloc()
r323895: libefi: efi_devpath_match local len should be unsigned
r323896: r323885 did miss efilib.h update
r323897: efilib.h: typo in structure member description
r323905: libefi: pdinfo_t pd_unit and pd_open should be unsigned
r323906: libefi: efipart_strategy() should return ENXIO when there is no media
r323907: libefi: efipart.c cstyle fix for efipart_print_common()
r323908: libefi: efipart_hdinfo_add_filepath should check strtol result
r323909: libefi: define EISA PNP constants
r323952: After the r317886 support for TFTP and NFS can be enable simultaneously.
r323991: libefi: efipart_floppy() will should not pass acpi pointer if the HID test fails
r324099: Compile loader as Little-Endian on PPC64/POWER8
r324558: Define prototype for exit and ensure references
r326445: Fix random() and srandom() prototypes to match the standard.
r326609: Make putenv and getenv match the userland definition
r326610: Fix random() prototype to match the system.
PR: 219000 221001 222215 Relnotes: yes ("The length of the geli passphrase is hidden during boot") |
329100 |
10-Feb-2018 |
kevans |
MFC Loader Fixes 2017q2: r316437,r316577,r316578,r316585,r316590,r316612, r316625,r316628,r316654,r316682,r316704,r316771,r317092,r317097,r317099, r317652,r317785,r317886,r317887,r318142,r318320,r318356,r318678,r318754, r318982,r318986,r318987,r318988,r318989,r318990,r318991,r318992,r318993, r318994,r318999,r319083,r319084,r319085,r320011,r320234,r320288,r320304, r320467,r320482
r316437: Small cleanup to make i386/loader match efi/loader boot environment code
r316577: loader: part.c cstyle cleanup
r316578: loader: want mechanism to avoid RA with bcache
r316585: loader: zfs reader should check all labels
r316590: libstand/dosfs: cache FAT32 in 128 Kb blocks to save loader memory
r316612: In r298230 the value of HEAP_MIN was changed from 3MB to 64MB. Correct a comment.
r316625: Do not use -msoft-float with intention of disabling FP on aarch64
r316628: Silence GCC warning by initializing the local variable.
r316654: loader: r316585 did miss userboot update
r316682: loader: r316585 did miss sparc/ofw
r316704: loader.efi: only fetch zfs pool guid for the actual boot device
r316771: loader: Avoid possible overflow via environment variable
r317092: loader: zfs reader vdev_probe should check for minimum device size
r317097: loader: F_READ/F_WRITE should be checked against masked flag
r317099: loader: uboot disk ioctl should call disk_ioctl
r317652: loader.efi: ResetSystem does not use data with EFI_SUCCESS
r317785: zfsboot: drvsize() may be unusable on some systems
r317886: distinguish NFS versus TFTP boot by rootpath
r317887: loader: network read rework
r318142: libstand: NULL pointer dereference in rarp
r318320: loader: add ip layer code into libstand
r318356: libstand: increase nfs max read size to 16k
r318678: Replacing iterating over rootpath by strsep(3).
r318754: Pass -N directly to ld via -Wl rather than passing it to the compiler driver.
r318982: Pass a "FREEBSD" user-class in PXE dhcp request
r318986: add a comment on vendor index 19 and 20 to avoid confusion
r318987: Support URI scheme for root-path in netbooting
r318988: Always build tftpfs support along with nfs for pxeboot
r318989: Always issue the pxe request
r318990: Partially revert r314948
r318991: Document recent changes on pxeboot
r318992: Capitalize DHCP
r318993: Use the usual FreeBSD spelling for the DHCP user class
r318994: Catch with the change in the user class
r318999: Update the comments concerning net_parse_rootpath to reflect what it is now
r319083: Followup on the user-class changes
r319084: Small cleanup in dev_net.c
r319085: use the same option list for dhcp discovery and request
r320011: Add chain loader support for loader
r320234: Make structure padding explicit in EFI_MEMORY_DESCRIPTOR
r320288: Allow Clang's integrated assembler to assemble boot0
r320304: loader.efi: Disable smbios for arm
r320467: loader: chain load relocate data declaration is bad
r320482: As with arm64 mark the EFI PE header as allocated on arm.
PR: 218473 |
329099 |
10-Feb-2018 |
kevans |
MFC Loader Fixes 2017q1: r311458,r312237,r312314,r312374,r312947,r313042, r313047,r313166,r313328,r313332,r313333,r313337,r313348,r313349,r313389, r313442,r313451,r313575,r313645,r313710,r314114,r314213,r314275,r314945, r314948,r315008,r315408,r315427,r315645,r315646,r315648,r315653,r315850, r316064,r316078,r316079,r316100,r316104,r316111,r316112,r316171,r316279, r316280,r316287,r316311,r316343,r316424,r316436
r311458: Use compiler driver to link BERI boot loaders
r312237: loader.efi: find_currdev() can leak memory
r312314: loader: move device path definitions to include/efidevp.h
r312374: loader: efi devpath api usage should be more aware of NULL pointers
r312947: Remove "-Xassembler -G0" from CFLAGS.
r313042: loader.efi environment related cleanups
r313047: loader: disk/part api needs to use uint64_t offsets
r313166: loader: libefi/env.c warnings in arm build
r313328: loader: Implement disk_ioctl() to support DIOCGSECTORSIZE and DIOCGMEDIASIZE.
r313332: loader: bcache read ahead block count should take account the large sectors
r313333: loader: Replace EFI part devices.
r313337: loader: 313329 missed ZFS guard in loader/main.c
r313348: loader: biosdisk fix for 2+TB disks
r313349: loader: disk io should not use alloca()
r313389: efipart is also using the '%S' printf format, add -Wno-format for it.
r313442: loader: possible NULL pointer dereference in efipart.c
r313451: loader: possible NULL pointer dereference in bcache.c
r313575: makefs: make the buffer functions look exactly like the kernel ones
r313645: loader: implement MEDIA_FILEPATH_DP support in efipart
r313710: loader: cstyle fixes and DIOCGMEDIASIZE should use uint64_t
r314114: Use LDFLAGS with CC instead of _LDFLAGS.
r314213: Remove control+r handling from geliboot's pwgets()
r314275: Remove unused macro from common/drv.c.
r314945: Some style(9) fixes. No functional changes.
r314948: Try to extract the RFC1048 data from PXE.
r315008: r314948 seems to be missing a variable or two that will break
r315408: loader: remove open_disk cache
r315427: loader: biosdisk should report IO error from INT13
r315645: loader: disk_cleanup was left in userboot_disk.c
r315646: loader: pxe.h constants have wrong values
r315648: libstand: verify value provided by nfs.read_size
r315653: loader: verify the value from dhcp.interface-mtu and use snprintf o set mtu
r315850: The original author abused Nd (one-line description, used by makewhatis)
r316064: Fix build with path names with 'align' or 'nop' in them.
r316078: gpt*boot: Save a bit more memory when LOADER_NO_GELI_SUPPORT is specified
r316079: Simply retire the sedification of the boot2.s file.
r316100: Remove -fno-guess-branch-probability and -fno-unit-at-a-time.
r316104: Use `NO_WCAST_ALIGN` instead of spelling it out as -Wno-cast-align in CFLAGS
r316111: loader: move bios getsecs into time.c
r316112: loader: ls command should display file types properly
r316171: xfsread inlined uses more space, so remove the inline tag.
r316279: loader: efipart should check disk size from partition table
r316280: loader: simplify efi_zfs_probe and avoid double probing for zfs.
r316287: Remove OLD_NFSV2 from loader and libstand
r316311: Add explicit_bzero() to libstand, and switch GELIBoot to using it
r316343: Implement boot-time encryption key passing (keybuf)
r316424: Fix sparc64 build broken by r316343 and r316076
r316436: Restore EFI boot environment functionality broken in r313333
PR: 216940 217298 217935 |
329011 |
08-Feb-2018 |
kevans |
MFC r307322,r307323,r307324,r307326,r307327,r307338,r307879,r307908,r307911, r307942,r307950,r307951,r307954,r307955,r308125,r308195,r308476,r308534, r308535,r308776,r308843,r310236,r310726: Loader fixes, 2016q4
r307322: Remove /boot/boot.conf, deprecated for 16 years
r307323: Remove fetching of pInterp.
r307324: Create a new linker set, Xficl_compile_set which contains a list of functions to call to register new forth words.
r307326: In UEFI mode expose the SMBIOS anchor base address via kenv
r307327: Update i386 build of loader.efi (but leave it disabled) so that we at least build it now.
r307338: Create a pcibios-version environment FORTH word.
r307879: Preliminary support for EFI in boot loader.
r307908: Fix the build on both arm64 and when WITHOUT_FORTH is defined.
r307911: Add better comment...
r307942: Really make WITHOUT_FORTH (MK_FORTH==no) work.
r307950: Add it (Makefile.ficl) to the right place
r307951: Fix two backwards tests.
r307954: Back out the move to the loader script from -N.
r307955: LIBSTAND goes last, so put it last here too.
r308125: In loader.efi, instead of exiting directly, try to fallback.
r308195: efinet_dev_print should honor verbose option.
r308476: boot/forth spelling issue in forth word
r308534: The file_loadraw function grew an argument, update install function
r308535: Add support for LOADER_RC setting in the pkgfs manifes
r308776: loader: zfs toplevel vdev must have spa set.
r308843: loader: smbios version check is not correct
r310236: Renumber license clauses to avoid skipping #3
r310726: cdboot: add explict suffix to ambiguous or instruction
PR: 214375 |
329010 |
08-Feb-2018 |
kevans |
MFC r303555,r303556,r303936,r303962,r304317,r304532,r305026,r305107,r305132, r305178,r305353,r305814,r306159,r306380,r306504: Loader fixes, 2016q3
r303555: bcache should support reads shorter than sector size
r303556: Improve boot loader quote parsing
r303936: Add kernel environment variables under smbios.system
r303962: Add the missing space between .asciz directive and opening quote for some lines with #ifdef BTXLDR_VERBOSE/#endif
r304317: boot1.efi Free() should check for NULL to provide consistent behavior
r304532: Replace sprintf -> snprintf for command_errbuf provisioned from dynamic content.
r305026: Emulate efi_cons_poll when WaitForKey is not available
r305107: Create a hook 'post-initialize' for people that want to define something to read in .conf files after all other .conf files for the purpose of overriding.
r305132: Remove accidentally committed stray comment.
r305178: bd_int13probe() should check extended info if sector info is bad
r305353: Don't use -N to set the OMAGIC with data and text writeable and data not page aligned.
r305814: ufsread: Do not cast struct direct from void *
r306159: Consistently declare getsecs(void) with proper return type and void when no arguments are present.
r306380: loader command interpreter should reset command_errmsg
r306504: Fix a cluster of bugs in list EFI environment variables
PR: 204602, 211958, 211958 Relnotes: yes ("Improve boot loader quote parsing") |
328889 |
05-Feb-2018 |
kevans |
MFC r308434, 308827
MFC r308434: Loader paged/pageable data is not always paged. MFC r308827: lsdev device name section headers should be printed by dv_print callback. |
328866 |
05-Feb-2018 |
kevans |
MFC r304321,304753,304754,306751,316077,316110: SHA512, skein, large block support for loader zfs
MFC r304321: Add SHA512, skein, large blocks support for loader zfs. MFC r304753: loader: zio_checksum_verify() must test spa for NULL pointer MFC r304754: r304321 broken bhyve zvol VM bhyveload hang 100% WCPU MFC r306751: Disable loop unrolling in skein for sys/boot MFC r316077: Unbreak compilation with gcc 4.2.1 MFC r316110: Use `-Wno-missing-declarations` with CWARNFLAGS for skein.c |
328836 |
04-Feb-2018 |
emaste |
Remove now-unused variable after r328809 |
328809 |
02-Feb-2018 |
kevans |
MFC r328504: stand/fdt: Consolidate overlay handling a little further
[This is effectively a direct commit to stable/11 due to path restructuring in HEAD. The diff against HEAD has simply been applied to the old path]
This should have been done as part of r327350, but due to lack of foresight it came later. In the different places we apply overlays, we duplicate the bits that check for fdt_overlays in the environment and supplement that with any other places we need to check for overlays to load. These "other places" will be loader specific and are not candidates for consolidation.
Provide an fdt_load_dtb_overlays to capture the common logic, allow passing in an additional list of overlays to be loaded. This additional list of overlays is used in practice for ubldr to pull in any fdt_overlays passed to it from U-Boot environment, but it can be used for any other source of overlays.
These additional overlays supplement loader.conf(5) fdt_overlays, rather than replace, so that we're not restricted to specifying overlays in only one place. This is a change from previous behavior where loader.conf(5) supplied fdt_overlays would cause us to ignore U-Boot environment, and this seems nonsensical- user should have sufficient control over both of these aspects, or lack of control for good reasons.
A knob could be considered in the future to ignore U-Boot supplied overlays, but the supplemental treatment seems like a good start. |
327944 |
13-Jan-2018 |
kevans |
MFC (conceptually) r327350: Consistently apply fdt_overlays
This is a direct commit to stable/11 due to restructuring of sys/boot => stand in -HEAD. The diff remains the same and it is simply applied to the previous location.
MFC r327350: stand/fdt: Consistently apply fdt_overlays
Overlays were previously not applied when U-Boot provides FDT or EFI provides FDT, only when we load FDT from /boot/dtb given name from U-Boot.
Make all three paths lead to loading fdt_overlays and applying them, so that fdt_overlays can be expected to Just Work. |
323485 |
12-Sep-2017 |
rlibby |
MFC r316119 (by ngie):
self_reloc.c: Pass -Wno-error=maybe-uninitialized to gcc versions greater than 4.2.1 |
323484 |
12-Sep-2017 |
rlibby |
MFC r303723 (by markj):
Fix a few cosmetic issues in boot1.efi. |
321660 |
28-Jul-2017 |
dim |
MFC r321305:
Fix printf format warning in zfs_module.c
Clang 5.0.0 got better warnings about print format strings using %zd, and this leads to the following -Werror warning on e.g. arm:
sys/boot/efi/boot1/zfs_module.c:186:18: error: format specifies type 'ssize_t' (aka 'int') but the argument has type 'off_t' (aka 'long long') [-Werror,-Wformat] "(%lu)\n", st.st_size, spa->spa_name, filepath, EFI_ERROR_CODE(status)); ^~~~~~~~~~
Fix this by casting off_t arguments to intmax_t, and using %jd instead.
Reviewed by: tsoome Differential Revision: https://reviews.freebsd.org/D11678 |
319024 |
28-May-2017 |
ngie |
MFC r309412,r316109,r316132:
r309412 (by imp):
dd is currently a bootstrap tool. It really doesn't have any business being a bootstrap tool. However, for reproducible build output, FreeBSD added dd status=none because it was otherwise difficult to suppress the status information, but retain any errors that might happen. There's no real reason that dd has to be a build tool, other than we use status=none unconditional. Remove dd from a bootstrap tool entirely by only using status=none when available. This may also help efforts to build the system on non-FreeBSD hosts as well.
r316109:
Don't hardcode input files for stage 1/2 bootloaders; use .ALLSRC instead
This is a better pattern to follow when creating the bootloaders and doing the relevant space checks to make sure that the sizes aren't exceeded (and thus, copy-pasting is a bit less error prone).
r316132:
Parameterize out 7680 (15 * 512) as BOOT2SIZE, similar to sys/boot/i386/zfsboot/...
This is being done to make it easier to change in the future--this action might be needed sooner rather than later because of gcc 6.3.0 bailing, stating that there is negative free space left (deficit) in the boot2 bootloader. |
318625 |
22-May-2017 |
ngie |
MFC r316103:
Remove redundant declarations
They're already defined in libstand.h |
318576 |
20-May-2017 |
kib |
MFC efivar(8) (by imp):
List of revisions merged: r307070 r307071 r307072 r307074 r307189 r307224 r307339 r307390 r307391 r309776 r314231 r314232 r314615 r314616 r314617 r314618 r314619 r314620 r314621 r314623 r314890 r314925 r314926 r314927 r314928 r315770 r315771
Discussed with: gjb (re), imp Sponsored by: The FreeBSD Foundation |
318480 |
18-May-2017 |
markj |
MFC r318193: Set the right variable when overriding the default console speed. |
317140 |
19-Apr-2017 |
andrew |
Fix the arm64 userland building with lld:
MFC 308124: On arm64 build the efi loader with -fPIC. Without this clang 3.9 will generate relocation in the self relocation code.
MFC 316608: Add -fPIC to the standalone build flags on arm64. This is needed as loader.efi is position independend, however we were not building it as such causing a build failure when building with lld.
MFC 315452: Mark the EFI PE header as allocated. While ld.bfd doesn't seem to care about not having this flag ld.lld fails to link without it. |
316282 |
30-Mar-2017 |
tsoome |
boot1.efi: can't boot from ZFS on 4kn HDD
The boot1.efi immediate issue from PR216964 is that we are reading into too small buffer, from UEFI spec 2.6:
The size of the Buffer in bytes. This must be a multiple of the intrinsic block size of the device.
The secondary issue is that LBA calculation does not check reminder from division.
This fix does check the provided buffer size and if we read less than media sector size or the read offset is not aligned to sector boundary, we allocate bounce buffer and perform the read by single sector.
PR: 216964 Reported by: Sergey Kozlov Reviewed by: allanjude, Sergey Kozlov Approved by: allanjude (mentor) Differential Revision: https://reviews.freebsd.org/D9870 |
316272 |
30-Mar-2017 |
dexuan |
MFC: 314547, 314770, 314828, 314891, 314956, 314962, 315235
r314547 loader.efi: reduce the size of the staging area if necessary
The loader assumes physical memory in [2MB, 2MB + EFI_STAGING_SIZE) is Conventional Memory, but actually it may not, e.g. in the case of Hyper-V Generation-2 VM (i.e. UEFI VM) running on Windows Server 2012 R2 host, there is a BootServiceData memory block at the address 47.449MB and the memory is not writable.
Without the patch, the loader will crash in efi_copy_finish(): see PR 211746.
The patch verifies the end of the staging area, and reduces its size if necessary. This way, the loader will not try to write into the BootServiceData memory any longer.
Thank Marcel Moolenaar for helping me on this issue!
The patch also allocates the staging area in the first 1GB memory. See the comment in the patch for this.
PR: 211746 Reviewed by: marcel, kib, sephe Approved by: sephe (mentor) Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D9686
r314770 loader.efi: fix recent UEFI-boot regression on physical machines
This patch fixes my recent patch "loader.efi: reduce the size of the staging area if necessary", which causes EFI-boot failure on physical machines since Mar 2: on the host there is a 1MB LoaderData memory range, which splits the big Conventional Memory range into a small one (15MB) and a big one: the small one is too small to hold the staging area.
We can actually use the LoaderData range safely, because when amd64_tramp -> efi_copy_finish() starts to run, we're almost at the very end of the efi loader code and we're going to "return" to the kernel entry, so we're pretty sure we won't access any loader data any more.
For people who are interested in the details: please see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211746#c22
PS, some people also reported the regression happened to FreeBSD VM running on Bhyve in EFI mode. This patch should resolve it too, though I don't have such a setup to test.
Reviewed by: sephe Approved by: sephe (mentor) Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D9904
r314828 loader.efi: fix an off-by-one bug in efi_verify_staging_size()
Also remove the warning message: it may not be unusual to see the memory range containing 2MB is not of EfiConventionalMemory.
Sponsored by: Microsoft
r314891 loader.efi: finally fix the off-by-one bug in efi_verify_staging_size()
r314828(loader.efi: fix an off-by-one bug in efi_verify_staging_size()) doesn't really fix the bug and this patch adds the missing part.
It's a shame that I didn't make everything correct at the very beginning...
Sponsored by: Microsoft
r314956 loader.efi: only reduce the size of the staging area on Hyper-V
Doing this on physical hosts turns out to be problematic, e.g. see comment 24 and 28 in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211746.
To fix the real underlying issue correctly & thoroughly, IMO we need a relocatable kernel, but that would require a lot of complicated long term work: https://reviews.freebsd.org/D9686?id=25414#inline-56969
For now, let's only apply efi_verify_staging_size() to VMs running on Hyper-V, and restore the old behavior on physical machines since that has been working for people for a long period of time, though that's potentially unsafe...
Sponsored by: Microsoft
r314962 loader.efi: only include the machine/ header files on x86
The 2 files may not exist on other archs like aarch64 and hence we can have a build failure there.
Reported by: lwhsu Sponsored by: Microsoft
r315235 loader.efi: use stricter check for Hyper-V
Some other hypervisors like Xen can pretend to be Hyper-V but obviously they can't implement all Hyper-V features. Let's make sure we're genuine Hyper-V here.
Also fix some minor coding style issues.
PR: 211746 Sponsored by: Microsoft
PR: 211746 |
315221 |
14-Mar-2017 |
pfg |
MFC r313982, r314068: sys: Replace zero with NULL for pointers.
Found with: devel/coccinelle |
313355 |
06-Feb-2017 |
tsoome |
MFC r309369,310850,310853:
libstand: dosfs cstyle cleanup for return keyword. dosfs support in libstand is broken since r298230
PR: 214423 Submitted by: Mikhail Kupchik Reported by: Mikhail Kupchik Approved by: imp (mentor) |
312772 |
25-Jan-2017 |
dim |
MFC r311932:
Make EFI_RESERVED_SERVICE a proper prototype
With clang 4.0.0, the EFI API header causes the following warning:
In file included from sys/boot/efi/loader/bootinfo.c:43: In file included from sys/boot/efi/loader/../include/efi.h:52: sys/boot/efi/include/efiapi.h:534:32: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes] (EFIAPI *EFI_RESERVED_SERVICE) ( ^
Add VOID to make it into a real prototype.
Reviewed by: imp, emaste, tsoome Differential Revision: https://reviews.freebsd.org/D9132 |
312769 |
25-Jan-2017 |
dim |
MFC r311933:
Use proper prototypes in struct boot_module_t
With clang 4.0.0, we are getting the following warnings about struct boot_module_t in efi's boot_module.h:
In file included from sys/boot/efi/boot1/ufs_module.c:41: sys/boot/efi/boot1/boot_module.h:67:14: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes] void (*init)(); ^ void sys/boot/efi/boot1/boot_module.h:92:16: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes] void (*status)(); ^ void sys/boot/efi/boot1/boot_module.h:95:24: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes] dev_info_t *(*devices)(); ^ void 3 errors generated.
Fix this by adding 'void' to the parameter lists. No functional change.
Reviewed by: emaste, imp, smh Differential Revision: https://reviews.freebsd.org/D9144 |
312556 |
20-Jan-2017 |
emaste |
MFC r310267: Deduplicate loader vers.c Makefile rules
The Makefile rule to create vers.c for loader version info was previously duplicated in each of the various loader Makefiles. Instead, share a common rule in Makefile.inc.
Sponsored by: The FreeBSD Foundation |
312349 |
17-Jan-2017 |
gonzo |
MFC r311888, r311890-r311891
r311888: [efi] Fix off-by-one error in ARM .bss zeroing code in loader's _start
__bss_end should not be included in .bss zeroing code. Otherwise first 4 bytes of the section that follows .bss (in loader's case it's .sdata) are overwritten by zero.
Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D9108
r311890: [efi] Fix .rel.data.* being erroneously merged into .data on ARM
Fix section pattern code to exclude .rel.data.* sections from being merged into .data. Otherwise relocations in those sections are lost in final binary
Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D9108
r311891: [efi] Build EFI bits with -fPIC on ARM
clang 3.9.0 without -fPIC generates absolute jump table for switch/case statement which trips boot1.efi and loader.efi on ARM platform.
Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D9108 |
312318 |
17-Jan-2017 |
emaste |
MFC r310225: Reduce boot loader version string duplication
Instead of repeating "%s, Revision %s" "(%s %s)" in each loader, just create the full version string in vers.c |
310827 |
30-Dec-2016 |
emaste |
MFC r306264: Use 32-bit value for .text padding, for linker portability
GNU ld interprets the padding value as a variable-length byte string, while GNU gold and LLVM lld interpret it as a 32-bit value. |
310825 |
30-Dec-2016 |
emaste |
MFC r305854: Use arch-specific .text padding fill value in EFI loaders
The fill pattern was previously an ia64 instruction sequence. Presumably ia64's linker script was copied as a starting point. |
307916 |
25-Oct-2016 |
bapt |
MFC r307787:
Fix typo in the COMPILER_VERSION check
PR: 213120 Submitted by: Yuta Satoh <nigoro.dev@gmail.com> |
307632 |
19-Oct-2016 |
bapt |
MFC: 304677, 304680, 305125, 305770, 305769
r304677: Add tftpfs support for the EFI loader
Allow netbooting on efi without having to setup any NFS server by rebuilding the loader with LOADER_TFTP_SUPPORT like for the i386 pxeloader
r305125: Netboot: allow both tftpfs and nfs in both pxeboot and loader.efi
Add a new 'netproto' variable which can be set for now to NET_TFTP or NET_NFS (default to NET_NONE)
From the dhcp options if one sets the root-path option to: "ip:path", the loader will consider it is booting over NFS (meaning same behaviour as the default current behaviour)
if the dhcp option "tftp server address" is set (option 150) the loader will consider it is booting over tftpfs, it will then consider the root-path options with 2 possible case 1. "path" then the IP of the tftp server will be the one passed by the option 150, and the files will be retrieved under "path" on the tftp server 2. "ip:path" then the IP of the tftp server will be the one passed in the option "overwritting the IP from the option 150.
We could not "abuse" the rootpath option in the form or tftp://ip:path because this is already used for other purpose by iPXE preventing any chainload from iPXE to the FreeBSD loader.
Given at each open(), the loader loops over all available filesystems and keep the "best" error, we needed to prevent tftpfs to fallback on nfs and vice versa. the tftpfs and nfs implementation in libstand now return EINVAL early if 'netproto' for that purpose.
Relnotes: yes Sponsored by: Gandi.net |
306738 |
05-Oct-2016 |
kib |
MFC r306090: Simple post-mortem reporter for amd64 loader.efi. |
306317 |
25-Sep-2016 |
kib |
MFC r305943: Utilize pmap.h names. |
306315 |
25-Sep-2016 |
kib |
MFC r305941: Add double-inclusion protection.
MFC r305947: Add comment for the closing guard. |
305845 |
15-Sep-2016 |
emaste |
MFC r305160: Set UEFI boot loader PE/COFF timestamps to known value for reproducible builds
Sponsored by: The FreeBSD Foundation |
305779 |
13-Sep-2016 |
will |
MFC r305484:
loader.efi: Bump the staging size to 64M.
This is required on my system, which loads nvidia, vmm, and zfs, and 48M is no longer enough for that. nvidia-driver's recent update increased its size by several megabytes. |
305537 |
07-Sep-2016 |
andrew |
MFC 304801: Don't set *dev in the zfs root case, it may be NULL and will correctly be set later in the function. This fixes a potential NULL pointer dereference found on arm64.
Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation |
305377 |
04-Sep-2016 |
manu |
MFC 304222
Only use WaitForKeys event if it exists, this is not the case in u-boot efi implementation. |
305376 |
04-Sep-2016 |
manu |
MFC 304221 and 304271
Use %ju modifier for u_int64_t and %jd modifier for off_t. off_t is long long on arm32 and long on amd64
Correctly print and cast u_int64_t and off_t. |
304507 |
19-Aug-2016 |
jhb |
MFC 304018: Add defines needed to export SMBIOS serial numbers
Some defines needed for exporting serial numbers from the SMBIOS were missed during integration of SMBIOS support in the EFI boot loader (r281138). This is needed for getting the hostid set from the system hardware UUID.
PR: 206031 |
303333 |
26-Jul-2016 |
manu |
MFC: r303039
Do not use TERM_EMU on arm and arm64 as it doesn't behave well with serial console.
Approved by: re (gjb) |
302408 |
08-Jul-2016 |
gjb |
Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle. Prune svn:mergeinfo from the new branch, as nothing has been merged here.
Additional commits post-branch will follow.
Approved by: re (implicit) Sponsored by: The FreeBSD Foundation |
302335 |
04-Jul-2016 |
emaste |
boot1.efi: fix assignment / comparison expression
PR: 210706 Submitted by: David Binderman <dcb314@hotmail.com> Approved by: re (kib) MFC after: 1 week
|
301995 |
17-Jun-2016 |
manu |
Print a message when disks are found but no logical partition are reported by EFI implementation. This address comment on r301714.
Approved by: re (gjb), andrew (mentor) Differential Revision: https://reviews.freebsd.org/D6787
|
301714 |
09-Jun-2016 |
manu |
Print a message when the efi disk isn't a logical partition.
Approved by: andrew (mentor) Differential Revision: https://reviews.freebsd.org/D6782
|
301706 |
08-Jun-2016 |
andrew |
Also set -fshort-wchar on arm64, this fixes parsing strings from UEFI, e.g. on the command line.
Sponsored by: ABT Systems Ltd
|
301703 |
08-Jun-2016 |
andrew |
Print the newline character along with the carriage return when TERM_EMU is disabled. Without this we print all lines over top of each other.
Sponsored by: ABT Systems Ltd
|
301702 |
08-Jun-2016 |
andrew |
Allow libefi to be built with TERM_EMU undefined. There were a few places where we assumed TERM_EMU was defined but didn't check. Fix these by also including them under the ifdefs.
As HO is called from loader we need a null implementation so loader.efi doesn't need to know which version of libefi it is building against.
Sponsored by: ABT Systems Ltd
|
301306 |
04-Jun-2016 |
andrew |
Use the UEFI event timer to update the time on arm and arm64. The current code uses the GetTime function from the Runtime Service, however this has been shown to not return a useable time on many arm64 UEFI implementations.
Reviewed by: jhb, smh Sponsored by: ABT Systems Ltd Differential Revision: https://reviews.freebsd.org/D6709
|
300866 |
27-May-2016 |
ambrisko |
If the I/O offset and length is multiple of the media size then directly pass the request otherwise use a buffer that is a multiple of the media size. This speeds up I/O quite a bit when using large transfer sizes on 4Kn disks etc.
MFC after: 1 week
|
300810 |
26-May-2016 |
jhb |
Fix unit number of EFI net interfaces and ignore psuedo network interfaces.
In r277943, the efinet_match() routine was changed to use an off by one when matching network interfaces. The effect was that using "net1" actually used the device attached to "net0".
Digging into the hardware that needed this workaround more, I found that UEFI was creating two simple network protocol devices for each physical NIC. The first device was a "raw" Ethernet device and the second device was a "IP" device that used the IP protocol on top of the underlying "raw" device. The PXE code in the firmware used the "IP" device to pull across the loader.efi, so currdev was set to "net1" when booting from the physical interface "net0". (The loaded image's device handle referenced the "IP" device that "net1" claimed.)
However, the IP device isn't suitable for doing raw packet I/O (and the current code to open devices exclusively actually turns the "IP" devices off on these systems).
To fix, change the efinet driver to only attach to "raw" devices. This is determined by fetching the DEVICE_PATH for each handle which supports the simple network protocol and examining the last node in the path. If the last node in the path is a MAC address, the device is assumed to be a "raw" device and is added as a 'netX' device. If the last node is not a MAC address, the device is ignored.
However, this causes a new problem as the device handle associated with the loaded image no longer matches any of the handles enumerated by efinet for systems that load the image via the "IP" device. To handle this case, expand the logic that resolves currdev from the loaded image in main(). First, the existing logic of looking for a handle that matches the loaded image's handle is tried. If that fails, the device path of the handle that loaded the loaded image is fetched via efi_lookup_image_devpath(). This device path is then walked from the end up to the beginning using efi_handle_lookup() to fetch the handle associated with a path. If the handle is found and is a known handle, then that is used as currdev. The effect for machines that load the image via the "IP" device is that the first lookup fails (the handle for the "IP" device isn't claimed by efinet), but walking up the image's device path finds the handle of the raw MAC device which is used as currdev.
With these fixes in place, the hack to subtract 1 from the unit can now be removed, so that setting currdev to 'net0' actually uses 'net0'.
PR: 202097 Tested by: ambrisko Sponsored by: Cisco Systems
|
300791 |
26-May-2016 |
jhb |
Use a unique error message if we fail to find the simple network protocol.
While here, fix the various net driver callbacks to return early instead of crashing if this fails. (The 'init' callback from the netif interface doesn't return an error if the protocol lookup fails.)
Sponsored by: Cisco Systems
|
300790 |
26-May-2016 |
jhb |
Apply the printf %S band-aid for efinet.c to fix the arm64 build.
|
300789 |
26-May-2016 |
jhb |
Remove second copy of the -Wno-format band-aid for printf %S.
|
300785 |
26-May-2016 |
jhb |
Use routines from the recently added devpath.c.
These efipart layer did several devpath related operations inline. This just switches it over to using shared code for working with device paths.
Sponsored by: Cisco Systems
|
300782 |
26-May-2016 |
jhb |
Output the device path description for EFI network devices.
Lookup the DEVICE_PATH for each EFI network device handle and output the string description using printf with '%S'. To honor the pager, the newline at the end of each line is still output with pager_output().
Sponsored by: Cisco Systems
|
300780 |
26-May-2016 |
jhb |
Add some routines for working with EFI DEVICE_PATH objects.
- efi_lookup_devpath() uses the DEVICE_PATH_PROTOCOL to obtain the DEVICE_PATH for a given EFI handle. - efi_lookup_image_devpath() uses the LOADED_IMAGE_DEVICE_PATH_PROTOCOL to lookup the device path of the device used to load a loaded image. - efi_devpath_name() uses the DEVICE_PATH_TO_TEXT_PROTOCOL to generate a string description of a device path. The returned string is a CHAR16 string that can be printed via the recently added '%S' format in libstand's printf(). Note that the returned string is returned in allocated storage that should be freed by calling efi_free_devpath_name(). - efi_devpath_last_node() walks a DEVICE_PATH returning a pointer to the final node in the path (not counting the terminating node). That is, it returns a pointer to the last meaninful node in a DEVICE_PATH. - efi_devpath_trim() generates a new DEVICE_PATH from an existing DEVICE_PATH. The new DEVICE_PATH does not include the last non-terminating node in the original path. If the original DEVICE_PATH only contains the terminating node, this function returns NULL. The caller is responsible for freeing the returned DEVICE_PATH via free(). - efi_devpath_handle() attempts to find a handle that corresponds to a given device path. However, if nodes at the end of the device path do not have valid handles associated with them, this function will return a handle that matches a node earlier in the device path. In particular, this function returns a handle for the node closest to the end of the device path which has a valid handle.
Sponsored by: Cisco Systems
|
300634 |
25-May-2016 |
cem |
efi loader: Match format string to EFI_ERROR_CODE()
Silence a format specifier warning.
Sponsored by: EMC / Isilon Storage Division
|
300330 |
20-May-2016 |
imp |
Large improvements to efi-show (though some weird problems linger). We now print only printable characters for the values and we print ascii strings as strings.
|
300329 |
20-May-2016 |
imp |
Implement efi-set and efi-unset
|
300328 |
20-May-2016 |
imp |
Cleanup to use %S.
|
300216 |
19-May-2016 |
imp |
Fix logic error so UEFI variables are reported correctly without error at the end.
|
300150 |
18-May-2016 |
pfg |
Minor spelling fixes.
|
300117 |
18-May-2016 |
imp |
Fix several instances where the boot loader ignored pager_output return value when it could return 1 (indicating we should stop). Fix a few instances of pager_open() / pager_close() not being called. Actually use these routines for the environment variable printing code I just committed.
|
300116 |
18-May-2016 |
imp |
Fix build breakage on arm64 by papering over the problem. We implement a slightly non-standard %S that's more useful in the UEFI environment, so ignore printf errors. There's no good cast to use. We'll need to revisit this in the future.
|
300081 |
17-May-2016 |
imp |
Implement UEFI set environment variable, as well as exporting the EFI version. This is also scriptable, though additional scripting will be needed.
Differential Review: https://reviews.freebsd.org/D4494 MFC After: 3 days
|
300056 |
17-May-2016 |
imp |
It sure would be nice to use printf with wide strings. Implement %S to do that. The C_WIDEOUT flag indicates that the console supports it. Mark the EFI console as supporting this.
MFC After: 3 days
|
299972 |
16-May-2016 |
pfg |
libefi: Tag an unreachable switch default.
Coverity reports an uninitialized "len" in case the switch defaults without hitting any case. Respect the original intent and quell the false positive with the relatively new __unreachable() builtin.
CID: 1347796
|
299098 |
05-May-2016 |
cem |
efipart: Support an arbitrary number of partitions
Don't crash if the user has more than 31 of them. A follow-up to r298230.
Reviewed by: allanjude Relnotes: maybe Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D6212
|
298900 |
01-May-2016 |
allanjude |
bcache read ahead may attempt to read past end of disk
The new bcache code does not know the size of the disk, and therefore may attempt to read past the end of the disk while trying to fill its read-ahead cache.
This is usually not an issue, it fails gracefully on all of my machines, but some BIOSes seem to retry the reads for up to 30 seconds each, resulting in a long stall during boot
Submitted by: Toomas Soome <tsoome@me.com> Reviewed by: jhb, np Differential Revision: https://reviews.freebsd.org/D6109
|
298826 |
30-Apr-2016 |
pfg |
sys/boot: spelling fixes in comments.
No functional change.
|
298309 |
19-Apr-2016 |
pfg |
sys/boot: use our nitems() macro when it is available through param.h.
No functional change, only trivial cases are done in this sweep,
Discussed in: freebsd-current
|
298230 |
18-Apr-2016 |
allanjude |
A new implementation of the loader block cache
The block cache implementation in loader has proven to be almost useless, and in worst case even slowing down the disk reads due to insufficient cache size and extra memory copy. Also the current cache implementation does not cache reads from CDs, or work with zfs built on top of multiple disks. Instead of an LRU, this code uses a simple hash (O(1) read from cache), and instead of a single global cache, a separate cache per block device. The cache also implements limited read-ahead to increase performance. To simplify read ahead management, the read ahead will not wrap over bcache end, so in worst case, single block physical read will be performed to fill the last block in bcache.
Booting from a virtual CD over IPMI: 0ms latency, before: 27 second, after: 7 seconds 60ms latency, before: over 12 minutes, after: under 5 minutes.
Submitted by: Toomas Soome <tsoome@me.com> Reviewed by: delphij (previous version), emaste (previous version) Relnotes: yes Differential Revision: https://reviews.freebsd.org/D4713
|
297954 |
14-Apr-2016 |
imp |
Deprecate using hints.acpi.0.rsdp to communicate the RSDP to the system. This uses the hints mechnanism. This mostly works today because when there's no static hints (the default), this value can be fetched from the hint. When there is a static hints file, the hint passed from the boot loader to the kernel is ignored, but for the BIOS case we're able to find it anyway. However, with UEFI, the fallback doesn't work, so we get a panic instead.
Switch to acpi.rsdp and use TUNABLE_ULONG_FETCH instead. Continue to generate the old values to allow for transitions. In addition, fall back to the old method if the new method isn't present.
Add comments about all this.
Differential Revision: https://reviews.freebsd.org/D5866
|
297872 |
12-Apr-2016 |
emaste |
boot1: regenerate FAT templates after r297871
Sponsored by: The FreeBSD Foundation
|
297871 |
12-Apr-2016 |
emaste |
boot1.efifat: provide a fallback startup.nsh
In case the firmware falls through to executing startup.sh, populate it with the name of our boot loader. In normal operation this should not be necessary but may allow the system to boot if it would otherwise just remain at a shell prompt.
Reviewed by: andrew, imp, smh MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5878
|
296892 |
15-Mar-2016 |
imp |
ms_abi is supported with gcc 4.5 or newer, so build it with gcc if it is 4.5 or newer.
|
296769 |
12-Mar-2016 |
emaste |
boot/efi: Prefer nm to objdump
Both objdump and nm are equally capable of reporting undefined symbols.
This gets us a step closer to building without binutils as we have an nm implementation from ELF Tool Chain.
Reviewed by: bdrewery MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5613
|
296713 |
12-Mar-2016 |
andrew |
Print the correct size of loader.efi when failing to load it into memory.
Obtained from: AsiaBSDCon Sponsored by: ABT Systems Ltd
|
296706 |
11-Mar-2016 |
bdrewery |
Add more .NOMETA missed in r291320
Sponsored by: EMC / Isilon Storage Division
|
296517 |
08-Mar-2016 |
emaste |
boot1.efi: use += to append to LDFLAGS
This is for consistency with loader.efi's Makefile and simplifies some out-of-tree experimentation.
|
295989 |
24-Feb-2016 |
bdrewery |
DIRDEPS_BUILD: Regenerate without local dependencies.
These are no longer needed after the recent 'beforebuild: depend' changes and hooking DIRDEPS_BUILD into a subset of FAST_DEPEND which supports skipping 'make depend'.
Sponsored by: EMC / Isilon Storage Division
|
295869 |
21-Feb-2016 |
andrew |
Make efi_time and EFI_GetTimeOfDay static, neither are used by other parts of the efi code.
Sponsored by: ABT Systems Ltd
|
295842 |
20-Feb-2016 |
andrew |
Add a missing call to dev_cleanup from the arm64 loader.efi.
Sponsored by: ABT Systems Ltd
|
295757 |
18-Feb-2016 |
emaste |
Remove dd xfer stats emitted during buildworld
They result in gratuitous differences when comparing build log output.
|
295650 |
16-Feb-2016 |
bdrewery |
DIRDEPS_BUILD: Update dependencies.
Sponsored by: EMC / Isilon Storage Division
|
295420 |
09-Feb-2016 |
andrew |
Ensure the bss is aligned to a 4-byte address as we use 4-byte aligned 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
|
295408 |
08-Feb-2016 |
imp |
Implement -P for boot loader. It's a bit easier to implement here than 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
|
295356 |
06-Feb-2016 |
smh |
Fix EFI platform build failures
With warnings now enabled some plaforms where failing due to warnings. * Fix st_size printed as a size_t when its actually an off_t. * Fix pointer conversion in load_elf for some 32bit platforms due to 64bit off in ef.
MFC after: 2 days X-MFC-With: Sponsored by: Multiplay
|
295320 |
05-Feb-2016 |
smh |
Fix EFI multi device boot support
Fix EFI boot support when presented with multiple valid boot partitions across multiple devices.
It now prefers to boot from partitions that are present on the underlying device that the boot1 image was loaded from. This means that it will boot from the partitions on device the user chose from EFI boot menu in preference to those on other devices.
Also fixed is the recovery from a failed attempt to boot, from a seemingly valid partition, by continuing to trying all other available partitions no matter what the error.
boot1 now use * to signify a partition what was accepted from the preferred device and + otherwise.
Finally some error messages where improved and DPRINTF's with slowed boot to aid debugging.
ZFS will still be preferred over UFS when both are available on the boot device.
Reviewed by: imp MFC after: 1 week Sponsored by: Multiplay Differential Revision: https://reviews.freebsd.org/D5108
|
295210 |
03-Feb-2016 |
andrew |
Still open the network interface when EFI_OPEN_PROTOCOL_EXCLUSIVE failed. Not all UEFI implementations support this protocol.
|
295144 |
02-Feb-2016 |
andrew |
Add suppor to loader.efi to load files off hte network. For this we need 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
|
294769 |
26-Jan-2016 |
imp |
Allow new lines as white space for arguments that are parsed to allow 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
|
294768 |
26-Jan-2016 |
imp |
Read in /boot/config and /boot.config, like all the other boot loaders and pass it along to /boot/loader.efi.
Differential Revision: https://reviews.freebsd.org/D5038
|
294767 |
26-Jan-2016 |
imp |
Parse the command line arguments, and do it before we initialize the console so it can be changed by the command line arguments.
Differential Revision: https://reviews.freebsd.org/D5038
|
294765 |
26-Jan-2016 |
imp |
Move all the separate copies of the same strings into paths.h. There's nothing machine specific about these.
Differential Revision: https://reviews.freebsd.org/D5038
|
294493 |
21-Jan-2016 |
smh |
Fix EFI UFS caching
EFI was mixing caching in two separate places causing issues when multiple partitions where tested.
Eliminate this by removing fsstat and re-factoring fsread into fsread_size, adding basic parameter validation.
Also: * Enhance some error print outs. * Fix compilation under UFS1_ONLY and UFS2_ONLY * Use sizeof on vars instead of structs. * Add basic parameter validation to fsread_size.
MFC after: 1 week X-MFC-With: r293268 Sponsored by: Multiplay Differential Revision: https://reviews.freebsd.org/D4989
|
294291 |
18-Jan-2016 |
andrew |
Reset the filesystem cache before reading from a potentially new filesystem. Without this we only read from the first UFS filesystem we find, caching the result.
X-MFC with: The recent boot1.efi changes
|
294284 |
18-Jan-2016 |
emaste |
boot1: correct typo in error message
|
294265 |
18-Jan-2016 |
smh |
Fix EFI_DEBUG option
Fix broken DPRINTF and wire up EFI_DEBUG so -DEFI_DEBUG to make works.
MFC after: 2 weeks X-MFC-With: r293268 Sponsored by: Multiplay
|
294073 |
15-Jan-2016 |
allanjude |
Connect the ZFS boot environment menu to the UEFI loader
MFC after: 3 days Sponsored by: ScaleEngine Inc.
|
294068 |
15-Jan-2016 |
smh |
Add EFI ZFS boot support
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
|
294060 |
15-Jan-2016 |
smh |
Modularise EFI boot loader
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
|
294029 |
14-Jan-2016 |
smh |
Only build EFI components on supported compilers
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
|
294028 |
14-Jan-2016 |
smh |
Revert r293903
Revert r293903 as EFI shouldn't be built on this platform that the this was reported on.
Sponsored by: Multiplay
|
293903 |
14-Jan-2016 |
smh |
Fix GCC warnings causing build failure after r293724
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
|
293796 |
13-Jan-2016 |
smh |
Fix typo in libefi.c
Fix a typo in libefl.c (removal or L) introduced by r293724
MFC after: 2 weeks X-MFC-With: r293268 Sponsored by: Multiplay
|
293724 |
12-Jan-2016 |
smh |
Enable warnings in EFI boot code
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
|
293461 |
09-Jan-2016 |
smh |
Remove hidden "Not ufs" printfs from boot code
Remove the printf("Not ufs\n") from the boot code which was hidden by the local printf implementations, allowing these to have that code removed too.
MFC after: 2 weeks X-MFC-With: r293268 Sponsored by: Multiplay
|
293460 |
09-Jan-2016 |
smh |
Switch EFT boot1 to use libstand
ARM and i386 already required libstand so switch to using it for all patforms, allowing the removal of custom print and memory methods.
This is also a pre-cursor to enabling WARNS which highlighted a number of issues with the removed methods.
MFC after: 2 weeks X-MFC-With: r293268 Sponsored by: Multiplay
|
293429 |
08-Jan-2016 |
emaste |
Avoid unintended $FreeBSD$ expansion in generate-fat.sh
|
293425 |
08-Jan-2016 |
emaste |
Add safety belt for boot1.efi file size
Reviewed by: smh Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D4833
|
293422 |
08-Jan-2016 |
smh |
Update generated efi boot image templates
r279533 increased the boot1 size from 64k to 128k but didn't regenerate the fat templates, hence the change was never activated.
With recent and upcoming changes the efi boot1 binary is now > 64k.
To avoid fat corruption in the created boot images regenerate the templates to activate the boot1 size increase.
MFC after: 2 weeks X-MFC-With: r293268
|
293274 |
06-Jan-2016 |
smh |
style(9) fixes for EFI boot
Fix some style(9) nits for EFI boot code, no functional changes.
MFC after: 2 weeks X-MFC-With: r293268 Sponsored by: Multiplay
|
293268 |
06-Jan-2016 |
smh |
Fix _MSC_EXTENSIONS checks
Use #ifdef instead of #if checks to prevent warnings generated by checks to be enabled shortly.
MFC after: 2 weeks Sponsored by: Multiplay
|
293245 |
06-Jan-2016 |
emaste |
loader.efi style(9) cleanup
Submitted by: smh
|
293244 |
06-Jan-2016 |
emaste |
Introduce and use new EFI_ERROR_CODE macro for EFI errors
Submitted by: smh MFC after: 1 week
|
293233 |
06-Jan-2016 |
emaste |
loader.efi: add terminal emulation support
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
|
293165 |
04-Jan-2016 |
emaste |
loader.efi: support non-contiguous console modes
Submitted by: Toomas Soome <tsoome@me.com> MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D4760
|
292625 |
22-Dec-2015 |
emaste |
Revert accidental whitespace changes included with r292623
|
292623 |
22-Dec-2015 |
emaste |
Support a.out format in nlist only on i386
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
|
292584 |
22-Dec-2015 |
ian |
Set env vars from values on the efi loader command line.
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
|
292576 |
21-Dec-2015 |
emaste |
boot1.efi: show EFI error number, not full status value
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
|
292563 |
21-Dec-2015 |
emaste |
loader.efi: strip trailing whitespace
Sponsored by: The FreeBSD Foundation
|
292515 |
20-Dec-2015 |
emaste |
loader.efi: refresh size in GetMemoryMap retry loop
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
|
292471 |
19-Dec-2015 |
imp |
Pass the UEFI system table into the kernel from the boot loader via the FW_HANDLE metadata item. The kernel can get the rest of what it needs from this.
|
292442 |
18-Dec-2015 |
emaste |
loader.efi: show EFI error number, not full status value
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
|
292338 |
16-Dec-2015 |
emaste |
UEFI: combine GetMemoryMap and ExitBootServices and retry on error
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
|
291563 |
01-Dec-2015 |
bdrewery |
META MODE: Update dependencies with 'the-lot' and add missing directories.
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
|
288372 |
29-Sep-2015 |
jhb |
Use EFI page size constants instead of hardcoding 4096.
Reviewed by: emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D3692
|
288228 |
25-Sep-2015 |
bdrewery |
META_MODE: Remove DEP_MACHINE from Makefile.depend files.
This has not been needed since r246865 in projects/bmake.
Sponsored by: EMC / Isilon Storage Division
|
288226 |
25-Sep-2015 |
bdrewery |
META_MODE: Remove DEP_RELDIR from Makefile.depend files.
This has not been needed since r284171 in projects/bmake.
Sponsored by: EMC / Isilon Storage Division
|
287934 |
17-Sep-2015 |
jhb |
The EFI boot loader allocates a single chunk of contiguous memory to 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
|
287930 |
17-Sep-2015 |
jhb |
Various small cleanups to EFI loader Makefiles.
Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D3641
|
287538 |
07-Sep-2015 |
marcel |
As expected, things aren't as simple as hoped. Consequently, we have 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)
|
287489 |
05-Sep-2015 |
marcel |
Auto-detect the UGA frame buffer and stride on a MacBook. We're 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...
|
287475 |
05-Sep-2015 |
marcel |
My MacBook has UGA only, but we fail to detect any changes 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.
|
287422 |
03-Sep-2015 |
marcel |
For UGA, the frame buffer address obtained by scanning the 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
|
287365 |
01-Sep-2015 |
andrew |
Install the forth bits on arm64. For now limit it to just arm64 as on x86 these should have been installed as part of the regular loader.
|
287317 |
31-Aug-2015 |
marcel |
Add support for the UGA draw protocol. This includes adding a 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
|
287299 |
30-Aug-2015 |
marcel |
Add a gop command to help diagnose VT efifb problems. The gop 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>
|
287227 |
27-Aug-2015 |
imp |
Use CFLAGS_NO_SIMD in preference to varying lists of -mno-xxxx flags. Go ahead and defined -D_STANDALONE for all targets (only strictly needed for some architecture, but harmless on those it isn't required for). Also add -msoft-float to all architectures uniformly rather that higgley piggley like it is today.
Differential Revision: https://reviews.freebsd.org/D3496
|
286967 |
20-Aug-2015 |
imp |
The flags -mno-aes -mno-avx only exist for clang, not gcc, so add them only to the clang CFLAGS.
|
285246 |
07-Jul-2015 |
emaste |
Avoid creating invalid UEFI device path
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>
|
284345 |
13-Jun-2015 |
sjg |
Add META_MODE support.
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
|
284266 |
11-Jun-2015 |
andrew |
Pass the ACPI table pointer to the arm64 kernel from loader.efi.
Sponsored by: The FreeBSD Foundation
|
282896 |
14-May-2015 |
andrew |
Remove OUTPUT_FORMAT from theARM EFI linker script, it breaks building for big-endian arm.
|
282728 |
10-May-2015 |
ian |
Don't check the return value from self_reloc(), it can't fail and doesn't 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).
|
282727 |
10-May-2015 |
ian |
The self-relocation code is not efi-specific, move it to boot/common.
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
|
282477 |
05-May-2015 |
andrew |
Add FDT to the list of known GUIDs.
|
282474 |
05-May-2015 |
andrew |
Disable the use of floating-point and vector registers in the loader. They need the vfp unit to be enabled which may not be the case.
|
282470 |
05-May-2015 |
andrew |
When cross-building ${LIBSTAND} may be set to the host copy. Point to the version built with the toolchain.
Differential Revision: https://reviews.freebsd.org/D2312 Submitted by: jhb
|
281527 |
14-Apr-2015 |
andrew |
* Remove the wfi when the efi loader returns, it's unneeded and is not available on older designs. * Enable the efi loader on arm
|
281526 |
14-Apr-2015 |
andrew |
Add support for arm64 to loader.efi and boot1.efi
Reviewed by: emaste Sponsored by: The FreeBSD Foundation
|
281525 |
14-Apr-2015 |
andrew |
Fix the arm64 MACHINE_CPUARCH value in the efi fdt glue code.
Sponsored by: The FreeBSD Foundation
|
281524 |
14-Apr-2015 |
andrew |
Use MACHINE in the efi loader when it is what we mean, it may not be the same as MACHINE_CPUARCH, it just happened to be the case the architectures this code currently supports.
Sponsored by: The FreeBSD Foundation
|
281496 |
13-Apr-2015 |
andrew |
Create the correct symlinks for the machine directory, and only create the 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
|
281435 |
11-Apr-2015 |
andrew |
Add fdt support to the arm loader.efi
|
281434 |
11-Apr-2015 |
andrew |
Only add -fPIC to CFLAGS and -Wl,-znocombreloc to LDFLAGS on x86, they shouldn't be used on arm.
|
281433 |
11-Apr-2015 |
andrew |
Move reloc.c to the top level Makefile as it has become generic.
|
281431 |
11-Apr-2015 |
andrew |
Update the arm efi ldscript to generate a valid efi binary
|
281377 |
10-Apr-2015 |
emaste |
Add build support for i386 loader.efi
Kernel changes are required for this to be useful but this will allow others to experiment.
Differential Revision: https://reviews.freebsd.org/D2276
|
281376 |
10-Apr-2015 |
emaste |
Limit EFI framebuffer metadata to amd64 for now
The i386 loader.efi does not yet exist. Avoid dealing with vt and framebuffer issues there until the initial bootstrapping is done.
|
281357 |
10-Apr-2015 |
andrew |
Port the EFI reloc codeto work on arm64. This used the rela relocation table so wiill need the addend included in the relocation calculation.
Sponsored by: The FreeBSD Foundation
|
281322 |
09-Apr-2015 |
emaste |
Remove EOL whitespace from i386 EFI loader source
|
281307 |
09-Apr-2015 |
andrew |
Print error values with hex to make it easier to find the EFI error type.
|
281300 |
09-Apr-2015 |
andrew |
Only use -fPIC when building boot1.efi for x86.
Sponsored by: The FreeBSD Foundation
|
281238 |
07-Apr-2015 |
emaste |
Add EFI boot1 for i386
loader.efi still needs work, but boot1.efi now builds.
Differential Revision: https://reviews.freebsd.org/D2244 Reviewed by: rpaulo Sponsored by: The FreeBSD Foundation
|
281237 |
07-Apr-2015 |
emaste |
EFI: use common reloc.c for all architectures
Much of this file is common to the architectures we support, so share an implementation by adding a little #ifdef-ery.
Differential Revision: https://reviews.freebsd.org/D2241 Reviewed by: imp Sponsored by: The FreeBSD Foundation
|
281169 |
06-Apr-2015 |
andrew |
Make global variabled only used in this file static.
|
281156 |
06-Apr-2015 |
andrew |
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
|
281138 |
06-Apr-2015 |
rpaulo |
SMBIOS support for EFI.
MFC after: 1 week
|
281117 |
05-Apr-2015 |
andrew |
Move boot1.efi to the global CLEANFILES list, it's not x86 specific.
|
281115 |
05-Apr-2015 |
andrew |
Spell MACHINE_CPUARCH correctly
|
281114 |
05-Apr-2015 |
andrew |
Add FDT support to loader.efi. This will be used on arm and arm64.
Differential Revision: https://reviews.freebsd.org/D2219
|
281061 |
04-Apr-2015 |
rpaulo |
loader/EFI: improve the help of the 'mode' command.
|
281060 |
04-Apr-2015 |
rpaulo |
Remove an unnecessary space in a printf call.
|
281059 |
04-Apr-2015 |
rpaulo |
boot1 EFI: reset the screen and select the best mode.
It's necessary to reset the screen to make sure any vendor pixels are gone when we start boot1. In the Lenovo X1 (3rd gen), this is the only way to clear the screen. Previously, the Lenovo logo would only disappear after the kernel started scrolling the display.
After resetting the screen, EFI could put us in the worst LCD mode (oversized characters), so we now find the largest mode we can use and hope it's the most appropriate one (it's not trivial to tell what's the correct LCD resolution at this point). It's worth noting that the final stage loader has a 'mode' command that can be used to switch text modes.
While there, enable the software cursor, just like in the legacy boot mode.
MFC after: 1 week
|
281058 |
04-Apr-2015 |
rpaulo |
Remove whitespace.
|
281028 |
03-Apr-2015 |
andrew |
Add the start of the efi fdt bindings. These will be used on arm and arm64.
Sponsored by: The FreeBSD Foundation
|
281027 |
03-Apr-2015 |
andrew |
Clean up more x86 only options in the efi code.
|
281022 |
03-Apr-2015 |
andrew |
Only enable the efi framebuffer on x86 for now
|
281021 |
03-Apr-2015 |
andrew |
Only include machine/specialreg.h on x86
|
281020 |
03-Apr-2015 |
andrew |
Only enable comconsole and nullconsole on x86.
|
281000 |
02-Apr-2015 |
emaste |
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.
|
280950 |
01-Apr-2015 |
andrew |
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
|
280047 |
15-Mar-2015 |
andrew |
Move the x86 specific files to be built in the amd64 loader.efi. This will help with importing the arm and arm64 versions of loader.efi.
|
280031 |
15-Mar-2015 |
dim |
Upgrade our copy of clang, llvm and lldb to 3.6.0 release.
Please note that from 3.5.0 onwards, clang/llvm/lldb require C++11 support to build; see UPDATING for more information.
Release notes for llvm and clang can be found here: <http://llvm.org/releases/3.6.0/docs/ReleaseNotes.html> <http://llvm.org/releases/3.6.0/tools/clang/docs/ReleaseNotes.html>
Thanks to Ed Maste for the lldb part of this upgrade.
Exp-run: antoine
|
279950 |
13-Mar-2015 |
jhb |
Enable bzipfs support in the EFI loader. - 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.
|
279949 |
13-Mar-2015 |
jhb |
The System V ABI for amd64 allows functions to use space in a 128 byte 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.
|
279038 |
20-Feb-2015 |
imp |
Allow EFI and ACPI to be included together. When ACPI is included first, EFI will use its definitions for {,U}INT{8,16,32,64} and BOOLEAN. When EFI is included first, define ACPI_USE_SYSTEM_INTTYPES to tell ACPI that these are already defined.
Differential Revision: https://reviews.freebsd.org/D1905
|
278234 |
05-Feb-2015 |
rpaulo |
EFI: print more information about EFI Tables.
This adds the GUIDs for DXE, HOB, Memory Type Information and Debug Image Info.
|
277943 |
30-Jan-2015 |
ambrisko |
Fix UEFI PXE boot on a NIC that isn't the first NIC.
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"
|
274439 |
12-Nov-2014 |
andrew |
Add the FDT table GUID. This is used to pass the device tree blob from UEFI to the loader in a similar way to the ACPI tables.
This will be used on arm64 but is not specific to the architecture.
Sponsored by: The FreeBSD Foundation
|
272105 |
25-Sep-2014 |
emaste |
Remove duplicated header content
I fail at patch(1).
MFC after: 3 days
|
271762 |
18-Sep-2014 |
emaste |
Switch to text mode in UEFI boot
The loader previously failed to display on MacBooks and other systems where the UEFI firmware remained in graphics mode.
Submitted by: Rafael EspĂndola
|
271475 |
12-Sep-2014 |
ambrisko |
Add support for serial and null console to UEFI boot loader.
|
268974 |
22-Jul-2014 |
sbruno |
Supress clang warning for FreeBSD printf %b and %D formats
MFC after: 2 weeks
|
268351 |
07-Jul-2014 |
marcel |
Remove ia64.
This includes: o All directories named *ia64* o All files named *ia64* o All ia64-specific code guarded by __ia64__ o All ia64-specific makefile logic o Mention of ia64 in comments and documentation
This excludes: o Everything under contrib/ o Everything under crypto/ o sys/xen/interface o sys/sys/elf_common.h
Discussed at: BSDcan
|
264263 |
08-Apr-2014 |
emaste |
Add explicit casts to quiet warnings in libefi
Sponsored by: The FreeBSD Foundation
|
264095 |
04-Apr-2014 |
emaste |
Support UEFI booting on amd64 via loader.efi
This is largely the work from the projects/uefi branch, with some additional refinements. This is derived from (and replaces) the original i386 efi implementation; i386 support will be restored later.
Specific revisions of note from projects/uefi:
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.
r246231:
Add necessary code to hand off from loader to an amd64 kernel.
r246335:
Grab the EFI memory map and store it as module metadata on the kernel.
This is the same approach used to provide the BIOS SMAP to the kernel.
r246336:
Pass the ACPI table metadata via hints so the kernel ACPI code can find them.
r246608:
Rework copy routines to ensure we always use memory allocated via EFI.
The previous code assumed it could copy wherever it liked. This is not the case. The approach taken by this code is pretty ham-fisted in that it simply allocates a large (32MB) buffer area and stages into that, then copies the whole area into place when it's time to execute. A more elegant solution could be used but this works for now.
r247214:
Fix a number of problems preventing proper handover to the kernel.
There were two issues at play here. Firstly, there was nothing preventing UEFI from placing the loader code above 1GB in RAM. This meant that when we switched in the page tables the kernel expects to be running on, we are suddenly unmapped and things no longer work. We solve this by making our trampoline code not dependent on being at any given position and simply copying it to a "safe" location before calling it.
Secondly, UEFI could allocate our stack wherever it wants. As it happened on my PC, that was right where I was copying the kernel to. This did not cause happiness. The solution to this was to also switch to a temporary stack in a safe location before performing the final copy of the loaded kernel.
r246231:
Add necessary code to hand off from loader to an amd64 kernel.
r246335:
Grab the EFI memory map and store it as module metadata on the kernel.
This is the same approach used to provide the BIOS SMAP to the kernel.
r246336:
Pass the ACPI table metadata via hints so the kernel ACPI code can find them.
r246608:
Rework copy routines to ensure we always use memory allocated via EFI.
The previous code assumed it could copy wherever it liked. This is not the case. The approach taken by this code is pretty ham-fisted in that it simply allocates a large (32MB) buffer area and stages into that, then copies the whole area into place when it's time to execute. A more elegant solution could be used but this works for now.
r247214:
Fix a number of problems preventing proper handover to the kernel.
There were two issues at play here. Firstly, there was nothing preventing UEFI from placing the loader code above 1GB in RAM. This meant that when we switched in the page tables the kernel expects to be running on, we are suddenly unmapped and things no longer work. We solve this by making our trampoline code not dependent on being at any given position and simply copying it to a "safe" location before calling it.
Secondly, UEFI could allocate our stack wherever it wants. As it happened on my PC, that was right where I was copying the kernel to. This did not cause happiness. The solution to this was to also switch to a temporary stack in a safe location before performing the final copy of the loaded kernel.
r247216:
Use the UEFI Graphics Output Protocol to get the parameters of the framebuffer.
Sponsored by: The FreeBSD Foundation
|
264092 |
03-Apr-2014 |
emaste |
Add -fPIC for amd64
Sponsored by: The FreeBSD Foundation
|
264088 |
03-Apr-2014 |
emaste |
Merge efilib changes from projects/uefi
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.
|
263115 |
13-Mar-2014 |
emaste |
Add amd64 EFI headers
Sponsored by: The FreeBSD Foundation
|
261603 |
07-Feb-2014 |
emaste |
Don't force efi to a 32-bit build on amd64
Sponsored by: The FreeBSD Foundation
|
243978 |
07-Dec-2012 |
rpaulo |
Typo in a comment.
|
241785 |
20-Oct-2012 |
avg |
boot: use -march=i386 for both i386 and amd64 builds
.. so that consistent compilation algorithms are used for both architectures as in practice the binaries are expected to be interchangeable (for time being). Previously i386 used default setting which were equivalent to -march=i486 -mtune=generic. The only difference is using smaller but slower "leave" instructions.
Discussed with: jhb, dim MFC after: 29 days
|
234493 |
20-Apr-2012 |
marcel |
Build a 32-bit EFI loader on amd64. This to match the rest of the code that is used to construct a loader (e.g. libstand, ficl, etc).
There is such a thing as a 64-bit EFI application, but it's not as standard as 32-bit is. Let's make the 32-bit functional (as in we can load and actualy boot a kernel) before solving the 64-bit loader problem.
|
219691 |
16-Mar-2011 |
marcel |
MFaltix: 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.
|
219683 |
16-Mar-2011 |
marcel |
Revert previous commit: EFI_STATUS is a 64-bit integral on ia64. Fix the 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
|
218974 |
23-Feb-2011 |
brucec |
Handle memory allocation failures in include().
PR: i386/85652 Submitted by: Ben Thomas <bthomas at virtualiron.com> MFC after: 3 days
|
217067 |
06-Jan-2011 |
marcel |
Help static analysis by initializing variables that we know cannot be used uninitialized, but which cannot be inferred from the code itself.
|
211679 |
23-Aug-2010 |
imp |
MF tbemd: move to using specific architecture makefiles
|
201941 |
09-Jan-2010 |
marcel |
Remove file system support based on the simple file system protocol 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
|
180012 |
25-Jun-2008 |
ru |
Enable GCC stack protection (aka Propolice) for userland: - It is opt-out for now so as to give it maximum testing, but it may be turned opt-in for stable branches depending on the consensus. You can turn it off with WITHOUT_SSP. - WITHOUT_SSP was previously used to disable the build of GNU libssp. It is harmless to steal the knob as SSP symbols have been provided by libc for a long time, GNU libssp should not have been much used. - SSP is disabled in a few corners such as system bootstrap programs (sys/boot), process bootstrap code (rtld, csu) and SSP symbols themselves. - It should be safe to use -fstack-protector-all to build world, however libc will be automatically downgraded to -fstack-protector because it breaks rtld otherwise. - This option is unavailable on ia64.
Enable GCC stack protection (aka Propolice) for kernel: - It is opt-out for now so as to give it maximum testing. - Do not compile your kernel with -fstack-protector-all, it won't work.
Submitted by: Jeremie Le Hen <jeremie@le-hen.org>
|
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.
|
163929 |
03-Nov-2006 |
marcel |
Make this compile on EFI32. The EFI_PHYSICAL_ADDRESS type is always 64-bit, even when sizeof(void *) is 32-bit.
|
163898 |
02-Nov-2006 |
marcel |
Sync the EFI headers with version 1.10.14.62 of the Intel sample EFI implementation. This re-introduces C99 style comments that previously were replaced by original C comments.
|
163897 |
02-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.
|
158467 |
12-May-2006 |
jhb |
Remove more Alpha bits from the boot code including fixing several stale comments.
|
150469 |
22-Sep-2005 |
ru |
Add loader(8) variables for RB_DFLTROOT, RB_MUTE, and RB_PAUSE: "boot_dfltroot", "boot_mute", and "boot_pause" respectively.
|
143250 |
07-Mar-2005 |
stefanf |
Don't try to use 'typedef struct foo' if just 'struct foo' makes more sense and works on all compilers. This also removes the need for __CC_SUPPORTS_FORWARD_REFERENCE_CONSTRUCT in <sys/cdefs.h>.
OK'ed by: marcel, dfr
|
143176 |
06-Mar-2005 |
stefanf |
Fix typos in a comment.
|
143063 |
02-Mar-2005 |
joerg |
netchild's mega-patch to isolate compiler dependencies into a central place.
This moves the dependency on GCC's and other compiler's features into the central sys/cdefs.h file, while the individual source files can then refer to #ifdef __COMPILER_FEATURE_FOO where they by now used to refer to #if __GNUC__ > 3.1415 && __BARC__ <= 42.
By now, GCC and ICC (the Intel compiler) have been actively tested on IA32 platforms by netchild. Extension to other compilers is supposed to be possible, of course.
Submitted by: netchild Reviewed by: various developers on arch@, some time ago
|
139738 |
05-Jan-2005 |
imp |
Start each of the license/copyright comments with /*-
|
138249 |
01-Dec-2004 |
scottl |
Remove the last vestiges of the userconfig option. None of this actually did anything, so this commit should be considered a NO-OP.
|
138141 |
28-Nov-2004 |
marcel |
o Introduce efimd_va2pa() to translate addresses in efi_copy{in|out}() and efi_readin(). This removes MD code from copy.c. o Don't unconditionally add pal.S to SRCS. It's specific to ia64.
|
138026 |
23-Nov-2004 |
marcel |
This file was repocopied to src/sys/boot/ia64/efi.
|
138004 |
23-Nov-2004 |
marcel |
Unhook the loader subdirectory. The ia64 EFI loader is now build under ../ia64/efi.
|
137978 |
21-Nov-2004 |
marcel |
Remove struct ia64_itir and use a plain old uint64_t instead.
|
136910 |
24-Oct-2004 |
ru |
For variables that are only checked with defined(), don't provide any fake value.
|
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>.
|
132437 |
20-Jul-2004 |
marcel |
o Support the REL32LSB relocation. It's in the ELF file from which 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.
|
132435 |
20-Jul-2004 |
marcel |
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.
|
127919 |
05-Apr-2004 |
imp |
Remove advertising clause from University of California Regent's license, per letter dated July 22, 1999.
Approved by: core
|
126764 |
09-Mar-2004 |
marcel |
Reset the text attributes when initializing the console. The EFI loader typically doesn't do this so that we end up booting the with whatever the EFI loader has set it to last.
|
125767 |
13-Feb-2004 |
marcel |
Don't create a mapfile during link. It's not needed for the build.
|
125766 |
13-Feb-2004 |
marcel |
o Don't build with -fpic. It's not needed and inconsistent with how other constributions are compiled. o Remove powerpc specific additions to CFLAGS.
|
125729 |
12-Feb-2004 |
ru |
Tidy up makefiles.
Tested by: marcel
|
124140 |
04-Jan-2004 |
obrien |
Convert to __FBSDID.
|
123399 |
10-Dec-2003 |
jhb |
Fix typo in comment.
|
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
|
117676 |
17-Jul-2003 |
marcel |
Have the linker script look more like the default linker script on ia64. This fixes the breakage caused by the gcc upgrade that resulted in a broken executable.
|
117158 |
02-Jul-2003 |
ru |
sys/ia64/ia64/pal.s has been repocopied to pal.S.
Approved by: marcel Repocopied by: joe
|
114379 |
01-May-2003 |
peter |
Enable the i386 loader to load and run an amd64 kernel. If this puts 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.
|
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.
|
111692 |
01-Mar-2003 |
marcel |
Paranoia: Don't use the length of the option string alone to determine whether we have command line options. We expect a valid string pointer as well.
|
111543 |
26-Feb-2003 |
marcel |
Increase the block size for reading and writing from 8KB to 1MB and 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>
|
111536 |
26-Feb-2003 |
obrien |
Consistently use NOFORTH to control the usage of ficl.
|
111168 |
20-Feb-2003 |
marcel |
Simplify page alignment.
|
108100 |
19-Dec-2002 |
jake |
Renamed the loader's zipfs to gzipfs. zipfs.c was repo-copied to gzipfs.c.
|
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)
|
107724 |
10-Dec-2002 |
marcel |
The exit() function has been moved to libefi.c to better deal with cleaning up after ourselves.
Approved by: re (blankoscheck) German corrections: Alexander (both :-)
|
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)
|
107721 |
10-Dec-2002 |
marcel |
Build EFI with -fshort-wchar so that L"some string" works with the EFI has defined CHAR16.
|
107720 |
10-Dec-2002 |
marcel |
Remove _putchar, _puts and _puthex. These functions are unused.
Approved by: re (blanket)
|
107686 |
08-Dec-2002 |
marcel |
Add the GUID of the DIG64 HCDP table.
|
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)
|
107682 |
08-Dec-2002 |
marcel |
In efi_cons_poll we check if a key is present (pending) by checking 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 :-)
|
107367 |
28-Nov-2002 |
marcel |
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)
|
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)
|
105852 |
24-Oct-2002 |
marcel |
o Fix a size calculation based on a 8KB page, while under EFI 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>
|
100391 |
20-Jul-2002 |
peter |
Turn on -Wformat
|
100390 |
20-Jul-2002 |
peter |
Fix printf format errors
|
100389 |
20-Jul-2002 |
peter |
Work around some nasty bugs on the [beta] Itanium2's E1000 UNDI driver.
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.
|
100388 |
20-Jul-2002 |
peter |
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).
|
100387 |
20-Jul-2002 |
peter |
Fix printf format errors
|
98472 |
20-Jun-2002 |
peter |
Add boot_serial and boot_multicons variables to set RB_SERIAL and RB_MULTIPLE since this seems to be the easiest way to add these flags for non-forth loaders etc.
|
96912 |
19-May-2002 |
marcel |
o Remove namespace pollution from param.h: - 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.
|
96893 |
19-May-2002 |
marcel |
An almost mechanical sweep to replace C++ style comments with C style comments. This is not an attempt to conform to style(9). Such has lower priority.
|
96755 |
16-May-2002 |
trhodes |
More s/file system/filesystem/g
|
96513 |
13-May-2002 |
ru |
Removed now unused INTERNALSTATICLIB. INTERNALLIB now implies NOPIC and NOPROFILE. Removed gratuitous NOMAN.
|
96455 |
12-May-2002 |
obrien |
Back out last commit. I expect our bsd.*.mk gods to remove the need for defining so many extra things in addition to INTERNALLIB. We don't like repetitive C code and we shouldn't for make code either.
|
96415 |
11-May-2002 |
obrien |
NOPIC, NOPROFILE, NOMAN, and INTERNALSTATICLIB are redundant when using INTERNALLIB now.
|
96342 |
10-May-2002 |
obrien |
-ffreestanding is the word. (also resort some CFLAGS such that the more "important" value are first so they are easier to see)
|
95190 |
21-Apr-2002 |
marcel |
Improve self-relocation: 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),
|
95026 |
19-Apr-2002 |
marcel |
Allocate sufficient pages to hold the bootinfo block and stop hardwiring the location.
|
94418 |
11-Apr-2002 |
peter |
Finally fix loader completely for IA64. efifs_stat() wasn't setting 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)
|
94024 |
07-Apr-2002 |
peter |
We must not let install(1) strip loader.efi when installing it, or the resulting binary will be damaged and no longer work.
|
94023 |
07-Apr-2002 |
peter |
Set BINDIR
|
94022 |
07-Apr-2002 |
peter |
Add loader bootforth infrastructure and install it.
|
93925 |
06-Apr-2002 |
peter |
Try and tidy up some very loose ends with paths to various libraries etc.
|
93923 |
06-Apr-2002 |
peter |
Do not assume that ${OBJCOPY} variable exists. It was hidden by the fact that the 'ia64-make' wrapper explicitly set it.
|
93921 |
06-Apr-2002 |
peter |
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.
|
93753 |
04-Apr-2002 |
peter |
Use a relative path to libstand.. /usr/src/lib/libstand may not exist or may have the wrong header files.
|
93485 |
31-Mar-2002 |
marcel |
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}.
|
93454 |
30-Mar-2002 |
marcel |
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.
|
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.
|
93410 |
30-Mar-2002 |
marcel |
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.
|
93409 |
30-Mar-2002 |
marcel |
Fix the initialization of the protocol: 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.
|
93405 |
30-Mar-2002 |
marcel |
Don't blindly dereference f->f_devdata as if it's always a pointer to 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.
|
93403 |
29-Mar-2002 |
marcel |
o Make efinet_put a blocking call by waiting for the protocol 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.
|
93321 |
28-Mar-2002 |
marcel |
o Don't include sys/cdefs.h
|
93320 |
28-Mar-2002 |
marcel |
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.
|
92731 |
19-Mar-2002 |
peter |
Add EFI write support to loader
|
92658 |
19-Mar-2002 |
peter |
Add -ffreestanding to avoid printf/puts/putchar conversions
|
92657 |
19-Mar-2002 |
peter |
Boot from efifs first.
|
92656 |
19-Mar-2002 |
peter |
gcc-3.1 likes to have extra { } around the internal array initializers in the GUID templates.
|
86588 |
19-Nov-2001 |
peter |
Lookup the EFI_FPSWA driver and pass the interface pointer through to the kernel before we call ExitBootServices(). I've typed the definitions in efifpswa.h from the Intel FPSWA manual (urk).
|
86586 |
19-Nov-2001 |
peter |
Remove bootinfo.bi_kernel. It isn't used by the kernel. struct bootinfo should go away on ia64, we should be loader metadata based since that is the only way we can boot (loader, skiload).
|
86584 |
19-Nov-2001 |
peter |
This is used in C, not C++. functions with no args have func(void) in our kernel.
|
85892 |
02-Nov-2001 |
mike |
o Add new header <sys/stdint.h>. o Make <stdint.h> a symbolic link to <sys/stdint.h>. o Move most of <sys/inttypes.h> into <sys/stdint.h>, as per C99. o Remove <sys/inttypes.h>. o Adjust includes in sys/types.h and boot/efi/include/ia64/efibind.h to reflect new location of integer types in <sys/stdint.h>. o Remove previously symbolicly linked <inttypes.h>, instead create a new file. o Add MD headers <machine/_inttypes.h> from NetBSD. o Include <sys/stdint.h> in <inttypes.h>, as required by C99; and include <machine/_inttypes.h> in <inttypes.h>, to fill in the remaining requirements for <inttypes.h>. o Add additional integer types in <machine/ansi.h> and <machine/limits.h> which are included via <sys/stdint.h>.
Partially obtain from: NetBSD Tested on: alpha, i386 Discussed on: freebsd-standards@bostonradio.org Reviewed by: bde, fenner, obrien, wollman
|
85652 |
29-Oct-2001 |
marcel |
Set RB_MULTIPLE (multiple console support) if the kernel is booted with the -D flag.
|
85476 |
25-Oct-2001 |
dfr |
Call ExitBootServices and disable interrupts before we start hacking the VM registers. This ought to make things slightly more reliable here.
|
85475 |
25-Oct-2001 |
dfr |
Add the two sections used for PLT entries to the text and sdata sections respectively. This makes IPLTLSB relocations work properly (these are generated for weak symbols, particularly for _longjmp).
|
85436 |
24-Oct-2001 |
dfr |
Try to get the self-relocator to work with IPLTLSB relocations. Doesn't work right though - I can't figure out why.
|
84802 |
11-Oct-2001 |
dfr |
Fix typo in comment.
|
84644 |
08-Oct-2001 |
marcel |
s/alpha/${MACHINE_ARCH}/g
|
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.
|
83903 |
24-Sep-2001 |
dfr |
Return the mapkey which EFI gave us when we read the memory map - we need it to call ExitBootServices.
|
83902 |
24-Sep-2001 |
dfr |
Tidy up a little - don't try to print anything or enable interrupts after we start changing translation registers. Also, call ExitBootServices before we jump into the kernel.
|
83901 |
24-Sep-2001 |
dfr |
Pick up pal.s from the kernel sources.
|
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.
|
83828 |
22-Sep-2001 |
dfr |
* Flesh out elf_exec and bootinfo. * Add EFI network support.
|
83825 |
22-Sep-2001 |
dfr |
Add getsecs() for the libstand network code.
|
83824 |
22-Sep-2001 |
dfr |
Add a twiddle meter when reading from files. Gives me something to look at when a kernel is loading from a floppy.
|
83439 |
14-Sep-2001 |
dfr |
Plug in ELF backend.
|
83438 |
14-Sep-2001 |
dfr |
Add ELF backend to the build.
|
83437 |
14-Sep-2001 |
dfr |
Make this do the right thing (mostly). We should still reserve the pages that the kernel loads into using the EFI AllocatePages call.
|
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.
|
83193 |
07-Sep-2001 |
dfr |
Hook up the native EFI filesystem reader.
|
83192 |
07-Sep-2001 |
dfr |
Set currdev and loaddev variables.
|
83191 |
07-Sep-2001 |
dfr |
Add a libstand filesystem for accessing EFI native filesystems.
|
83190 |
07-Sep-2001 |
dfr |
Reformat.
|
83078 |
05-Sep-2001 |
dfr |
Merge linker set relocations with the rest.
|
82965 |
04-Sep-2001 |
dfr |
Enable bootforth.
|
82942 |
04-Sep-2001 |
dfr |
Make sure we copy over the linker set sections to the EFI executable.
|
79540 |
10-Jul-2001 |
dfr |
Make this build again after breakage from previous commits.
|
78332 |
16-Jun-2001 |
obrien |
style(9) and remove a left over Alpha comment
|
78331 |
16-Jun-2001 |
obrien |
style cleanup
|
78329 |
16-Jun-2001 |
obrien |
style police
|
78328 |
16-Jun-2001 |
obrien |
This Intel derived file uses C++ style comments. (I'll be we know which compiler and platform they developed this on...) Minimally change them to C89 comments to make GCC happy. (this is kinda funny as the file has piece derived from FreeBDS 3.2)
Also fix FreeBSD id style.
|
78327 |
16-Jun-2001 |
obrien |
Fix FreeBSD id style.
|
78326 |
16-Jun-2001 |
obrien |
style(9)
|
78320 |
16-Jun-2001 |
obrien |
style(9) + fix FreeBSD id's.
|
78195 |
14-Jun-2001 |
peter |
Nuke old gensetdefs based linker sets with extreme prejudice
|
77979 |
10-Jun-2001 |
dfr |
Move the first section up one page. The firmware bogusly uses the first page of the image to load section headers and if we let the text section start at zero, it corrupts the section table when its loaded. With this change, the loader gets as far as the 'ok' prompt.
|
77978 |
10-Jun-2001 |
dfr |
Remove a 'return' statement which I put in while I was trying to debug the startup code.
|
77943 |
09-Jun-2001 |
dfr |
First approximation of an ia64 EFI loader. Not functional.
|