-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Kernel: Introduce the EFIPrekernel #23664
Conversation
8661d7a
to
e520d42
Compare
2aec7e7
to
5465559
Compare
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions! |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions! |
2f23361
to
499056d
Compare
This allows us to use them in the EFIPrekernel.
This function has to translate ELF virtual addresses to offsets in the ELF file by walking the program header table for each relocation, since this function will be called while we are still identity mapped by the firmware.
This function simply stores the size and location of the FDT from the EFI configuration table in the boot info struct.
Otherwise validate_program_headers will complain about the kernel text segment being executable and writable.
The EFIPrekernel doesn't convert the cmdline to UTF-8 yet.
Manually calculate the target address instead of storing the target address in .text.
This adds all the remaining code necessary to actually boot the kernel. This only works on riscv64 for now.
The GOP framebuffer (if present) is passed to the kernel so it can use it as the boot framebuffer.
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions! |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions! |
This EFI Prekernel will be used to boot the kernel on (U)EFI systems.
Currently, the Prekernel only actually runs the Kernel on RISC-V (as I still need to fix some bugs for x86 and aarch64 currently isn't bootable from arbitrary physical load addresses). The EFIPrekernel does boot on AArch64 and x86-64, it just panics before booting the kernel.
The EFIPrekernel doesn't pass the EFI cmdline to the kernel yet. The cmdline is hardcoded in the riscv64 kernel for now when booted via EFI.
Making it able to boot the riscv64 kernel currently requires this patch: https://gist.github.com/spholz/caee2a25ebab06e9b836b91748b717f8. I didn't add this patch to the PR, since it would break the current pre_init code and serenity.sh isn't able to use the efi prekernel yet.
This is currently a draft, as I still need to fix the cmake scripts.Trying to do a clean build viaserenity.sh image
currently results inerror: unable to find library -lLibELF
.The PrekernelPEImageGenerator also doesn't seem to get rerun when its code gets changed, but it seems to be rebuilt.