diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index d697db2..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "crate/riscv"] - path = crate/riscv - url = https://github.com/riscv-and-rust-and-decaf/riscv.git diff --git a/README.md b/README.md index c919f81..27462ca 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ cargo install cargo-xbuild bootimage ``` ```bash -git clone https://github.com/wangrunji0408/RustOS.git --recursive +git clone https://github.com/wangrunji0408/RustOS.git cd RustOS/kernel rustup override set nightly-2018-09-18 make run arch=riscv32|x86_64 diff --git a/crate/riscv b/crate/riscv deleted file mode 160000 index f358204..0000000 --- a/crate/riscv +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f358204af01f2374ab6ed6ea059f724cd5f2fe6f diff --git a/kernel/Cargo.lock b/kernel/Cargo.lock index 7e1f148..1e0ee5c 100644 --- a/kernel/Cargo.lock +++ b/kernel/Cargo.lock @@ -175,6 +175,7 @@ dependencies = [ [[package]] name = "riscv" version = "0.3.0" +source = "git+https://github.com/riscv-and-rust-and-decaf/riscv#f358204af01f2374ab6ed6ea059f724cd5f2fe6f" dependencies = [ "bare-metal 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "bit_field 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -265,7 +266,7 @@ dependencies = [ "once 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "raw-cpuid 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", - "riscv 0.3.0", + "riscv 0.3.0 (git+https://github.com/riscv-and-rust-and-decaf/riscv)", "simple-filesystem 0.0.1 (git+https://github.com/wangrunji0408/SimpleFileSystem-Rust)", "spin 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", "uart_16550 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -390,6 +391,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum raw-cpuid 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "41219962ecab392f1e68db9e7ebd972800d4045a128cc23462b384e8c312cde1" "checksum redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1" "checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5" +"checksum riscv 0.3.0 (git+https://github.com/riscv-and-rust-and-decaf/riscv)" = "" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" diff --git a/kernel/Cargo.toml b/kernel/Cargo.toml index bbc7703..1c86afd 100644 --- a/kernel/Cargo.toml +++ b/kernel/Cargo.toml @@ -40,7 +40,7 @@ redox_syscall = "0.1" uart_16550 = "0.1" [target.'cfg(target_arch = "riscv32")'.dependencies] -riscv = { path = "../crate/riscv" } +riscv = { git = "https://github.com/riscv-and-rust-and-decaf/riscv" } bbl = { path = "../crate/bbl" } [package.metadata.bootimage] diff --git a/kernel/riscv32-blog_os.json b/kernel/riscv32-blog_os.json index ab160b8..33e9156 100644 --- a/kernel/riscv32-blog_os.json +++ b/kernel/riscv32-blog_os.json @@ -9,12 +9,11 @@ "cpu": "generic-rv32", "features": "", "max-atomic-width": "32", - "linker": "riscv64-unknown-elf-ld", - "linker-flavor": "ld", + "linker": "rust-lld", + "linker-flavor": "ld.lld", "pre-link-args": { - "ld": [ - "-Tsrc/arch/riscv32/boot/linker.ld", - "-melf32lriscv" + "ld.lld": [ + "-Tsrc/arch/riscv32/boot/linker.ld" ] }, "executables": true, diff --git a/user/riscv32-ucore.json b/user/riscv32-ucore.json index 621b0da..37dac6f 100644 --- a/user/riscv32-ucore.json +++ b/user/riscv32-ucore.json @@ -9,13 +9,8 @@ "cpu": "generic-rv32", "features": "", "max-atomic-width": "32", - "linker": "riscv64-unknown-elf-ld", - "linker-flavor": "ld", - "pre-link-args": { - "ld": [ - "-melf32lriscv" - ] - }, + "linker": "rust-lld", + "linker-flavor": "ld.lld", "executables": true, "panic-strategy": "abort", "relocation-model": "static",