bootloader icon indicating copy to clipboard operation
bootloader copied to clipboard

Fix the bootloader hanging during uefi exit_boot_services

Open Wasabi375 opened this issue 1 year ago • 4 comments

Fixes #400

Switch from using the "-bios" flag to using "-pflash" instead. Using "-bios" is not recomended see: https://lists.katacontainers.io/pipermail/kata-dev/2021-January/001650.html

This also allows us to easily update the ovmf-prebuild binaries.

This fixes https://github.com/rust-osdev/bootloader/issues/400. I'm not sure whether the issue was an outdated ovmf version or the bios-pflash change. I can't tell what version is published with the ovmf-prebuild crate, so I can't check.

Ovmf binaries are no longer provided by the ovmf-prebuild crate. Instead we now download them from the ovmf-prebuild github releases of the same crate. Unlike the crate, those are actually updated.

Wasabi375 avatar Sep 17 '24 05:09 Wasabi375

The test/runner/src/ovmf.rs file is based on https://github.com/rust-osdev/uefi-rs/blob/ac19526656953c32e8e0ef7bc703f7700b151ae4/xtask/src/qemu.rs#L65

I am 99% certain that this fixes the issue in #400. However I want to implement the same fix in my own kernel to make sure.

I also still need to update https://github.com/rust-osdev/bootloader/blob/main/docs/create-disk-image.md

Wasabi375 avatar Sep 17 '24 05:09 Wasabi375

Ok, I can confirm that using pflash works on my machine. I don't really understand why the CI tests fails. Maybe someone else can try this fix on their machine and give me feedback. The CI log is not really helpful.

Wasabi375 avatar Sep 17 '24 06:09 Wasabi375

I wonder if we should provide most of the code in test/runner/src/ovmf.rs as a library. Maybe as an updated version of ovmf-prebuild. Otherwise this is a lot of code that needs to be copied into any project using the bootloader.

Wasabi375 avatar Sep 17 '24 06:09 Wasabi375

Do you know how I can get the actual logs from qemu in the CI ? Right now the tests time after 30 minutes but I can't reproduce this locally.

Wasabi375 avatar Sep 18 '24 04:09 Wasabi375