Add Chinese translation of tutorial 01 (#44)

Add Chinese translation of Tutorial 01

Co-authored-by: Cola Chen <colachg@gmail.com>
pull/47/head
readlnh 4 years ago committed by GitHub
parent 4e05d1f4a2
commit 2acb4152e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,38 @@
# 教程 01 - 一直等待(死循环)
## tl;dr
项目框架已经构建完成目前代码做的仅仅是挂起CPU核心执行内核代码。
- 工具链: `cargo xbuild` 工具 (包括 `xrustc` `xclippy` 以及用于构建 `AArch64` 裸机代码的 `aarch64-unknown-none-softfloat` 目标平台。
- `Makefile` 目标项:
- `doc`: 生成文档。
- `qemu`: 在 QEMU 中运行 `kernel`
- `clippy`
- `clean`
- `readelf`: 检查 `ELF` 输出。
- `objdump`: 检查汇编。
- `nm`: 检查符号。
- 代码按照 `kernel` `arch``BSP` (板级支持包)的形式组织。
- 条件编译会根据用户提供的参数编译各自的 `arch``BSP` 的内容。
- 自定义 `link.ld` 链接脚本.
- 载入地址为 `0x80_000`
- 目前仅有 `.text` 小节section
- `main.rs`: 重要的 [inner attributes]:
- `#![no_std]`, `#![no_main]`
- 汇编函数 `_start()` 会执行 `wfe` (Wait For Event) 并挂起所有正在执行 `_start()` 的核心。
- 我们(必须)定义一个 `#[panic_handler]` 函数。
- 用于等待cpu事件的发生。
[inner attributes]: https://doc.rust-lang.org/reference/attributes.html
### 测试一下!
在项目文件夹下调用 QEMU 并观察在 `wfe` 中CPU核心的运转情况
```console
» make qemu
[...]
IN:
0x00080000: d503205f wfe
0x00080004: 17ffffff b #0x80000
```
Loading…
Cancel
Save