-
Notifications
You must be signed in to change notification settings - Fork 49
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
Microkit x86 #244
Draft
matneutrality
wants to merge
11
commits into
seL4:main
Choose a base branch
from
Neutrality-ch:microkit-x86-rust-rebased
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
Microkit x86 #244
Conversation
This file contains 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
Signed-off-by: Mathieu Mirmont <[email protected]>
And the matching PR for the changes to the seL4 kernel: seL4/seL4#1340 |
Signed-off-by: Mathieu Mirmont <[email protected]>
matneutrality
force-pushed
the
microkit-x86-rust-rebased
branch
from
November 1, 2024 10:29
b74d9ac
to
4836909
Compare
Signed-off-by: Mathieu Mirmont <[email protected]>
The boot protocol is sufficiently different on x86 compared to ARM and RISC-V to justify making a custom loader. Signed-off-by: Mathieu Mirmont <[email protected]>
Signed-off-by: Mathieu Mirmont <[email protected]>
Signed-off-by: Mathieu Mirmont <[email protected]>
Signed-off-by: Mathieu Mirmont <[email protected]>
Signed-off-by: Mathieu Mirmont <[email protected]>
This list can be quite handy when porting to a new board. Signed-off-by: Mathieu Mirmont <[email protected]>
Signed-off-by: Mathieu Mirmont <[email protected]>
Signed-off-by: Mathieu Mirmont <[email protected]>
matneutrality
force-pushed
the
microkit-x86-rust-rebased
branch
from
November 22, 2024 16:41
aece431
to
e159a1a
Compare
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.
This PR adds support for x86_64 hardware, with a QEMU emulated machine and an Odroid H2+ board as reference targets. X86 is quite a different beast compared to ARM and RISCV, so a few things to note about this port:
No device tree
On x86 we typically don't have a convenient device tree file describing the target and available at compile time. Instead the hardware is discovered at runtime by walking the ACPI tables, quering arcane BIOS ROMs, and sometimes by poking known memory addresses. The Microkit tool needs to emulate the seL4 boot on the target so we need to know some things about the target at compile time to build an image.
We do this by providing a machine description file to the Microkit tool when building x86 images. This is a simple JSON file that can be produced in various ways. Currently we use the bootable Microkit x86 Machine Dump tool that is run on the target board and produces the JSON file on a serial port. The boards that we target typically have serial ports, either physical or remotely accessible via the BMC/IPMI, so this simple tool covers our needs.
The example boards come with the
machine.json
files.Boot protocol
The Microkit loader populates a region of memory with the contents of the PDs and passes this region to the seL4 kernel to be marked as
device
memory. On ARM and RISCV this region is passed via two extra registers when jumping to the seL4 entry point.On x86 the kernel follows the multiboot boot protocol and generally use the popular GNU GRUB bootloader, alleviating the need for an ELF loader. The bootloader enables protected mode (32-bit) with a flat 1:1 memory map. We pass the extra memory region with the PDs to the kernel via a custom multiboot
tag
. This requires very few changes to the seL4 kernel code and fits nicely with the boot code. Since the bootloader can directly load 32-bit ELF files, the system image is packed as an ELF32 binary with the seL4 kernel and all PDs as segments, letting the bootloader do the work. The x86 Microkit loader therefore does not actually load anything: it only adds a tag to the multiboot tables received from the bootloader and jumps into the kernel entry point.