麻雀虽小,五脏俱全的实时操作系统。
git clone --recurse-submodules [email protected]:qclic/sparreal-os.git- 安装 Rust
- 安装依赖
cargo install ostool安装Qemu, 并加入环境变量。
安装Qemu
安装Qemu
ostool buildostool run qemuostool run qemu -dmsys2 安装 gdb-multiarch, 并添加到 PATH。
pacman -S mingw-w64-ucrt-x86_64-toolchainvscode 选择调试配置 KDebug, 点击 Run and Debug 按钮。
需要连接开发板串口。
ostool run uboot首次执行 ostool 任务后,会在根目录生成默认配置文件 .project.toml。
- 实现平台接口
- 启动内核
use sparreal_kernel::platform_if::Platform;
use sparreal_macros::api_impl;
pub struct PlatformImpl;
// 实现接口
#[api_impl]
impl Platform for PlatformImpl {
unsafe fn wait_for_interrupt() {
aarch64_cpu::asm::wfi();
}
... other fn
}