48 releases (4 breaking)

0.5.9 Feb 5, 2025
0.5.8 Jan 28, 2025
0.4.1 Jan 6, 2025
0.3.19 Dec 30, 2024
0.1.1 Oct 25, 2024

#86 in Operating systems

Download history 2001/week @ 2024-10-29 303/week @ 2024-11-05 116/week @ 2024-11-12 24/week @ 2024-11-19 980/week @ 2024-11-26 638/week @ 2024-12-03 312/week @ 2024-12-10 10/week @ 2024-12-17 116/week @ 2024-12-24 189/week @ 2024-12-31 654/week @ 2025-01-07 201/week @ 2025-01-14 266/week @ 2025-01-21 122/week @ 2025-01-28 178/week @ 2025-02-04 15/week @ 2025-02-11

605 downloads per month

MIT/Apache

58KB
1.5K SLoC

ostool

Rust开发OS的工具集

使用

cargo install ostool
ostool --help

Qemu启动

ostool run qemu
# debug
ostool run qemu -d

U-Boot 启动

linux tftp 使用69端口,为特权接口,需要为应用授予权限:

sudo setcap cap_net_bind_service=+eip $(which ostool)
ostool run uboot

远程构建示例

# remote_build.ps1

# 定义远程服务器的连接信息
$remoteHost = "{ip}"
$username = "{name}"
$remotePath = "/home/arceos/"
$makeCommand = "make A=examples/helloworld PLATFORM=aarch64-phytium-pi "
$remoteFile = "$remotePath/examples/helloworld/helloworld_aarch64-phytium-pi.elf"
$localTargetFile = "./target/kernel_raw.elf"

# 使用 SSH 连接到远程服务器并执行命令
ssh "$username@$remoteHost" "cd $remotePath;. ~/.profile;$makeCommand"

if ($?) {
    Write-Host "remote build ok"

}
else {
    Write-Host "remote build fail"
    exit 1
}

# 使用 SCP 将远程文件拷贝到本地目标路径并重命名为 kernel.elf
$cmd = "scp $username@${remoteHost}:${remoteFile} $localTargetFile"
Write-Host "exec: $cmd"
Invoke-Expression $cmd
if ($?) {
    Write-Host "copy ok"
}
else {
    Write-Host "copy fail"
    exit 1
}

.project.toml

[compile]
target = "aarch64-unknown-none-softfloat"

[compile.custom]
shell = [
    [
        "pwsh -f ./remote_build.ps1",
    ]
]
elf = "target/kernel_raw.elf"

[qemu]
machine = "virt"
cpu = "cortex-a53"
graphic = false
args = "-smp 2"

[uboot]
serial = "COM3"
baud_rate = 115200
net = "以太网"
dtb_file = "tools\\phytium_pi\\phytiumpi_firefly.dtb"

Dependencies

~12–23MB
~363K SLoC