Feature/mod multi merge master 240#10
Merged
FREEWING-JP merged 42 commits intofeature/mod_multifrom Mar 31, 2024
Merged
Conversation
Clang can cross-compile to PE and is easier to setup than MinGW.
Remove some integer divisions because they emit function calls.
Use -O, because -O2 causes Undefined OpCode in QEMU / UEFI Shell. Remove -mno-red-zone which triggers -Wunused-command-line-argument. Set architecture in PE file manually: EFI uses IMAGE_FILE_MACHINE_ARMTHUMB_MIXED = 0x01C2, while the default is IMAGE_FILE_MACHINE_ARMNT = 0x01C4.
The exact command may vary by OS, this is for Arch Linux.
Apparently Boot20## are sometimes reserved for firmware even if they seem to be free. Boot00## is the normal place to be.
Loading the image might take some minimal time. Optimize experience. Hide cursor as well but restore it in ReadKey.
Shim expects a filename or nothing in the load options.
To avoid an error message during boot, do several things:
When creating the NVRAM entry, use empty load options. The current
string ("HackBGRT\0") was just a decoration, and it's luckily ignored
by shim because the length is odd.
When creating the entry with BCDEdit, manually fix the load options.
The load options in BCDEdit entries start with "WINDOWS\0" followed
by UINT32 version, as seen in ReactOS struct BL_WINDOWS_LOAD_OPTIONS.
The version is 1, but BCDEdit seems to be happy with a higher number.
By setting this version to 'X' (0x58), the string becomes a valid
UCS-2 file name. Update the installer so that the HackBGRT loader is
installed with this weird file name.
The reason why the load options cannot be deleted completely is that
BCDEdit will recreate the entry on next boot if it doesn't find the
entry it just tried to create.
See: rhboot/shim#621
See: https://github.com/reactos/reactos/blob/v0.4.7/boot/environ/include/bl.h#L911
# Conflicts: # Makefile # src/main.c
5f2088e to
63ff638
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.