-
Notifications
You must be signed in to change notification settings - Fork 5
feat(vm): surface the “No bootable device” error in the VM #2183
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
Draft
eofff
wants to merge
22
commits into
main
Choose a base branch
from
chore/vm/bootable-experiments
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
fc624b8
t
98162ba
t2
5a95a8f
patch
31d7fa0
t
746addf
patch new
e280b5d
t
0c3d53c
prerefactor
9c44bf7
build files refactoring
6a97fdd
403
d49dfad
seabios patch
ebde314
bios2
022c063
try patch
818cdaf
try patch 2
e5718a7
try patch 3
ab8e91e
pppatch
0ee1079
patch))))
9e591c1
pppatch
6dffa7a
patch
4e93d0f
move
a5b782b
correct applying
3424f44
p
ae12b04
fix patch
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
images/edk2/patches/001-debug-device-no-bootable-device-message.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c | ||
| index d9f61757cf..d2a0e5f6a1 100644 | ||
| --- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c | ||
| +++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c | ||
| @@ -2020,6 +2020,14 @@ PlatformBootManagerUnableToBoot ( | ||
| EFI_BOOT_MANAGER_LOAD_OPTION BootManagerMenu; | ||
| UINTN Index; | ||
|
|
||
| + { | ||
| + STATIC CONST CHAR8 Msg[] = "No bootable device.\r\n"; | ||
| + UINTN i; | ||
| + for (i = 0; i < sizeof (Msg) - 1; i++) { | ||
| + IoWrite8 (0x403, (UINT8)Msg[i]); | ||
| + } | ||
| + } | ||
| + | ||
| if (FeaturePcdGet (PcdBootRestrictToFirmware)) { | ||
| AsciiPrint ( | ||
| "%a: No bootable option was found.\n", | ||
| diff --git a/ShellPkg/Application/Shell/Shell.c b/ShellPkg/Application/Shell/Shell.c | ||
| index 9bacf9d8c7..ea78559516 100644 | ||
| --- a/ShellPkg/Application/Shell/Shell.c | ||
| +++ b/ShellPkg/Application/Shell/Shell.c | ||
| @@ -359,6 +359,14 @@ UefiMain ( | ||
| EFI_SIMPLE_TEXT_INPUT_PROTOCOL *OldConIn; | ||
| SPLIT_LIST *Split; | ||
|
|
||
| + { | ||
| + STATIC CONST CHAR8 Msg[] = "No bootable device.\r\n"; | ||
| + UINTN i; | ||
| + for (i = 0; i < sizeof (Msg) - 1; i++) { | ||
| + IoWrite8 (0x403, (UINT8)Msg[i]); | ||
| + } | ||
| + } | ||
| + | ||
| if (PcdGet8 (PcdShellSupportLevel) > 3) { | ||
| return (EFI_UNSUPPORTED); | ||
| } | ||
| diff --git a/ShellPkg/Application/Shell/Shell.h b/ShellPkg/Application/Shell/Shell.h | ||
| index 89b4ac6b02..cd82e6f608 100644 | ||
| --- a/ShellPkg/Application/Shell/Shell.h | ||
| +++ b/ShellPkg/Application/Shell/Shell.h | ||
| @@ -42,6 +42,7 @@ | ||
| #include <Library/HandleParsingLib.h> | ||
| #include <Library/FileHandleLib.h> | ||
| #include <Library/UefiHiiServicesLib.h> | ||
| +#include <Library/IoLib.h> | ||
|
|
||
| #include "ShellParametersProtocol.h" | ||
| #include "ShellProtocol.h" | ||
| diff --git a/ShellPkg/Application/Shell/Shell.inf b/ShellPkg/Application/Shell/Shell.inf | ||
| index f1e41de133..88b033bc35 100644 | ||
| --- a/ShellPkg/Application/Shell/Shell.inf | ||
| +++ b/ShellPkg/Application/Shell/Shell.inf | ||
| @@ -66,6 +66,7 @@ | ||
| SortLib | ||
| HandleParsingLib | ||
| UefiHiiServicesLib | ||
| + IoLib | ||
|
|
||
| [Guids] | ||
| gShellVariableGuid ## SOMETIMES_CONSUMES ## GUID |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| # 001-isa-debug-port-no-bootable-device-message.patch | ||
| If an EFI “No bootable device” error occurs, or the system drops into the EFI shell, output “No bootable device.” to the debug device at address 0x403. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
images/qemu/patches/seabios/001-alt-skip-flags-when-parse-objdump-section.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| diff --git a/scripts/layoutrom.py b/scripts/layoutrom.py | ||
| index 6616721..4f655dc 100755 | ||
| --- a/scripts/layoutrom.py | ||
| +++ b/scripts/layoutrom.py | ||
| @@ -564,7 +564,7 @@ def parseObjDump(file, fileid): | ||
|
|
||
| if state == 'section': | ||
| try: | ||
| - idx, name, size, vma, lma, fileoff, align = line.split() | ||
| + idx, name, size, vma, lma, fileoff, align, *_flags = line.split() | ||
| if align[:3] != '2**': | ||
| continue | ||
| section = Section() |
38 changes: 38 additions & 0 deletions
38
images/qemu/patches/seabios/002-0x403-debug-port-no-bootable-device-message.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| diff --git a/src/boot.c b/src/boot.c | ||
| index 1effd80..ec5992f 100644 | ||
| --- a/src/boot.c | ||
| +++ b/src/boot.c | ||
| @@ -21,6 +21,7 @@ | ||
| #include "string.h" // memset | ||
| #include "util.h" // irqtimer_calc | ||
| #include "tcgbios.h" // tpm_* | ||
| +#include "x86.h" // outb | ||
|
|
||
| /**************************************************************** | ||
| * Helper search functions | ||
| @@ -960,12 +961,23 @@ boot_rom(u32 vector) | ||
| } | ||
|
|
||
| // Unable to find bootable device - warn user and eventually retry. | ||
| +static void | ||
| +write_port_403(const char *s) | ||
| +{ | ||
| + if (!CONFIG_DEBUG_IO || !runningOnQEMU()) | ||
| + return; | ||
| + | ||
| + for (; *s; s++) | ||
| + outb(*s, 0x403); | ||
| +} | ||
| + | ||
| static void | ||
| boot_fail(void) | ||
| { | ||
| - if (BootRetryTime == (u32)-1) | ||
| + if (BootRetryTime == (u32)-1) { | ||
| printf("No bootable device.\n"); | ||
| - else | ||
| + write_port_403("No bootable device.\n"); | ||
| + } else | ||
| printf("No bootable device. Retrying in %d seconds.\n" | ||
| , BootRetryTime/1000); | ||
| // Wait for 'BootRetryTime' milliseconds and then reboot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # Patches | ||
|
|
||
| ## 001-alt-skip-flags-when-parse-objdump-section.patch | ||
|
|
||
| This patch makes `scripts/layoutrom.py` tolerate extra flags in `objdump` | ||
| section output. | ||
|
|
||
| ## 002-0x403-debug-port-no-bootable-device-message.patch | ||
|
|
||
| If SeaBIOS cannot find a bootable device on QEMU, this patch also outputs | ||
| `No bootable device.` to the debug device at address `0x403`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency with other images.