freebsd-dev/sys/boot/efi/loader
Konstantin Belousov 67330db0bb Simple post-mortem reporter for amd64 loader.efi.
There is no way to see anything about the faults occuring in
loader.efi. Some intel BIOSes do output a line into serial port at
115200/8/1 regardless of the current port settings with the EFI error
number, but this is too little, and not always available, esp. if the
user does not know where to look.

The patch adds a simple facility to grab exceptions and at least dump
generic registers and some exception details.  Due to the relative
complexity of correctly taking over the BIOS IDT setup, only install
the facility on user request.

Two new commands, 'grab_faults' and 'ungrab_faults' are provided,
first one takes over, second undoes the first. It is supposed that
user would execute 'grab' by the developer direction of collecting the
debugging data.  The 'fault' command generates exception to test the
setup.

Fault handlers use dedicated stack to improve chances of catching
stack/TSS exceptions.  Due to this, BIOS IDT is duplicated into a
private copy, and debugger needs to find a free GDT slot for TSS. This
is done in somewhat complicated efi_redirect_exceptions().

Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D7935
2016-09-21 10:22:46 +00:00
..
arch Simple post-mortem reporter for amd64 loader.efi. 2016-09-21 10:22:46 +00:00
autoload.c Enable warnings in EFI boot code 2016-01-12 02:17:39 +00:00
bootinfo.c Fix several instances where the boot loader ignored pager_output 2016-05-18 05:59:05 +00:00
conf.c Netboot: allow both tftpfs and nfs in both pxeboot and loader.efi 2016-08-31 13:16:40 +00:00
copy.c loader.efi: Bump the staging size to 64M. 2016-09-06 17:58:58 +00:00
devicename.c Don't set *dev in the zfs root case, it may be NULL and will correctly be 2016-08-25 12:42:41 +00:00
loader_efi.h Enable warnings in EFI boot code 2016-01-12 02:17:39 +00:00
main.c Use the UEFI event timer to update the time on arm and arm64. The current 2016-06-04 08:47:45 +00:00
Makefile Set UEFI boot loader PE/COFF timestamps to known value for reproducible builds 2016-08-31 21:35:38 +00:00
Makefile.depend DIRDEPS_BUILD: Regenerate without local dependencies. 2016-02-24 17:20:11 +00:00
version