Change build target to `riscv32ia_unknown_none`

master
WangRunji 6 years ago
parent f571db5076
commit 37564cb9fd

@ -38,7 +38,7 @@ simple-filesystem = { git = "https://github.com/wangrunji0408/SimpleFileSystem-R
bit-allocator = { path = "crate/bit-allocator" } bit-allocator = { path = "crate/bit-allocator" }
ucore-memory = { path = "crate/memory" } ucore-memory = { path = "crate/memory" }
[target.riscv32i-unknown-none.dependencies] [target.riscv32-blog_os.dependencies]
riscv = { path = "crate/riscv" } riscv = { path = "crate/riscv" }
bbl = { path = "crate/bbl" } bbl = { path = "crate/bbl" }

@ -13,9 +13,6 @@ arch ?= riscv32
kernel := build/kernel-$(arch).bin kernel := build/kernel-$(arch).bin
iso := build/os-$(arch).iso iso := build/os-$(arch).iso
target ?= $(arch)-blog_os target ?= $(arch)-blog_os
ifeq ($(arch), riscv32)
target := riscv32i-unknown-none
endif
mode ?= debug mode ?= debug
rust_lib := target/$(target)/$(mode)/librust_ucore.a rust_lib := target/$(target)/$(mode)/librust_ucore.a

@ -7,6 +7,20 @@
具体配置过程详见[Dockerfile](../riscv-env/Dockerfile) 具体配置过程详见[Dockerfile](../riscv-env/Dockerfile)
## Rust-RISCV
### 目标指令集RISCV32IA
target: riscv32ia_unknown_none
由于工具链二进制版本尚未内置`riscv32ia_unknown_none`的target因此需提供配置文件`riscv32-blog_os.json`。
为什么要用原子指令扩展?
RustOS依赖的库中大部分都使用了Rust核心库的原子操作core::sync::atomic
如果目标指令集不支持原子操作,会导致无法编译。
## BootLoader ## BootLoader
参考[bbl-ucore](https://github.com/ring00/bbl-ucore)及后续的[ucore_os_lab for RISCV32](https://github.com/chyyuu/ucore_os_lab/tree/riscv32-priv-1.10),使用[bbl](https://github.com/riscv/riscv-pk.git)作为BootLoader。 参考[bbl-ucore](https://github.com/ring00/bbl-ucore)及后续的[ucore_os_lab for RISCV32](https://github.com/chyyuu/ucore_os_lab/tree/riscv32-priv-1.10),使用[bbl](https://github.com/riscv/riscv-pk.git)作为BootLoader。

@ -0,0 +1,30 @@
{
"llvm-target": "riscv32",
"data-layout": "e-m:e-p:32:32-i64:64-n32-S128",
"target-endian": "little",
"target-pointer-width": "32",
"target-c-int-width": "32",
"os": "none",
"arch": "riscv",
"cpu": "generic-rv32",
"features": "+a",
"max-atomic-width": "32",
"linker": "ld.lld",
"linker-flavor": "ld",
"executables": true,
"panic-strategy": "abort",
"relocation-model": "static",
"abi-blacklist": [
"cdecl",
"stdcall",
"fastcall",
"vectorcall",
"thiscall",
"aapcs",
"win64",
"sysv64",
"ptx-kernel",
"msp430-interrupt",
"x86-interrupt"
]
}
Loading…
Cancel
Save