Skip to content

Commit 587654d

Browse files
committed
add doc
1 parent 00fead3 commit 587654d

File tree

1 file changed

+34
-7
lines changed

1 file changed

+34
-7
lines changed

ostool/README.md

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ostool
22

3-
Rust开发OS的工具集
3+
Rust开发OS的工具集,可以方便的通过 Qemu 和 U-Boot 启动。
44

55
## 使用
66

@@ -9,6 +9,34 @@ cargo install ostool
99
ostool --help
1010
```
1111

12+
### 配置文件
13+
14+
ArceOS为例
15+
16+
进入工作目录
17+
18+
```shell
19+
# 生成默认配置文件
20+
ostool defconfig
21+
```
22+
23+
```toml
24+
[compile]
25+
target = "aarch64-unknown-none"
26+
27+
[compile.build.Custom]
28+
# 编译命令,可多条
29+
shell = [["make ARCH=aarch64 A=examples/helloworld FEATURES=page-alloc-4g"]]
30+
# 要启动的内核
31+
kernel = "examples/helloworld/helloworld_aarch64-qemu-virt.bin"
32+
33+
[qemu]
34+
machine = "virt"
35+
cpu = "cortex-a57"
36+
graphic = false
37+
args = ""
38+
```
39+
1240
### Qemu启动
1341

1442
```shell
@@ -39,8 +67,8 @@ $remoteHost = "{ip}"
3967
$username = "{name}"
4068
$remotePath = "/home/arceos/"
4169
$makeCommand = "make A=examples/helloworld PLATFORM=aarch64-phytium-pi "
42-
$remoteFile = "$remotePath/examples/helloworld/helloworld_aarch64-phytium-pi.elf"
43-
$localTargetFile = "./target/kernel_raw.elf"
70+
$remoteFile = "$remotePath/examples/helloworld/helloworld_aarch64-phytium-pi.bin"
71+
$localTargetFile = "./target/kernel_raw.bin"
4472
4573
# 使用 SSH 连接到远程服务器并执行命令
4674
ssh "$username@$remoteHost" "cd $remotePath;. ~/.profile;$makeCommand"
@@ -73,13 +101,13 @@ else {
73101
[compile]
74102
target = "aarch64-unknown-none-softfloat"
75103

76-
[compile.custom]
104+
[compile.build.Custom]
77105
shell = [
78106
[
79107
"pwsh -f ./remote_build.ps1",
80108
]
81109
]
82-
elf = "target/kernel_raw.elf"
110+
kernel = "target/kernel_raw.bin"
83111

84112
[qemu]
85113
machine = "virt"
@@ -90,6 +118,5 @@ args = "-smp 2"
90118
[uboot]
91119
serial = "COM3"
92120
baud_rate = 115200
93-
net = "以太网"
94-
dtb_file = "tools\\phytium_pi\\phytiumpi_firefly.dtb"
121+
dtb_file = "tools/phytium_pi/phytiumpi_firefly.dtb"
95122
```

0 commit comments

Comments
 (0)