diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 36b566f..c2d664a 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -6,20 +6,20 @@ // https://containers.dev/implementors/json_reference/#variables-in-devcontainerjson { "name": "unCORE", - "image": "ghcr.io/georglauterbach/dev-container-base:2.0.0", + "image": "ghcr.io/georglauterbach/dev-container-base:2.1.0", "features": { - "ghcr.io/georglauterbach/dev-container-features/rust:0.5.0": { - "additional-packages": "gdb-multiarch,jq,qemu-system-riscv64", - "install-mold": "true" + "ghcr.io/georglauterbach/dev-container-features/rust:4.0.0": { + "system.packages.additional-packages": "gdb-multiarch,jq,qemu-system-riscv64", + "linker.mold.install": "true" } }, "updateRemoteUserUID": true, "remoteUser": "ubuntu", "containerUser": "ubuntu", "containerEnv": { - "CARGO_TARGET_DIR": "${containerWorkspaceFolder}/code/.dev_container/target", - "CARGO_HOME": "${containerWorkspaceFolder}/code/.dev_container/cargo_home", - "RUSTUP_HOME": "${containerWorkspaceFolder}/code/.dev_container/rustup_home", + "CARGO_TARGET_DIR": "${containerWorkspaceFolder}/code/target", + "CARGO_HOME": "${containerWorkspaceFolder}/code/.cargo_home", + "RUSTUP_HOME": "${containerWorkspaceFolder}/code/.rustup", "HERMES_LOAD_WRAPPER": "true" }, // The repository root directory is mounted to `${containerWorkspaceFolder}` @@ -28,7 +28,7 @@ // (that Cargo detects from the workspace setup in this directory). "postStartCommand": { "rustup --version": "rustup --version", - "cargo --version && rustc --version": "cd \"${containerWorkspaceFolder}/code\" ; cargo --version ; rustc --version ;", + "cargo --version && rustc --version": "cargo --version ; rustc --version ;", "mold --version": "mold --version", "VS Code setup tasks": "mkdir -p \"${containerWorkspaceFolder}/.vscode\" && cp --update=none \"${containerWorkspaceFolder}/.devcontainer/vscode/\"* \"${containerWorkspaceFolder}/.vscode/\"" }, @@ -38,8 +38,6 @@ "ZixuanWang.linkerscript", "sunshaoce.RISC-V", "webfreak.debug", - "bierner.docs-view", - "EditorConfig.EditorConfig", "streetsidesoftware.code-spell-checker" ], "settings": { @@ -47,12 +45,13 @@ "files.insertFinalNewline": true, "files.trimTrailingWhitespace": true, "files.exclude": { - "**/.git": true + "code/.rustup": true, + "code/.cargo_home": true }, "files.watcherExclude": { - "**/.git/objects/": true, "code/target": true, - "code/.dev_container/": true + "code/.rustup": true, + "code/.cargo_home": true }, // ? extensions // * extensions::docsView diff --git a/.gitignore b/.gitignore index 973eb06..49af59b 100644 --- a/.gitignore +++ b/.gitignore @@ -24,7 +24,5 @@ documentation/site # ----------------------------------------------- code/target/ -code/.dev_container/ - -code/.cargo/home/ -code/.cargo/rustup/ +code/.rustup +code/.cargo_home diff --git a/code/Cargo.lock b/code/Cargo.lock index 39525a7..77067c1 100644 --- a/code/Cargo.lock +++ b/code/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "aho-corasick" @@ -366,9 +366,9 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "owo-colors" -version = "4.0.0" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caff54706df99d2a78a5a4e3455ff45448d81ef1bb63c22cd14052ca0e993a3f" +checksum = "fb37767f6569cd834a413442455e0f066d0d522de8630436e2a1761d9726ba56" [[package]] name = "proc-macro2" diff --git a/code/rust-toolchain.toml b/code/rust-toolchain.toml index 9f35b33..d3caccd 100644 --- a/code/rust-toolchain.toml +++ b/code/rust-toolchain.toml @@ -11,7 +11,7 @@ # General information about the keys below can be found under # https://rust-lang.github.io/rustup/concepts/index.html [toolchain] -channel = 'nightly-2024-09-28' +channel = 'nightly-2024-10-10' components = [ 'cargo', 'rustc', 'rust-std', 'clippy', 'rustfmt' ] targets = [ 'riscv64gc-unknown-none-elf', diff --git a/code/src/arguments.rs b/code/src/arguments.rs index 46b5e7e..18fcc19 100644 --- a/code/src/arguments.rs +++ b/code/src/arguments.rs @@ -98,9 +98,6 @@ impl ArchitectureSpecification { /// 64bit. fn riscv64() -> Self { let mut kernel_binary_path = Self::append_to_base_dir("/"); - if crate::environment::is_inside_container() { - kernel_binary_path.push_str(".dev_container/"); - }; kernel_binary_path.push_str("target/riscv64gc-unknown-none-elf/debug/uncore"); Self { diff --git a/code/uncore/Cargo.toml b/code/uncore/Cargo.toml index efb0d6a..44a1e48 100644 --- a/code/uncore/Cargo.toml +++ b/code/uncore/Cargo.toml @@ -64,7 +64,7 @@ workspace = true linked_list_allocator = "0.10.5" log = "0.4.22" riscv-rt = { version = "0.12.2", features = ["s-mode"] } -owo-colors = "4.0.0" +owo-colors = "4.1.0" sbi = "0.2.0" spin = "0.9.8" diff --git a/code/uncore/src/library/prelude.rs b/code/uncore/src/library/prelude.rs index a3c54a0..2657a80 100644 --- a/code/uncore/src/library/prelude.rs +++ b/code/uncore/src/library/prelude.rs @@ -46,11 +46,11 @@ macro_rules! panic_on_error { /// [this guide](https://mcyoung.xyz/2021/06/01/linker-script/#linker-symbols). macro_rules! transform_linker_symbol_to_value { ($identifier:ident) => { - unsafe { core::ptr::addr_of!($identifier) } + core::ptr::addr_of!($identifier) }; (mut $identifier:ident) => { - unsafe { core::ptr::addr_of_mut!($identifier) } + core::ptr::addr_of_mut!($identifier) }; ($identifier:ident, $final_type:ty) => { diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 120000 index 0000000..dab9474 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1 @@ +./code/rust-toolchain.toml \ No newline at end of file