-
Notifications
You must be signed in to change notification settings - Fork 4
Implement Linux bootable image support #20
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
base: main
Are you sure you want to change the base?
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
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.
Thanks for the PR! I like the idea of supporting the Linux boot protocol (so far I've only used this for binaries loaded at a fixed address, like a bootloader), but I'm not sure that copying to a fixed address will always work. You'll also need to sign the CLA before I can accept anything.
cb2893c
to
36296ef
Compare
Was busy with work but had time to look into this just now. I got the relocate solution working, with the following caveats:
Also fixed the CLA check, and guarded the relocate logic behind a EDIT: I made an example by copying the |
3cae637
to
60e7a0f
Compare
One thing missing is that the |
Rebased against |
Follow the https://docs.kernel.org/arch/arm64/booting.html protocol to allow building a bootable linux-like image. To allow for any load address, perform relocations before jumping to the rust entrypoint. Guard relocation logic behind "relocation" Cargo feature. Signed-off-by: Manos Pitsidianakis <[email protected]>
Follow the https://docs.kernel.org/arch/arm64/booting.html protocol to allow building a bootable linux-like image.
This'd be ideal for a compile once, run "anywhere" use-case.
I've been able to create linux bootable images with this diff.
file(1)
recognizes the image asLinux kernel ARM64 boot executable Image, little-endian, 4K pages
and QEMU can boot it with direct kernel boot. Also with Xen under QEMU by loading the image as the dom0 with theguest-loader
device.Finally, I added the UEFI
MZ
magic as the first instruction but I haven't had time to look into writing a proper stub.TODOs: