summaryrefslogtreecommitdiffstats
path: root/src/interface/efi/efi_wrap.c
Commit message (Collapse)AuthorAgeFilesLines
* [efi] Modify global system table when wrapping a loaded imageMichael Brown2021-11-211-43/+56
| | | | | | | | | | | | | | | | | | | The EFI loaded image protocol allows an image to be provided with a custom system table, and we currently use this mechanism to wrap any boot services calls made by the loaded image in order to provide strace-like debugging via DEBUG=efi_wrap. The ExitBootServices() call will modify the global system table, leaving the loaded image using a system table that is no longer current. When DEBUG=efi_wrap is used, this generally results in the machine locking up at the point that the loaded operating system calls ExitBootServices(). Fix by modifying the global EFI system table to point to our wrapper functions, instead of providing a custom system table via the loaded image protocol. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Do not attempt to use console output after ExitBootServices()Michael Brown2021-11-211-3/+6
| | | | | | | | | A successful call to ExitBootServices() will result in the EFI console becoming unusable. Ensure that the EFI wrapper produces a complete line of debug output before calling the wrapped ExitBootServices() method, and attempt subsequent debug output only if the call fails. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Allow DEBUG=efi_wrap to be used independently of a loaded imageMichael Brown2020-10-011-25/+34
| | | | | | | | | | Allow temporary debugging code to call efi_wrap_systab() to obtain a pointer to the wrapper EFI system table. This can then be used to e.g. forcibly overwrite the boot services table pointer used by an already loaded and running UEFI driver, in order to trace calls made by that driver. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Show memory map returned by wrapped calls to GetMemoryMapMichael Brown2020-09-221-2/+20
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add debug wrappers for all boot services functions of interestMichael Brown2020-09-191-0/+602
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Improve efi_wrap debuggingMichael Brown2015-08-271-12/+318
| | | | | | | Add debug wrappers for more boot services functions, and print symbolic values rather than raw numbers where possible. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Remove raw EFI_HANDLE values from debug messagesMichael Brown2015-08-271-27/+22Star
| | | | | | | | | The raw EFI_HANDLE value is almost never useful to know, and simply adds noise to the already verbose debug messages. Improve the legibility of debug messages by using only the name generated by efi_handle_name(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Relicense files under GPL2_OR_LATER_OR_UBDLMichael Brown2015-03-021-1/+5
| | | | | | | Relicense files for which I am the sole author (as identified by util/relicense.pl). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Wrap any images loaded by our wrapped imageMichael Brown2014-08-291-21/+67
| | | | | | | | | | | | Propagate our modified EFI system table to any images loaded by the image that we wrap, thereby allowing us to observe boot services calls made by all subsequent EFI images. Also show details of intercepted ExitBootServices() calls. When wrapping is used, exiting boot services will almost certainly fail, but this at least allows us to see when it happens. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Show details of intercepted LoadImage() callsMichael Brown2014-08-271-0/+30
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Use efi_handle_name() instead of efi_handle_devpath_text()Michael Brown2014-07-311-8/+8
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Show more diagnostic information when building with DEBUG=efi_wrapMichael Brown2014-07-261-3/+5
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Allow for interception of boot services calls by loaded imageMichael Brown2014-07-161-0/+237
When building with DEBUG=efi_wrap, print details of calls made by the loaded image to selected boot services functions. Signed-off-by: Michael Brown <mcb30@ipxe.org>