From 5abf7691e664b0502ba030bb5063620a478adcc7 Mon Sep 17 00:00:00 2001 From: equation314 Date: Thu, 27 Dec 2018 18:36:27 +0800 Subject: [PATCH] aarch64/doc: update boot.md & table of contents --- docs/2_OSLab/g2/boot.md | 15 +++++++++++++-- docs/2_OSLab/g2/drivers.md | 12 +++++++++++- docs/2_OSLab/g2/interrupt.md | 1 + docs/2_OSLab/g2/peripherals.md | 1 - docs/2_OSLab/g2/raspi3.md | 4 ++-- 5 files changed, 27 insertions(+), 6 deletions(-) create mode 100644 docs/2_OSLab/g2/interrupt.md delete mode 100644 docs/2_OSLab/g2/peripherals.md diff --git a/docs/2_OSLab/g2/boot.md b/docs/2_OSLab/g2/boot.md index f838739..d17118c 100644 --- a/docs/2_OSLab/g2/boot.md +++ b/docs/2_OSLab/g2/boot.md @@ -48,7 +48,18 @@ SECTIONS { ## boot.S -CPU 启动代码位于 `kernel/src/arch/aarch64/boot/boot.S`,主要流程如下: +CPU 启动代码位于 `kernel/src/arch/aarch64/boot/boot.S`,负责初始化一些系统寄存器,并将当前异常级别(exception level)切换到 EL1。 + +AArch64 有 4 个异常级别,相当于 x86 的特权级,分别为: + +* EL0: Applications. +* EL1: OS kernel and associated functions that are typically described as privileged. +* EL2: Hypervisor. +* EL3: Secure monitor. + +在 RustOS 中,内核将运行在 EL1 上,用户程序将运行在 EL0 上。 + +`boot.S` 的主要流程如下: 1. 获取核的编号,目前只使用 0 号核,其余核将被闲置: @@ -66,7 +77,7 @@ CPU 启动代码位于 `kernel/src/arch/aarch64/boot/boot.S`,主要流程如 b halt ``` -2. 读取当前异常级别(Exception level): +2. 读取当前异常级别: ```armasm # read the current exception level into x0 (ref: C5.2.1) diff --git a/docs/2_OSLab/g2/drivers.md b/docs/2_OSLab/g2/drivers.md index dd94d13..2d415c9 100644 --- a/docs/2_OSLab/g2/drivers.md +++ b/docs/2_OSLab/g2/drivers.md @@ -1 +1,11 @@ -# 驱动 +# 设备驱动 + +## Mini UART + +## Timer + +## Mailbox + +## Framebuffer + +## Console diff --git a/docs/2_OSLab/g2/interrupt.md b/docs/2_OSLab/g2/interrupt.md new file mode 100644 index 0000000..4f57665 --- /dev/null +++ b/docs/2_OSLab/g2/interrupt.md @@ -0,0 +1 @@ +# 中断 diff --git a/docs/2_OSLab/g2/peripherals.md b/docs/2_OSLab/g2/peripherals.md deleted file mode 100644 index 83ddc31..0000000 --- a/docs/2_OSLab/g2/peripherals.md +++ /dev/null @@ -1 +0,0 @@ -# 外围设备 diff --git a/docs/2_OSLab/g2/raspi3.md b/docs/2_OSLab/g2/raspi3.md index c9fb8ee..268ec5f 100644 --- a/docs/2_OSLab/g2/raspi3.md +++ b/docs/2_OSLab/g2/raspi3.md @@ -11,7 +11,7 @@ * [概述](overview.md) * [环境配置](environment.md) * [启动](boot.md) -* [外围设备](peripherals.md) +* [中断](interrupt.md) * [内存管理](memory.md) * [上下文切换](context.md) -* [驱动](drivers.md) +* [设备驱动](drivers.md)