Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Test] ArmPlatformPkg, ArmVirtPkg: Add early hello message #3140

Closed

Conversation

osteffenrh
Copy link
Contributor

Add the ability to print an early hello message independent of debug
mask to the serial port when the firmware starts. Introduce a PCD entry
to set the message text (ArmPlatformPkg). If the message text is empty
(default) then nothing is printed.

The message is useful for debugging boot problems, especially with
silent firmware builds. It can take some seconds until the first line is
printed when booting the firmware, for example when running ArmVirt in
Qemu.

Use the above in ArmVirtPkg by defining a message text.

These changes have already been proposed by Laszlo Ersek in 2015.
I am reposting because I find this useful.

Example of a VM starting up, AARCH64, Qemu on X64). First line is the
new message. (Timestamp in seconds).

-VM start-
0000.094 | UEFI firmware starting.
00004.06 | BdsDxe: failed to load Boot0001 "UEFI Misc Device" from VenHw(93E34C7E-B50E-11DF-9223-2443DFD72085,00): Not Found
00004.08 | BdsDxe: loading Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x2,0x0)
00004.08 | BdsDxe: starting Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x2,0x0)
00004.11 | System BootOrder not found.  Initializing defaults.
00004.11 | Creating boot entry "Boot0005" with label "Red Hat Enterprise Linux" for file "\EFI\redhat\shimaa64.efi"
00004.15 |
00008.39 | EFI stub: Booting Linux Kernel...
[...]

@ajfish
Copy link
Member

ajfish commented Jul 25, 2022 via email

Add a PCD for defining a hello message that gets printed to the serial port
very early in the boot process, regardless of debug masks. This is useful
for debugging boot problems (especially in virtual machines) and informs
interactive users that the firmware is running.

If a platform doesn't want this feature, it should stick with the default
empty string.

Singed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Oliver Steffen <osteffen@redhat.com>
Print the early hello message to the serial port.

The FixedPcdGetSize() macro expands to an integer constant, therefore an
optimizing compiler can eliminate the new code, if the platform DSC
doesn't override the empty string (size=1) default of
PcdEarlyHelloMessage.

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Oliver Steffen <osteffen@redhat.com>
Set the text for the early hello message in ArmVirtPkg. This prints a
friendly banner on QEMU, regardless of debug mask settings.

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Oliver Steffen <osteffen@redhat.com>
@osteffenrh
Copy link
Contributor Author

We should go with #2774 instead of this one.

@osteffenrh osteffenrh closed this Jul 28, 2022
@osteffenrh osteffenrh deleted the pcd-early-hello-message branch April 13, 2023 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants