Commit Graph

20 Commits

Author SHA1 Message Date
Ed Maste
d3525a9e36 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
2015-12-21 22:42:03 +00:00
Bryan Drewery
b1f92fa229 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
2015-12-01 05:23:19 +00:00
John Baldwin
5dc89bd2a0 Various small cleanups to EFI loader Makefiles.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D3641
2015-09-17 18:32:51 +00:00
Ian Lepore
5b1c03fd13 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
2015-05-10 13:24:26 +00:00
Andrew Turner
5031d03e5a 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.
2015-05-05 11:00:50 +00:00
Andrew Turner
0cafabf97f Add support for arm64 to loader.efi and boot1.efi
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
2015-04-14 13:55:01 +00:00
Andrew Turner
c93a8403be 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
2015-04-14 10:40:37 +00:00
Andrew Turner
2d790e26e5 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
2015-04-13 16:00:09 +00:00
Andrew Turner
23c48d2315 Print error values with hex to make it easier to find the EFI error type. 2015-04-09 10:15:47 +00:00
Andrew Turner
8ab49d66d2 Only use -fPIC when building boot1.efi for x86.
Sponsored by:	The FreeBSD Foundation
2015-04-09 10:08:10 +00:00
Ed Maste
0c8a72c0d2 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
2015-04-07 21:41:26 +00:00
Ed Maste
c6f6755c90 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
2015-04-07 21:34:49 +00:00
Andrew Turner
533e5098de Make global variabled only used in this file static. 2015-04-06 19:58:28 +00:00
Andrew Turner
63d071445e 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
2015-04-06 15:50:20 +00:00
Andrew Turner
45304e75b9 Move boot1.efi to the global CLEANFILES list, it's not x86 specific. 2015-04-05 18:57:58 +00:00
Rui Paulo
c293bc993b Remove an unnecessary space in a printf call. 2015-04-04 04:29:31 +00:00
Rui Paulo
11d48637a1 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
2015-04-04 04:27:54 +00:00
Rui Paulo
92de577931 Remove whitespace. 2015-04-04 04:18:52 +00:00
Andrew Turner
94d3e34255 Clean up more x86 only options in the efi code. 2015-04-03 15:25:59 +00:00
Andrew Turner
9e62ed8ff9 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
2015-04-01 08:30:40 +00:00