Page MenuHomeFreeBSD

Simple post-mortem reporter for amd64 loader.efi.
ClosedPublic

Authored by kib on Sep 18 2016, 9:58 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 19, 11:16 PM
Unknown Object (File)
Mar 8 2024, 2:59 AM
Unknown Object (File)
Feb 8 2024, 11:37 PM
Unknown Object (File)
Dec 20 2023, 1:32 AM
Unknown Object (File)
Nov 22 2023, 5:32 PM
Unknown Object (File)
Oct 12 2023, 8:00 AM
Unknown Object (File)
Sep 30 2023, 7:26 PM
Unknown Object (File)
Sep 1 2023, 10:22 AM
Subscribers
None

Details

Summary

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. Initially I thought to install the grab always, but the relative complexity of correctly take over the BIOS IDT setup makes me think that it is better to install it as needed. So there are two commands, 'grab' and 'ungrab'. 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.

Fault handlers use dedicated stack to improve chances of catching stack/TSS exceptions. Due to this, I copy BIOS IDT into private copy, and need to find a free GDT slot for TSS. This explains somewhat complicated efi_redirect_exceptions().

Test Plan

The 'fault' command generates exception. It was used to test the code.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib retitled this revision from to Simple post-mortem reporter for amd64 loader.efi..
kib updated this object.
kib edited the test plan for this revision. (Show Details)
kib added reviewers: emaste, imp, jhb.
kib set the repository for this revision to rS FreeBSD src repository - subversion.

As usual, it is impossible to distinguish interrupt vs. exception which does not push error code. I decided to classify the event as exception. Apparently, BIOSes do the right thing and reprogram PICs to not use interrupt vectors of exceptions.

jhb edited edge metadata.

I think this can be useful certainly.

This revision is now accepted and ready to land.Sep 20 2016, 6:12 PM
This revision was automatically updated to reflect the committed changes.