Skip to content

Commit

Permalink
update code & Dev Container
Browse files Browse the repository at this point in the history
  • Loading branch information
georglauterbach committed Oct 12, 2024
1 parent 2ab14bd commit 693dc73
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 27 deletions.
25 changes: 12 additions & 13 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
Expand All @@ -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/\""
},
Expand All @@ -38,21 +38,20 @@
"ZixuanWang.linkerscript",
"sunshaoce.RISC-V",
"webfreak.debug",
"bierner.docs-view",
"EditorConfig.EditorConfig",
"streetsidesoftware.code-spell-checker"
],
"settings": {
// ? files
"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
Expand Down
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,5 @@ documentation/site
# -----------------------------------------------

code/target/
code/.dev_container/

code/.cargo/home/
code/.cargo/rustup/
code/.rustup
code/.cargo_home
6 changes: 3 additions & 3 deletions code/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 code/rust-toolchain.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
3 changes: 0 additions & 3 deletions code/src/arguments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion code/uncore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
4 changes: 2 additions & 2 deletions code/uncore/src/library/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
1 change: 1 addition & 0 deletions rust-toolchain.toml

0 comments on commit 693dc73

Please sign in to comment.