Skip to content

Commit c5981b4

Browse files
committed
feat(x86_64): map the kernel in the higher half (#325)
Version [0.10.13][1] of `bootloader` made it possible to configure the start address of the dynamic range into which the kernel binary is mapped (see rust-osdev/bootloader#229). This allows us to configure the bootloader to boot with the kernel already mapped into the higher half of the virtual address space, which seems nice. [1]: https://github.com/rust-osdev/bootloader/blob/main/Changelog.md#01013--2022-09-25
1 parent afa2b19 commit c5981b4

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,15 @@ wat = "1.0"
8080
map-physical-memory = true
8181
map-page-table-recursively = true
8282
map-framebuffer = true
83+
# the kernel is mapped into the higher half of the virtual address space.
84+
dynamic-range-start = "0xFFFF_8000_0000_0000"
8385

8486
[patch.crates-io]
8587
# use `tracing` 0.2 from git
8688
tracing = { git = "https://github.com/tokio-rs/tracing" }
8789
tracing-core = { git = "https://github.com/tokio-rs/tracing" }
8890

91+
8992
# Custom profile for Loom tests: enable release optimizations so that the loom
9093
# tests are less slow, but don't disable debug assertions.
9194
[profile.loom]

x86_64-mycelium.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
"post-link-args": {
1414
"ld.lld": [
1515
"-z",
16-
"nostart-stop-gc"
16+
"nostart-stop-gc",
17+
"--image-base",
18+
"0xFFFF800000000000"
1719
]
1820
},
1921
"panic-strategy": "abort",

0 commit comments

Comments
 (0)