Skip to content

Commit

Permalink
chore: get kernel compiling on nightly-2025-01-01 (#502)
Browse files Browse the repository at this point in the history
Update our Rust toolchain to nightly-2025-01-01, and update `bootloader`
to compile on that version.

It currently panics because the latest bootloader maps some stuff on
huge pages which we don't expect...
  • Loading branch information
hawkw committed Jan 4, 2025
1 parent 7bf0b22 commit 7301300
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 21 deletions.
24 changes: 16 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion hal-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Eliza Weisman <[email protected]>", "iximeow <[email protected]>"]
edition = "2021"
license = "MIT"
rust_version = "1.81.0"
rust-version = "1.81.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
2 changes: 1 addition & 1 deletion hal-x86_64/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Eliza Weisman <[email protected]>", "iximeow <[email protected]>"]
edition = "2021"
license = "MIT"
rust_version = "1.81.0"
rust-version = "1.81.0"

[features]
default = ["alloc"]
Expand Down
9 changes: 7 additions & 2 deletions hal-x86_64/src/segment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,15 @@ impl Selector {
tracing::trace!("setting code segment...");
asm!(
"push {selector}",
"lea {retaddr}, [1f + rip]",
"lea {retaddr}, [2f + rip]",
"push {retaddr}",
"retfq",
"1:",
// This is cool: apparently we can't use '0' or '1' as a label in
// LLVM assembly, due to an LLVM bug:
// https://github.com/llvm/llvm-project/issues/99547
//
// So, this is 2 instead of 1. lmao.
"2:",
selector = in(reg) self.0 as u64,
retaddr = lateout(reg) _,
options(preserves_flags),
Expand Down
4 changes: 2 additions & 2 deletions inoculate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ tracing = "0.1.23"
tracing-subscriber = "0.3.16"
tracing-error = "0.2"
color-eyre = "0.6"
bootloader = "0.11.2"
bootloader = "0.11.9"
bootloader-boot-config = "0.11.3"
locate-cargo-manifest = "0.2"
wait-timeout = "0.2"
Expand All @@ -25,4 +25,4 @@ atty = "0.2"
mycotest = { path = "../mycotest", features = ["alloc"] }
heck = "0.3.3"
# used for UEFI booting in QEMU
ovmf-prebuilt = "0.1.0-alpha.1"
ovmf-prebuilt = "0.1.0-alpha.1"
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[toolchain]
channel = "nightly-2024-01-20"
channel = "nightly-2025-01-01"
components = [
"clippy",
"rustfmt",
Expand Down
5 changes: 1 addition & 4 deletions src/arch/x86_64/oops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,7 @@ pub fn oops(oops: Oops<'_>) -> ! {
} => writeln!(mk_writer.make_writer(), "a {kind} occurred!\n").unwrap(),
OopsSituation::Panic(panic) => {
let mut writer = mk_writer.make_writer();
match panic.message() {
Some(msg) => writeln!(writer, "mycelium panicked: {msg}").unwrap(),
None => writeln!(writer, "mycelium panicked!").unwrap(),
}
write!(writer, "mycelium panicked: {}", panic.message()).unwrap();
if let Some(loc) = panic.location() {
writeln!(writer, "at {}:{}:{}", loc.file(), loc.line(), loc.column()).unwrap();
}
Expand Down
4 changes: 2 additions & 2 deletions x86_64-mycelium.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"llvm-target": "x86_64-unknown-none",
"data-layout": "e-m:e-i64:64-f80:128-n8:16:32:64-S128",
"data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128",
"arch": "x86_64",
"target-endian": "little",
"target-pointer-width": "64",
Expand All @@ -21,4 +21,4 @@
"panic-strategy": "abort",
"disable-redzone": true,
"features": "-mmx,-sse,+soft-float"
}
}

0 comments on commit 7301300

Please sign in to comment.