Skip to content

Commit

Permalink
feat(x86_64): map the kernel in the higher half (#325)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
hawkw committed Sep 28, 2022
1 parent afa2b19 commit c5981b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,15 @@ wat = "1.0"
map-physical-memory = true
map-page-table-recursively = true
map-framebuffer = true
# the kernel is mapped into the higher half of the virtual address space.
dynamic-range-start = "0xFFFF_8000_0000_0000"

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


# Custom profile for Loom tests: enable release optimizations so that the loom
# tests are less slow, but don't disable debug assertions.
[profile.loom]
Expand Down
4 changes: 3 additions & 1 deletion x86_64-mycelium.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
"post-link-args": {
"ld.lld": [
"-z",
"nostart-stop-gc"
"nostart-stop-gc",
"--image-base",
"0xFFFF800000000000"
]
},
"panic-strategy": "abort",
Expand Down

0 comments on commit c5981b4

Please sign in to comment.