Commit Graph

122 Commits

Author SHA1 Message Date
skrll
44b32f72df Various clean ups
- cache node where possible
 - remove a compiler warning
 - improve a comment (the round_page might not be needed)
2020-12-19 08:09:31 +00:00
jmcneill
dcebe6352b Deal with devices that report either 512 or 2048 as logical block size
for CD9660 file-systems.
2020-11-28 15:24:05 +00:00
jmcneill
4fa5b01b8d Add a hook for MD specific info to print in the "ver" command. Use this
to print the value of the current execution level in bootaa64.
2020-11-28 14:02:09 +00:00
jmcneill
28e166e2a5 Fix previous. 2020-10-22 09:28:30 +00:00
jmcneill
5b8503e220 If the framebuffer node already exists, we don't need to create one 2020-10-22 09:14:40 +00:00
tnn
b17f0570cb efiboot: bump version 2020-10-18 18:09:32 +00:00
tnn
33908812c2 efiboot: recognize the EFI system partition as fstype MSDOS 2020-10-18 18:05:48 +00:00
jmcneill
b5871b26b4 Add ISO9660 support. 2020-10-11 14:03:33 +00:00
jmcneill
e8fb0aadec Support EFI runtime and GOP FB for devicetree (non-ACPI) setups. 2020-10-10 19:17:39 +00:00
jakllsch
622d3ff185 bootaa64: explicitly set GNUEFIARCH and LIBGNUEFI_ARCH to aarch64 2020-09-10 14:30:14 +00:00
jmcneill
e66e766944 Be explicit about building for little endian. This allows efiboot to be
built with the aarch64eb toolchain.
2020-09-08 16:34:43 +00:00
jmcneill
b4ab0863f3 Be explicit about building for little endian. This allows efiboot to be
built with the armv7be toolchain.
2020-09-08 15:36:37 +00:00
mrg
cb93b81028 add support for new GCC 9 warnings that may be too much to fix
right now.  new address-of-packed-member and format-overflow
warnings have new GCC_NO_ADDR_OF_PACKED_MEMBER amd
GCC_NO_FORMAT_OVERFLOW variables to remove these warnings.

apply to a bunch of the tree.  mostly, these are real bugs that
should be fixed, but in many cases, only by removing the 'packed'
attribute from some structure that doesn't really need it.  (i
looked at many different ones, and while perhaps 60-80% were
already properly aligned, it wasn't clear to me that the uses
were always coming from sane data vs network alignment, so it
doesn't seem safe to remove packed without careful research for
each affect struct.)  clang already warned (and was not erroring)
for many of these cases, but gcc picked up dozens more.
2020-09-06 07:20:26 +00:00
jmcneill
3fc11eecb7 Fixup OpenSimpleReadFile usage:
- The "EFI_DEVICE_PATH **FilePath" parameter can change, so do not free
   the output. This was causing crashes on U-Boot when attempting to load
   boot.cfg, even if it didn't exist.
 - Allocate the SIMPLE_READ_FILE in advance and store a pointer to it in
   struct open_file.
2020-07-15 00:51:40 +00:00
jmcneill
46d55c55e7 Remove support for storing settings in EFI environment variables now that
we have boot.cfg support.
2020-06-28 11:39:50 +00:00
jmcneill
4ae868861d command_version: print config file path 2020-06-27 18:52:24 +00:00
jmcneill
5088ff3217 Load boot.cfg from the EFI system partition instead of the first FFS
partition on that device.
2020-06-27 17:23:08 +00:00
thorpej
12431191f9 Add dtoverlay command to specify device tree overlays from the boot
loader command line.  Add support for specifying device tree overlays
in boot.cfg, with the syntax:

dtoverlay=/path/to/overlay.dtbo
dtoverlay=hd0e:/overlays/example.dtbo

Multiple overlays can be specified, and they are loaded in the order
they appear in boot.cfg.

