Skip to content

Add bootinfo tag#536

Draft
terryzbai wants to merge 8 commits into
seL4:mainfrom
au-ts:add-bootinfo-tag
Draft

Add bootinfo tag#536
terryzbai wants to merge 8 commits into
seL4:mainfrom
au-ts:add-bootinfo-tag

Conversation

@terryzbai

@terryzbai terryzbai commented Jun 25, 2026

Copy link
Copy Markdown

This PR is rebased on branch rust_sel4_update_to_main, which should be merged soon. The proposed feature is included in the only last 3 commits.

This PR adds the bootinfo tag to map specified type of bootinfo into PD's vspace, and patch the address to pre-declared variable bootinfo_{bi_type}. This is useful for the cases where the userspace applications needs to consume bootinfo, e.g., RSDP in ACPI driver, TSC used as clock source, etc.

The usage of bootinfo tag is added in the example x86_64_ioport. It works with this rust-sel4 PR on x86 to show how TSC frequency is mapped and read by a PD.

Previously, the ELF code treats program headers = segments. While this
worked originally, it broke for cases that requires >= 2 program
headers to refer to the same segment.

Now, when the ELF is parsed, the code will create a 1-1 mapping of
segments to program headers like before. But the allow for additional
program headers to be inserted.

Signed-off-by: Bill Nguyen <bill.nguyen@unsw.edu.au>
Added `pub fn phdrs_table(&self) -> Vec<(ElfProgramHeader64, usize)>` to
ELF code.

Signed-off-by: Bill Nguyen <bill.nguyen@unsw.edu.au>
Modified `pub fn add_segment()` to allow for an additional program
header in the ELF to describe the segment with a user defined type
identifier.

Signed-off-by: Bill Nguyen <bill.nguyen@unsw.edu.au>
Which also required changes to how the spec is packed into the
intialiser.

Signed-off-by: Bill Nguyen <bill.nguyen@unsw.edu.au>
Comment thread tool/microkit/src/sdf.rs Outdated
Comment thread tool/microkit/src/sdf.rs Outdated
Comment thread tool/microkit/src/sdf.rs Outdated
Comment thread tool/microkit/src/sdf.rs Outdated
Comment thread tool/microkit/src/sel4.rs Outdated
Comment thread example/x86_64_ioport/x86_64_ioport.c Outdated
Comment thread example/bootinfo/bootinfo.system Outdated
Comment thread example/bootinfo/README.md Outdated
Comment thread tool/microkit/src/sdf.rs Outdated
Comment thread docs/manual.md
Comment thread tool/microkit/src/sdf.rs Outdated

@midnightveil midnightveil left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving, but this needs the dependant rust-sel4 changes merged first.

Comment thread docs/manual.md Outdated
Comment thread tool/microkit/src/sdf.rs
This extends MRs to get prefilled with BootInfo by the capDL
initialiser. One can specify the expected BootInfo type via
'prefill_bootinfo', and map it to PDs like other MRs.

This is useful for the cases where the userland needs to
access some of boot information, e.g., RSDP in ACPI driver.

Signed-off-by: Terry Bai <tianyi.bai@unsw.edu.au>
This adds an example showing how to map a bootinfo-prefilled
MR to a PD. As the DTB is not passed through by Microkit loader,
it isn't obvious to demonstrate the feature on ARM and RISC-V.

For x86, this example reads the TSC frequency and prints it.

Signed-off-by: Terry Bai <tianyi.bai@unsw.edu.au>
Add feature explanation for bootinfo prefilling to manual.

Signed-off-by: Terry Bai <tianyi.bai@unsw.edu.au>
This adds two test cases for bootinfo prefilling feature:

test_mr_prefill_bootinfo_valid: the tool should successully
parse the SDF that includes a valid bootinfo prefilling MR.

test_mr_prefill_path_bootinfo_both_specified: the error
should be detected when both 'prefill_path' and
'prefill_bootinfo' are specified.

Signed-off-by: Terry Bai <tianyi.bai@unsw.edu.au>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants