LoGin 23ef2b33d1
riscv: 把内核编译target改为riscv64gc & 获取time csr的频率 & 修正浮点保存与恢复的汇编的问题 (#699)
* 1. 把内核编译target改为riscv64gc
2. fix: 修正浮点保存与恢复的汇编的问题

* riscv: 获取time csr的频率
2024-04-06 22:13:26 +08:00

32 lines
951 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 目标架构配置
## 支持的架构
- x86_64
- riscv64
## 架构相关配置
为了能支持vscode的调试功能我们需要修改`.vscode/settings.json`文件的以下行:
```
"rust-analyzer.cargo.target": "riscv64gc-unknown-none-elf",
// "rust-analyzer.cargo.target": "x86_64-unknown-none",
```
如果想要为x86_64架构编译请启用x86_64那一行注释掉其它的。
如果想要为riscv64架构编译请启用riscv64那一行注释掉其它的。
同时我们还需要修改makefile的环境变量配置
请修改`env.mk`文件的以下行:
```Makefile
ifeq ($(ARCH), )
# 在这里设置ARCH可选x86_64和riscv64
# !!!!!!!如果不同时调整这里以及vscode的settings.json那么自动补全和检查将会失效
export ARCH=riscv64
endif
```
请注意,更换架构需要重新编译,因此请运行`make clean`清理编译结果。然后再运行`make run`即可。