Remove support for efiboot.plist.
2020-06-26 03:23:04 +00:00
jmcneill
2b6ae1af1d Add boot.cfg support. 2020-06-21 23:53:26 +00:00
jmcneill
8a3f4052df Add module support. 2020-06-21 17:24:26 +00:00
thorpej
0cf633cc36 If a device tree overlay does not have a "compatible" match, don't
load it.  (Oops, missing return statement.)
2020-05-23 16:40:41 +00:00
jmcneill
3aca75b32b Make efi_rng_show return early if RNG protocol is not available. While
here, use efi_rng_available() consistently, prefix all show messages with
"RNG: ", and use sizeof(foo) instead of sizeof foo.
2020-05-14 23:09:29 +00:00
riastradh
48e749766f Bump efiboot version to note EFI RNG support. 2020-05-14 19:25:16 +00:00
riastradh
248f2a779e Deduplicate lazy /chosen node creation logic. 2020-05-14 19:21:53 +00:00
riastradh
f26bf7cc37 Pass EFI RNG output via /chosen/netbsd,efirng-{start,end}.
This is separate from /chosen/netbsd,rndseed-{start,end}, which
specifies NetBSD's persistent on-disk seed; efirng is the firmware's
RNG device.
2020-05-14 19:20:08 +00:00
riastradh
b962c94008 Draft logic to get at EFI RNG. 2020-05-14 19:19:08 +00:00
msaitoh
8012ca3f0e Remove extra semicolon. 2020-05-14 08:34:17 +00:00
rin
e7b4837ce1 Adjust for binutils 2.34 in the same manner as efiboot/x86:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/i386/stand/efiboot/Makefile.efiboot#rev1.17
2020-04-26 06:51:35 +00:00
tnn
cf57b6c19d efiboot: add clang fix from i386/stand/efiboot/bootx64/Makefile here too 2020-04-01 10:45:44 +00:00
jmcneill
a43616e571 Clean up the banner so it fits in 80 columns and add some extra details
to the "version" command output.
2020-01-25 11:24:20 +00:00
jmcneill
a0a1075e2c Hide the twiddle while loading efiboot plist 2020-01-25 10:53:13 +00:00
jmcneill
82112b6031 Fix for disappearing counters on graphics consoles 2020-01-25 10:09:46 +00:00
skrll
2fd3674617 Fix EFIBOOT_DEBUG build on arm 2020-01-03 14:14:56 +00:00
skrll
d0742ad78c Add -mfloat-abi=soft so that gcc 8 doesn't emit FP instructions. This
fixes bootarm.efi compiled by gcc 8.
2020-01-03 11:44:33 +00:00
msaitoh
ba5c90c4a4 s/sucess/success/ in comment. 2019-12-27 09:45:26 +00:00
riastradh
fedc917302 Implement rndseed support in efiboot and fdt arm.
The EFI environment variable `rndseed' specifies the path to the
random seed.  It is loaded only for fdt platforms at the moment.

Since the rndseed (an rndsave_t object as defined in <sys/rndio.h>)
is 536 bytes long (for hysterical raisins), and to avoid having to
erase parts of the fdt tree, we load it into a physical page whose
address is passed in the fdt tree, rather than passing the content of
the file as an fdt node directly; the kernel then reserves the page
from uvm, and maps it into kva to call rnd_seed.

For now, the only kernel that does use efiboot with fdt is evbarm,
which knows to handle the rndseed.  Any new kernels that use efiboot
with fdt must do the same; otherwise uvm may hand out the page with
the secret key on it for a normal page allocation in the kernel --
which should be OK if there are no kernel memory disclosure bugs, but
would lead to worse consequences than simply loading the seed late in
userland with /etc/rc.d/random_seed otherwise.

ok jmcneill
2019-12-18 21:46:03 +00:00
jmcneill
652b35568f Use SMBIOS system vendor and product strings to create a "model" string
for the root node in the fabricated ACPI device tree, when possible.
2019-11-30 13:02:18 +00:00
jakllsch
2bd734055e Increase MI efiboot bootprompt() input buffer from 80 bytes to LINE_MAX.
This allows you to load a kernel from a build directory deep in some file
system after you accidentally boot an old kernel with a new userland and
are otherwise unable to get yourself back to a matching kernel.
2019-09-29 00:52:26 +00:00
jakllsch
98f4c0656e Use roundup2() instead of open coding something almost the same that
truncates 64-bit quantities.

Fixes disk access and booting in bootaa64.efi on SoftIron OverDrive 1000
(which does not have any memory below 4GiB).
2019-09-27 20:10:42 +00:00
jmcneill
1814583a15 Do a full reset of the console at startup 2019-09-26 14:28:14 +00:00
christos
7e81d727bc Consistently use ${RELEASEDIR}/${RELEASEMACHINE} instead of
${RELEASEDIR}/${MACHINE} (Paul Ripke)
2019-09-23 13:42:30 +00:00
jmcneill
d2908378b5 Honour block device's IO alignment requirements.
Patch from Simon South <simon@simonsouth.net> in PR# 54554
2019-09-21 10:19:37 +00:00
jmcneill
08196c9186 Only set #address-cells and #size-cells properties on /chosen if we are
fabricating a devicetree (ACPI mode). Fixes PR# 54494
2019-08-30 00:01:33 +00:00
jmcneill
5b55ec2572 Add full UEFI memory map to the /chosen node. 2019-08-01 13:11:16 +00:00
skrll
581c62fc78 Fix arm build 2019-07-25 11:44:14 +00:00
jmcneill
3cdd75ddb0 Add support for simple framebuffers when booting in ACPI mode. 2019-07-24 11:40:36 +00:00
rin
84899fcd0b Enable us to load kernel image of different byte order. Now, earmv7hf-eb
kernel can successfully boot from EFI bootloader.

XXX
We need to recognize disklabel and filesystem written in opposite byte oder.
2019-07-21 17:01:39 +00:00
thorpej
ffbae842f4 - Add support for a boot configuration file, defaulting to /etc/efiboot.plist.
- Add support for pre-loading EFI environment variables from efiboot.plist.
- Add support for device tree overlays specified in efiboot.plist.

(Man page for efiboot forthcoming.)
2019-04-21 22:30:41 +00:00
jmcneill
c14f76b6fc ST FirmwareRevision field is in a vendor defined format, so just print the raw value 2019-04-20 11:28:53 +00:00
jmcneill
b43f538702 Skip clearing the screen when efiboot starts, it may end up hiding useful information 2019-04-20 11:23:16 +00:00