Skip to content

Commit d0ee81f

Browse files
committed
tool: add bootinfo tag
This adds the 'bootinfo' tag to map specified type of bootinfo into PD's vspace, and patch the location to the pre-declared variable. This is useful for the cases where the userland needs to access some of boot information, e.g., RSDP in ACPI driver. The example shows how TSC Frequency is mapped and read by a PD. Signed-off-by: Terry Bai <tianyi.bai@unsw.edu.au>
1 parent d9b1e0a commit d0ee81f

7 files changed

Lines changed: 181 additions & 51 deletions

File tree

Cargo.lock

Lines changed: 30 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ members = [
1212
]
1313

1414
[workspace.dependencies.sel4-capdl-initializer]
15-
git = "https://github.com/seL4/rust-sel4"
16-
rev = "c30d0e44fb32c15239049ce402ef2a8c72499aa3"
15+
git = "https://github.com/au-ts/rust-sel4"
16+
rev = "535c47d3044f1de7dd54b80d485b51f9e105c8be"
1717

1818
[workspace.dependencies.sel4-capdl-initializer-types]
19-
git = "https://github.com/seL4/rust-sel4"
20-
rev = "c30d0e44fb32c15239049ce402ef2a8c72499aa3"
19+
git = "https://github.com/au-ts/rust-sel4"
20+
rev = "535c47d3044f1de7dd54b80d485b51f9e105c8be"
2121

2222
[profile.release.package.microkit-tool]
2323
strip = true

example/x86_64_ioport/x86_64_ioport.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,14 @@
66
#include <stdint.h>
77
#include <microkit.h>
88

9+
typedef struct {
10+
seL4_BootInfoHeader header;
11+
uint32_t value;
12+
} bootinfo_tsc_freq_t;
13+
914
uint64_t com1_ioport_id;
1015
uint64_t com1_ioport_addr;
16+
bootinfo_tsc_freq_t *bootinfo_tsc_freq;
1117

1218
static inline void serial_putc(char ch)
1319
{
@@ -31,6 +37,10 @@ void init(void)
3137
microkit_dbg_puts(microkit_name);
3238
microkit_dbg_puts("\n");
3339

40+
microkit_dbg_puts("TSC Frequency: ");
41+
microkit_dbg_put32(bootinfo_tsc_freq->value);
42+
microkit_dbg_puts("MHz\n");
43+
3444
microkit_dbg_puts("Now writing to serial I/O port: ");
3545
serial_puts("hello!\n");
3646
}

example/x86_64_ioport/x86_64_ioport.system

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<system>
88
<protection_domain name="x86_64_ioport" priority="100" >
99
<program_image path="x86_64_ioport.elf" />
10+
<bootinfo type="tsc_freq" />
1011
<ioport id="0" addr="0x3f8" size="8" setvar_id="com1_ioport_id" setvar_addr="com1_ioport_addr"/>
1112
</protection_domain>
1213
</system>

0 commit comments

Comments
 (0)