Streamline READMEs

pull/84/head
Andre Richter 4 years ago
parent 72215fcdb5
commit 8fc250fc08
No known key found for this signature in database
GPG Key ID: 2116C1AB102F615E

@ -2,8 +2,8 @@
## tl;dr ## tl;dr
The project skeleton is set up; A small piece of assembly code runs that just halts all CPU cores - The project skeleton is set up.
executing the kernel code. - A small piece of assembly code runs that just halts all CPU cores executing the kernel code.
## Building ## Building

@ -2,9 +2,9 @@
## tl;dr ## tl;dr
We extend `cpu.S` to call into Rust code for the first time. There,we zero the [bss] section before - We extend `cpu.S` to call into Rust code for the first time. There, we zero the [bss] section
execution is halted with a call to `panic()`. Check out `make qemu` again to see the additional code before execution is halted with a call to `panic()`.
run. - Check out `make qemu` again to see the additional code run.
## Notable additions ## Notable additions

@ -2,10 +2,10 @@
## tl;dr ## tl;dr
Introducing global `print!()` macros to enable "printf debugging" at the earliest; To keep tutorial - Introducing global `print!()` macros to enable "printf debugging" at the earliest.
length reasonable, printing functions for now "abuse" a QEMU property that lets us use the RPi's - To keep tutorial length reasonable, printing functions for now "abuse" a QEMU property that lets
`UART` without setting it up properly; Using the real hardware `UART` is enabled step-by-step in us use the RPi's `UART` without setting it up properly.
following tutorials. - Using the real hardware `UART` is enabled step-by-step in following tutorials.
## Notable additions ## Notable additions

@ -2,8 +2,8 @@
## tl;dr ## tl;dr
All hand-written assembly is replaced by Rust code from the [cortex-a] crate, which provides - All hand-written assembly is replaced by Rust code from the [cortex-a] crate, which provides
zero-overhead abstractions and wraps the `unsafe` parts. zero-overhead abstractions and wraps the `unsafe` parts.
[cortex-a]: https://github.com/rust-embedded/cortex-a [cortex-a]: https://github.com/rust-embedded/cortex-a

@ -2,8 +2,9 @@
## tl;dr ## tl;dr
A pseudo-lock is introduced; It is a first showcase of OS synchronization primitives and enables - A pseudo-lock is introduced.
safe access to a global data structure. - It is a first showcase of OS synchronization primitives and enables safe access to a global data
structure.
## Mutable globals in Rust ## Mutable globals in Rust

@ -2,9 +2,9 @@
## tl;dr ## tl;dr
Now that we enabled safe globals in the previous tutorial, the infrastructure is laid for adding the - Now that we enabled safe globals in the previous tutorial, the infrastructure is laid for adding
first real device drivers. We throw out the magic QEMU console and use a real `UART` now. Like the first real device drivers.
serious embedded hackers do! - We throw out the magic QEMU console and use a real `UART` now. Like serious embedded hackers do!
## Notable additions ## Notable additions

@ -2,10 +2,10 @@
## tl;dr ## tl;dr
Running from an SD card was a nice experience, but it would be extremely tedious to do it for every - Running from an SD card was a nice experience, but it would be extremely tedious to do it for
new binary. Let's write a [chainloader] using [position independent code]. This will be the last every new binary. Let's write a [chainloader] using [position independent code].
binary you need to put on the SD card. Each following tutorial will provide a `chainboot` target in - This will be the last binary you need to put on the SD card. Each following tutorial will provide
the `Makefile` that lets you conveniently load the kernel over `UART`. a `chainboot` target in the `Makefile` that lets you conveniently load the kernel over `UART`.
[chainloader]: https://en.wikipedia.org/wiki/Chain_loading [chainloader]: https://en.wikipedia.org/wiki/Chain_loading
[position independent code]: https://en.wikipedia.org/wiki/Position-independent_code [position independent code]: https://en.wikipedia.org/wiki/Position-independent_code

@ -2,8 +2,9 @@
## tl;dr ## tl;dr
We add abstractions for the architectural timer, implement it for `aarch64` and use it to annotate - We add abstractions for the architectural timer, implement it for `aarch64` and use it to annotate
prints with timestamps; A `warn!()` macro is added. prints with timestamps.
- A `warn!()` macro is added.
## Test it ## Test it

@ -2,8 +2,8 @@
## tl;dr ## tl;dr
In early boot code, we transition from the `Hypervisor` privilege level (`EL2` in AArch64) to the - In early boot code, we transition from the `Hypervisor` privilege level (`EL2` in AArch64) to the
`Kernel` (`EL1`) privilege level. `Kernel` (`EL1`) privilege level.
## Table of Contents ## Table of Contents

@ -299,9 +299,9 @@ Minipush 1.0
## Diff to previous ## Diff to previous
```diff ```diff
diff -uNr 10_privilege_level/src/_arch/aarch64/memory/mmu.rs 11_virtual_memory_part1_identity_mapping/src/_arch/aarch64/memory/mmu.rs diff -uNr 10_privilege_level/src/_arch/aarch64/memory/mmu.rs 11_virtual_mem_part1_identity_mapping/src/_arch/aarch64/memory/mmu.rs
--- 10_privilege_level/src/_arch/aarch64/memory/mmu.rs --- 10_privilege_level/src/_arch/aarch64/memory/mmu.rs
+++ 11_virtual_memory_part1_identity_mapping/src/_arch/aarch64/memory/mmu.rs +++ 11_virtual_mem_part1_identity_mapping/src/_arch/aarch64/memory/mmu.rs
@@ -0,0 +1,333 @@ @@ -0,0 +1,333 @@
+// SPDX-License-Identifier: MIT OR Apache-2.0 +// SPDX-License-Identifier: MIT OR Apache-2.0
+// +//
@ -637,9 +637,9 @@ diff -uNr 10_privilege_level/src/_arch/aarch64/memory/mmu.rs 11_virtual_memory_p
+ } + }
+} +}
diff -uNr 10_privilege_level/src/bsp/raspberrypi/link.ld 11_virtual_memory_part1_identity_mapping/src/bsp/raspberrypi/link.ld diff -uNr 10_privilege_level/src/bsp/raspberrypi/link.ld 11_virtual_mem_part1_identity_mapping/src/bsp/raspberrypi/link.ld
--- 10_privilege_level/src/bsp/raspberrypi/link.ld --- 10_privilege_level/src/bsp/raspberrypi/link.ld
+++ 11_virtual_memory_part1_identity_mapping/src/bsp/raspberrypi/link.ld +++ 11_virtual_mem_part1_identity_mapping/src/bsp/raspberrypi/link.ld
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
/* Set current address to the value from which the RPi starts execution */ /* Set current address to the value from which the RPi starts execution */
. = 0x80000; . = 0x80000;
@ -658,9 +658,9 @@ diff -uNr 10_privilege_level/src/bsp/raspberrypi/link.ld 11_virtual_memory_part1
.data : .data :
{ {
diff -uNr 10_privilege_level/src/bsp/raspberrypi/memory/mmu.rs 11_virtual_memory_part1_identity_mapping/src/bsp/raspberrypi/memory/mmu.rs diff -uNr 10_privilege_level/src/bsp/raspberrypi/memory/mmu.rs 11_virtual_mem_part1_identity_mapping/src/bsp/raspberrypi/memory/mmu.rs
--- 10_privilege_level/src/bsp/raspberrypi/memory/mmu.rs --- 10_privilege_level/src/bsp/raspberrypi/memory/mmu.rs
+++ 11_virtual_memory_part1_identity_mapping/src/bsp/raspberrypi/memory/mmu.rs +++ 11_virtual_mem_part1_identity_mapping/src/bsp/raspberrypi/memory/mmu.rs
@@ -0,0 +1,88 @@ @@ -0,0 +1,88 @@
+// SPDX-License-Identifier: MIT OR Apache-2.0 +// SPDX-License-Identifier: MIT OR Apache-2.0
+// +//
@ -751,9 +751,9 @@ diff -uNr 10_privilege_level/src/bsp/raspberrypi/memory/mmu.rs 11_virtual_memory
+ &LAYOUT + &LAYOUT
+} +}
diff -uNr 10_privilege_level/src/bsp/raspberrypi/memory.rs 11_virtual_memory_part1_identity_mapping/src/bsp/raspberrypi/memory.rs diff -uNr 10_privilege_level/src/bsp/raspberrypi/memory.rs 11_virtual_mem_part1_identity_mapping/src/bsp/raspberrypi/memory.rs
--- 10_privilege_level/src/bsp/raspberrypi/memory.rs --- 10_privilege_level/src/bsp/raspberrypi/memory.rs
+++ 11_virtual_memory_part1_identity_mapping/src/bsp/raspberrypi/memory.rs +++ 11_virtual_mem_part1_identity_mapping/src/bsp/raspberrypi/memory.rs
@@ -4,6 +4,8 @@ @@ -4,6 +4,8 @@
//! BSP Memory Management. //! BSP Memory Management.
@ -826,9 +826,9 @@ diff -uNr 10_privilege_level/src/bsp/raspberrypi/memory.rs 11_virtual_memory_par
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
diff -uNr 10_privilege_level/src/bsp.rs 11_virtual_memory_part1_identity_mapping/src/bsp.rs diff -uNr 10_privilege_level/src/bsp.rs 11_virtual_mem_part1_identity_mapping/src/bsp.rs
--- 10_privilege_level/src/bsp.rs --- 10_privilege_level/src/bsp.rs
+++ 11_virtual_memory_part1_identity_mapping/src/bsp.rs +++ 11_virtual_mem_part1_identity_mapping/src/bsp.rs
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
//! Conditional re-exporting of Board Support Packages. //! Conditional re-exporting of Board Support Packages.
@ -839,9 +839,9 @@ diff -uNr 10_privilege_level/src/bsp.rs 11_virtual_memory_part1_identity_mapping
#[cfg(any(feature = "bsp_rpi3", feature = "bsp_rpi4"))] #[cfg(any(feature = "bsp_rpi3", feature = "bsp_rpi4"))]
mod raspberrypi; mod raspberrypi;
diff -uNr 10_privilege_level/src/main.rs 11_virtual_memory_part1_identity_mapping/src/main.rs diff -uNr 10_privilege_level/src/main.rs 11_virtual_mem_part1_identity_mapping/src/main.rs
--- 10_privilege_level/src/main.rs --- 10_privilege_level/src/main.rs
+++ 11_virtual_memory_part1_identity_mapping/src/main.rs +++ 11_virtual_mem_part1_identity_mapping/src/main.rs
@@ -11,10 +11,12 @@ @@ -11,10 +11,12 @@
//! //!
//! - [`bsp::console::console()`] - Returns a reference to the kernel's [console interface]. //! - [`bsp::console::console()`] - Returns a reference to the kernel's [console interface].
@ -910,9 +910,9 @@ diff -uNr 10_privilege_level/src/main.rs 11_virtual_memory_part1_identity_mappin
loop { loop {
let c = bsp::console::console().read_char(); let c = bsp::console::console().read_char();
diff -uNr 10_privilege_level/src/memory/mmu.rs 11_virtual_memory_part1_identity_mapping/src/memory/mmu.rs diff -uNr 10_privilege_level/src/memory/mmu.rs 11_virtual_mem_part1_identity_mapping/src/memory/mmu.rs
--- 10_privilege_level/src/memory/mmu.rs --- 10_privilege_level/src/memory/mmu.rs
+++ 11_virtual_memory_part1_identity_mapping/src/memory/mmu.rs +++ 11_virtual_mem_part1_identity_mapping/src/memory/mmu.rs
@@ -0,0 +1,199 @@ @@ -0,0 +1,199 @@
+// SPDX-License-Identifier: MIT OR Apache-2.0 +// SPDX-License-Identifier: MIT OR Apache-2.0
+// +//
@ -1114,9 +1114,9 @@ diff -uNr 10_privilege_level/src/memory/mmu.rs 11_virtual_memory_part1_identity_
+ } + }
+} +}
diff -uNr 10_privilege_level/src/memory.rs 11_virtual_memory_part1_identity_mapping/src/memory.rs diff -uNr 10_privilege_level/src/memory.rs 11_virtual_mem_part1_identity_mapping/src/memory.rs
--- 10_privilege_level/src/memory.rs --- 10_privilege_level/src/memory.rs
+++ 11_virtual_memory_part1_identity_mapping/src/memory.rs +++ 11_virtual_mem_part1_identity_mapping/src/memory.rs
@@ -4,6 +4,8 @@ @@ -4,6 +4,8 @@
//! Memory Management. //! Memory Management.

@ -2,12 +2,11 @@
## tl;dr ## tl;dr
We lay the groundwork for all the architectural `CPU exceptions`. For now, only print an elaborate - We lay the groundwork for all the architectural `CPU exceptions`. For now, only print an elaborate
system state through a `panic!` call, and halt execution; This will help finding bugs during system state through a `panic!` call, and halt execution
development and runtime. - This will help finding bugs during development and runtime.
- For demo purposes, MMU `page faults` are used to demonstrate (i) returning from an exception and
For demo purposes, MMU `page faults` are used to demonstrate (i) returning from an exception and (ii) the default `panic!` behavior.
(ii) the default `panic!` behavior.
## Table of Contents ## Table of Contents
@ -479,8 +478,8 @@ General purpose register:
## Diff to previous ## Diff to previous
```diff ```diff
diff -uNr 11_virtual_memory_part1_identity_mapping/src/_arch/aarch64/exception.rs 12_exceptions_part1_groundwork/src/_arch/aarch64/exception.rs diff -uNr 11_virtual_mem_part1_identity_mapping/src/_arch/aarch64/exception.rs 12_exceptions_part1_groundwork/src/_arch/aarch64/exception.rs
--- 11_virtual_memory_part1_identity_mapping/src/_arch/aarch64/exception.rs --- 11_virtual_mem_part1_identity_mapping/src/_arch/aarch64/exception.rs
+++ 12_exceptions_part1_groundwork/src/_arch/aarch64/exception.rs +++ 12_exceptions_part1_groundwork/src/_arch/aarch64/exception.rs
@@ -4,7 +4,230 @@ @@ -4,7 +4,230 @@
@ -740,8 +739,8 @@ diff -uNr 11_virtual_memory_part1_identity_mapping/src/_arch/aarch64/exception.r
+ barrier::isb(barrier::SY); + barrier::isb(barrier::SY);
+} +}
diff -uNr 11_virtual_memory_part1_identity_mapping/src/_arch/aarch64/exception.S 12_exceptions_part1_groundwork/src/_arch/aarch64/exception.S diff -uNr 11_virtual_mem_part1_identity_mapping/src/_arch/aarch64/exception.S 12_exceptions_part1_groundwork/src/_arch/aarch64/exception.S
--- 11_virtual_memory_part1_identity_mapping/src/_arch/aarch64/exception.S --- 11_virtual_mem_part1_identity_mapping/src/_arch/aarch64/exception.S
+++ 12_exceptions_part1_groundwork/src/_arch/aarch64/exception.S +++ 12_exceptions_part1_groundwork/src/_arch/aarch64/exception.S
@@ -0,0 +1,138 @@ @@ -0,0 +1,138 @@
+// SPDX-License-Identifier: MIT OR Apache-2.0 +// SPDX-License-Identifier: MIT OR Apache-2.0
@ -883,8 +882,8 @@ diff -uNr 11_virtual_memory_part1_identity_mapping/src/_arch/aarch64/exception.S
+ +
+ eret + eret
diff -uNr 11_virtual_memory_part1_identity_mapping/src/bsp/raspberrypi/link.ld 12_exceptions_part1_groundwork/src/bsp/raspberrypi/link.ld diff -uNr 11_virtual_mem_part1_identity_mapping/src/bsp/raspberrypi/link.ld 12_exceptions_part1_groundwork/src/bsp/raspberrypi/link.ld
--- 11_virtual_memory_part1_identity_mapping/src/bsp/raspberrypi/link.ld --- 11_virtual_mem_part1_identity_mapping/src/bsp/raspberrypi/link.ld
+++ 12_exceptions_part1_groundwork/src/bsp/raspberrypi/link.ld +++ 12_exceptions_part1_groundwork/src/bsp/raspberrypi/link.ld
@@ -14,6 +14,11 @@ @@ -14,6 +14,11 @@
*(.text._start) *(.text*) *(.text._start) *(.text*)
@ -899,8 +898,8 @@ diff -uNr 11_virtual_memory_part1_identity_mapping/src/bsp/raspberrypi/link.ld 1
{ {
*(.rodata*) *(.rodata*)
diff -uNr 11_virtual_memory_part1_identity_mapping/src/bsp/raspberrypi/memory/mmu.rs 12_exceptions_part1_groundwork/src/bsp/raspberrypi/memory/mmu.rs diff -uNr 11_virtual_mem_part1_identity_mapping/src/bsp/raspberrypi/memory/mmu.rs 12_exceptions_part1_groundwork/src/bsp/raspberrypi/memory/mmu.rs
--- 11_virtual_memory_part1_identity_mapping/src/bsp/raspberrypi/memory/mmu.rs --- 11_virtual_mem_part1_identity_mapping/src/bsp/raspberrypi/memory/mmu.rs
+++ 12_exceptions_part1_groundwork/src/bsp/raspberrypi/memory/mmu.rs +++ 12_exceptions_part1_groundwork/src/bsp/raspberrypi/memory/mmu.rs
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
// Public Definitions // Public Definitions
@ -941,8 +940,8 @@ diff -uNr 11_virtual_memory_part1_identity_mapping/src/bsp/raspberrypi/memory/mm
RangeInclusive::new(memory_map::mmio::START, memory_map::mmio::END_INCLUSIVE) RangeInclusive::new(memory_map::mmio::START, memory_map::mmio::END_INCLUSIVE)
} }
diff -uNr 11_virtual_memory_part1_identity_mapping/src/bsp.rs 12_exceptions_part1_groundwork/src/bsp.rs diff -uNr 11_virtual_mem_part1_identity_mapping/src/bsp.rs 12_exceptions_part1_groundwork/src/bsp.rs
--- 11_virtual_memory_part1_identity_mapping/src/bsp.rs --- 11_virtual_mem_part1_identity_mapping/src/bsp.rs
+++ 12_exceptions_part1_groundwork/src/bsp.rs +++ 12_exceptions_part1_groundwork/src/bsp.rs
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
@ -954,8 +953,8 @@ diff -uNr 11_virtual_memory_part1_identity_mapping/src/bsp.rs 12_exceptions_part
#[cfg(any(feature = "bsp_rpi3", feature = "bsp_rpi4"))] #[cfg(any(feature = "bsp_rpi3", feature = "bsp_rpi4"))]
mod raspberrypi; mod raspberrypi;
diff -uNr 11_virtual_memory_part1_identity_mapping/src/main.rs 12_exceptions_part1_groundwork/src/main.rs diff -uNr 11_virtual_mem_part1_identity_mapping/src/main.rs 12_exceptions_part1_groundwork/src/main.rs
--- 11_virtual_memory_part1_identity_mapping/src/main.rs --- 11_virtual_mem_part1_identity_mapping/src/main.rs
+++ 12_exceptions_part1_groundwork/src/main.rs +++ 12_exceptions_part1_groundwork/src/main.rs
@@ -108,6 +108,7 @@ @@ -108,6 +108,7 @@
#![feature(const_generics)] #![feature(const_generics)]
@ -1010,8 +1009,8 @@ diff -uNr 11_virtual_memory_part1_identity_mapping/src/main.rs 12_exceptions_par
loop { loop {
let c = bsp::console::console().read_char(); let c = bsp::console::console().read_char();
diff -uNr 11_virtual_memory_part1_identity_mapping/src/memory/mmu.rs 12_exceptions_part1_groundwork/src/memory/mmu.rs diff -uNr 11_virtual_mem_part1_identity_mapping/src/memory/mmu.rs 12_exceptions_part1_groundwork/src/memory/mmu.rs
--- 11_virtual_memory_part1_identity_mapping/src/memory/mmu.rs --- 11_virtual_mem_part1_identity_mapping/src/memory/mmu.rs
+++ 12_exceptions_part1_groundwork/src/memory/mmu.rs +++ 12_exceptions_part1_groundwork/src/memory/mmu.rs
@@ -42,6 +42,7 @@ @@ -42,6 +42,7 @@

@ -309,9 +309,9 @@ Minipush 1.0
## Diff to previous ## Diff to previous
```diff ```diff
diff -uNr 14_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/cpu.rs 15_virtual_memory_part2_mmio_remap/src/_arch/aarch64/cpu.rs diff -uNr 14_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/cpu.rs 15_virtual_mem_part2_mmio_remap/src/_arch/aarch64/cpu.rs
--- 14_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/cpu.rs --- 14_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/cpu.rs
+++ 15_virtual_memory_part2_mmio_remap/src/_arch/aarch64/cpu.rs +++ 15_virtual_mem_part2_mmio_remap/src/_arch/aarch64/cpu.rs
@@ -68,7 +68,7 @@ @@ -68,7 +68,7 @@
ELR_EL2.set(runtime_init::runtime_init as *const () as u64); ELR_EL2.set(runtime_init::runtime_init as *const () as u64);
@ -322,9 +322,9 @@ diff -uNr 14_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/cpu.rs 15_virtua
// Use `eret` to "return" to EL1. This results in execution of runtime_init() in EL1. // Use `eret` to "return" to EL1. This results in execution of runtime_init() in EL1.
asm::eret() asm::eret()
diff -uNr 14_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/memory/mmu.rs 15_virtual_memory_part2_mmio_remap/src/_arch/aarch64/memory/mmu.rs diff -uNr 14_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/memory/mmu.rs 15_virtual_mem_part2_mmio_remap/src/_arch/aarch64/memory/mmu.rs
--- 14_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/memory/mmu.rs --- 14_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/memory/mmu.rs
+++ 15_virtual_memory_part2_mmio_remap/src/_arch/aarch64/memory/mmu.rs +++ 15_virtual_mem_part2_mmio_remap/src/_arch/aarch64/memory/mmu.rs
@@ -4,10 +4,19 @@ @@ -4,10 +4,19 @@
//! Memory Management Unit Driver. //! Memory Management Unit Driver.
@ -807,9 +807,9 @@ diff -uNr 14_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/memory/mmu.rs 15
+ } + }
+} +}
diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/arm/gicv2/gicc.rs 15_virtual_memory_part2_mmio_remap/src/bsp/device_driver/arm/gicv2/gicc.rs diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/arm/gicv2/gicc.rs 15_virtual_mem_part2_mmio_remap/src/bsp/device_driver/arm/gicv2/gicc.rs
--- 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/arm/gicv2/gicc.rs --- 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/arm/gicv2/gicc.rs
+++ 15_virtual_memory_part2_mmio_remap/src/bsp/device_driver/arm/gicv2/gicc.rs +++ 15_virtual_mem_part2_mmio_remap/src/bsp/device_driver/arm/gicv2/gicc.rs
@@ -4,7 +4,9 @@ @@ -4,7 +4,9 @@
//! GICC Driver - GIC CPU interface. //! GICC Driver - GIC CPU interface.
@ -899,9 +899,9 @@ diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/arm/gicv2/gi
} }
} }
diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/arm/gicv2/gicd.rs 15_virtual_memory_part2_mmio_remap/src/bsp/device_driver/arm/gicv2/gicd.rs diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/arm/gicv2/gicd.rs 15_virtual_mem_part2_mmio_remap/src/bsp/device_driver/arm/gicv2/gicd.rs
--- 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/arm/gicv2/gicd.rs --- 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/arm/gicv2/gicd.rs
+++ 15_virtual_memory_part2_mmio_remap/src/bsp/device_driver/arm/gicv2/gicd.rs +++ 15_virtual_mem_part2_mmio_remap/src/bsp/device_driver/arm/gicv2/gicd.rs
@@ -8,8 +8,9 @@ @@ -8,8 +8,9 @@
//! - SPI - Shared Peripheral Interrupt. //! - SPI - Shared Peripheral Interrupt.
@ -976,9 +976,9 @@ diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/arm/gicv2/gi
// Shared. // Shared.
_ => { _ => {
diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/arm/gicv2.rs 15_virtual_memory_part2_mmio_remap/src/bsp/device_driver/arm/gicv2.rs diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/arm/gicv2.rs 15_virtual_mem_part2_mmio_remap/src/bsp/device_driver/arm/gicv2.rs
--- 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/arm/gicv2.rs --- 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/arm/gicv2.rs
+++ 15_virtual_memory_part2_mmio_remap/src/bsp/device_driver/arm/gicv2.rs +++ 15_virtual_mem_part2_mmio_remap/src/bsp/device_driver/arm/gicv2.rs
@@ -79,7 +79,11 @@ @@ -79,7 +79,11 @@
mod gicc; mod gicc;
mod gicd; mod gicd;
@ -1057,9 +1057,9 @@ diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/arm/gicv2.rs
self.gicd.boot_core_init(); self.gicd.boot_core_init();
} }
diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/bcm/bcm2xxx_gpio.rs 15_virtual_memory_part2_mmio_remap/src/bsp/device_driver/bcm/bcm2xxx_gpio.rs diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/bcm/bcm2xxx_gpio.rs 15_virtual_mem_part2_mmio_remap/src/bsp/device_driver/bcm/bcm2xxx_gpio.rs
--- 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/bcm/bcm2xxx_gpio.rs --- 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/bcm/bcm2xxx_gpio.rs
+++ 15_virtual_memory_part2_mmio_remap/src/bsp/device_driver/bcm/bcm2xxx_gpio.rs +++ 15_virtual_mem_part2_mmio_remap/src/bsp/device_driver/bcm/bcm2xxx_gpio.rs
@@ -5,9 +5,10 @@ @@ -5,9 +5,10 @@
//! GPIO Driver. //! GPIO Driver.
@ -1149,9 +1149,9 @@ diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/bcm/bcm2xxx_
+ } + }
} }
diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/bcm/bcm2xxx_interrupt_controller/peripheral_ic.rs 15_virtual_memory_part2_mmio_remap/src/bsp/device_driver/bcm/bcm2xxx_interrupt_controller/peripheral_ic.rs diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/bcm/bcm2xxx_interrupt_controller/peripheral_ic.rs 15_virtual_mem_part2_mmio_remap/src/bsp/device_driver/bcm/bcm2xxx_interrupt_controller/peripheral_ic.rs
--- 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/bcm/bcm2xxx_interrupt_controller/peripheral_ic.rs --- 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/bcm/bcm2xxx_interrupt_controller/peripheral_ic.rs
+++ 15_virtual_memory_part2_mmio_remap/src/bsp/device_driver/bcm/bcm2xxx_interrupt_controller/peripheral_ic.rs +++ 15_virtual_mem_part2_mmio_remap/src/bsp/device_driver/bcm/bcm2xxx_interrupt_controller/peripheral_ic.rs
@@ -2,12 +2,14 @@ @@ -2,12 +2,14 @@
// //
// Copyright (c) 2020 Andre Richter <andre.o.richter@gmail.com> // Copyright (c) 2020 Andre Richter <andre.o.richter@gmail.com>
@ -1247,9 +1247,9 @@ diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/bcm/bcm2xxx_
type IRQNumberType = PeripheralIRQ; type IRQNumberType = PeripheralIRQ;
diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/bcm/bcm2xxx_interrupt_controller.rs 15_virtual_memory_part2_mmio_remap/src/bsp/device_driver/bcm/bcm2xxx_interrupt_controller.rs diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/bcm/bcm2xxx_interrupt_controller.rs 15_virtual_mem_part2_mmio_remap/src/bsp/device_driver/bcm/bcm2xxx_interrupt_controller.rs
--- 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/bcm/bcm2xxx_interrupt_controller.rs --- 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/bcm/bcm2xxx_interrupt_controller.rs
+++ 15_virtual_memory_part2_mmio_remap/src/bsp/device_driver/bcm/bcm2xxx_interrupt_controller.rs +++ 15_virtual_mem_part2_mmio_remap/src/bsp/device_driver/bcm/bcm2xxx_interrupt_controller.rs
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
mod peripheral_ic; mod peripheral_ic;
@ -1288,9 +1288,9 @@ diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/bcm/bcm2xxx_
impl exception::asynchronous::interface::IRQManager for InterruptController { impl exception::asynchronous::interface::IRQManager for InterruptController {
diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/bcm/bcm2xxx_pl011_uart.rs 15_virtual_memory_part2_mmio_remap/src/bsp/device_driver/bcm/bcm2xxx_pl011_uart.rs diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/bcm/bcm2xxx_pl011_uart.rs 15_virtual_mem_part2_mmio_remap/src/bsp/device_driver/bcm/bcm2xxx_pl011_uart.rs
--- 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/bcm/bcm2xxx_pl011_uart.rs --- 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/bcm/bcm2xxx_pl011_uart.rs
+++ 15_virtual_memory_part2_mmio_remap/src/bsp/device_driver/bcm/bcm2xxx_pl011_uart.rs +++ 15_virtual_mem_part2_mmio_remap/src/bsp/device_driver/bcm/bcm2xxx_pl011_uart.rs
@@ -5,10 +5,13 @@ @@ -5,10 +5,13 @@
//! PL011 UART driver. //! PL011 UART driver.
@ -1399,9 +1399,9 @@ diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/bcm/bcm2xxx_
impl console::interface::Write for PL011Uart { impl console::interface::Write for PL011Uart {
diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/console.rs 15_virtual_memory_part2_mmio_remap/src/bsp/raspberrypi/console.rs diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/console.rs 15_virtual_mem_part2_mmio_remap/src/bsp/raspberrypi/console.rs
--- 14_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/console.rs --- 14_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/console.rs
+++ 15_virtual_memory_part2_mmio_remap/src/bsp/raspberrypi/console.rs +++ 15_virtual_mem_part2_mmio_remap/src/bsp/raspberrypi/console.rs
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
//! BSP console facilities. //! BSP console facilities.
@ -1441,9 +1441,9 @@ diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/console.rs 15_
} }
diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/driver.rs 15_virtual_memory_part2_mmio_remap/src/bsp/raspberrypi/driver.rs diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/driver.rs 15_virtual_mem_part2_mmio_remap/src/bsp/raspberrypi/driver.rs
--- 14_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/driver.rs --- 14_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/driver.rs
+++ 15_virtual_memory_part2_mmio_remap/src/bsp/raspberrypi/driver.rs +++ 15_virtual_mem_part2_mmio_remap/src/bsp/raspberrypi/driver.rs
@@ -46,7 +46,15 @@ @@ -46,7 +46,15 @@
&self.device_drivers[..] &self.device_drivers[..]
} }
@ -1462,9 +1462,9 @@ diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/driver.rs 15_v
super::GPIO.map_pl011_uart(); super::GPIO.map_pl011_uart();
} }
diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/link.ld 15_virtual_memory_part2_mmio_remap/src/bsp/raspberrypi/link.ld diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/link.ld 15_virtual_mem_part2_mmio_remap/src/bsp/raspberrypi/link.ld
--- 14_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/link.ld --- 14_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/link.ld
+++ 15_virtual_memory_part2_mmio_remap/src/bsp/raspberrypi/link.ld +++ 15_virtual_mem_part2_mmio_remap/src/bsp/raspberrypi/link.ld
@@ -39,6 +39,11 @@ @@ -39,6 +39,11 @@
. = ALIGN(8); . = ALIGN(8);
__bss_end = .; __bss_end = .;
@ -1478,9 +1478,9 @@ diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/link.ld 15_vir
/DISCARD/ : { *(.comment*) } /DISCARD/ : { *(.comment*) }
} }
diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/memory/mmu.rs 15_virtual_memory_part2_mmio_remap/src/bsp/raspberrypi/memory/mmu.rs diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/memory/mmu.rs 15_virtual_mem_part2_mmio_remap/src/bsp/raspberrypi/memory/mmu.rs
--- 14_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/memory/mmu.rs --- 14_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/memory/mmu.rs
+++ 15_virtual_memory_part2_mmio_remap/src/bsp/raspberrypi/memory/mmu.rs +++ 15_virtual_mem_part2_mmio_remap/src/bsp/raspberrypi/memory/mmu.rs
@@ -4,72 +4,128 @@ @@ -4,72 +4,128 @@
//! BSP Memory Management Unit. //! BSP Memory Management Unit.
@ -1707,9 +1707,9 @@ diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/memory/mmu.rs
} }
} }
diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/memory.rs 15_virtual_memory_part2_mmio_remap/src/bsp/raspberrypi/memory.rs diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/memory.rs 15_virtual_mem_part2_mmio_remap/src/bsp/raspberrypi/memory.rs
--- 14_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/memory.rs --- 14_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/memory.rs
+++ 15_virtual_memory_part2_mmio_remap/src/bsp/raspberrypi/memory.rs +++ 15_virtual_mem_part2_mmio_remap/src/bsp/raspberrypi/memory.rs
@@ -3,9 +3,41 @@ @@ -3,9 +3,41 @@
// Copyright (c) 2018-2020 Andre Richter <andre.o.richter@gmail.com> // Copyright (c) 2018-2020 Andre Richter <andre.o.richter@gmail.com>
@ -1906,9 +1906,9 @@ diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/memory.rs 15_v
/// Return the range spanning the .bss section. /// Return the range spanning the .bss section.
diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi.rs 15_virtual_memory_part2_mmio_remap/src/bsp/raspberrypi.rs diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi.rs 15_virtual_mem_part2_mmio_remap/src/bsp/raspberrypi.rs
--- 14_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi.rs --- 14_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi.rs
+++ 15_virtual_memory_part2_mmio_remap/src/bsp/raspberrypi.rs +++ 15_virtual_mem_part2_mmio_remap/src/bsp/raspberrypi.rs
@@ -10,17 +10,20 @@ @@ -10,17 +10,20 @@
pub mod exception; pub mod exception;
pub mod memory; pub mod memory;
@ -1955,9 +1955,9 @@ diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi.rs 15_virtual_
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
diff -uNr 14_exceptions_part2_peripheral_IRQs/src/common.rs 15_virtual_memory_part2_mmio_remap/src/common.rs diff -uNr 14_exceptions_part2_peripheral_IRQs/src/common.rs 15_virtual_mem_part2_mmio_remap/src/common.rs
--- 14_exceptions_part2_peripheral_IRQs/src/common.rs --- 14_exceptions_part2_peripheral_IRQs/src/common.rs
+++ 15_virtual_memory_part2_mmio_remap/src/common.rs +++ 15_virtual_mem_part2_mmio_remap/src/common.rs
@@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
+// SPDX-License-Identifier: MIT OR Apache-2.0 +// SPDX-License-Identifier: MIT OR Apache-2.0
+// +//
@ -1981,9 +1981,9 @@ diff -uNr 14_exceptions_part2_peripheral_IRQs/src/common.rs 15_virtual_memory_pa
+ value & !(alignment - 1) + value & !(alignment - 1)
+} +}
diff -uNr 14_exceptions_part2_peripheral_IRQs/src/driver.rs 15_virtual_memory_part2_mmio_remap/src/driver.rs diff -uNr 14_exceptions_part2_peripheral_IRQs/src/driver.rs 15_virtual_mem_part2_mmio_remap/src/driver.rs
--- 14_exceptions_part2_peripheral_IRQs/src/driver.rs --- 14_exceptions_part2_peripheral_IRQs/src/driver.rs
+++ 15_virtual_memory_part2_mmio_remap/src/driver.rs +++ 15_virtual_mem_part2_mmio_remap/src/driver.rs
@@ -31,6 +31,14 @@ @@ -31,6 +31,14 @@
fn register_and_enable_irq_handler(&'static self) -> Result<(), &'static str> { fn register_and_enable_irq_handler(&'static self) -> Result<(), &'static str> {
Ok(()) Ok(())
@ -2025,9 +2025,9 @@ diff -uNr 14_exceptions_part2_peripheral_IRQs/src/driver.rs 15_virtual_memory_pa
} }
} }
diff -uNr 14_exceptions_part2_peripheral_IRQs/src/lib.rs 15_virtual_memory_part2_mmio_remap/src/lib.rs diff -uNr 14_exceptions_part2_peripheral_IRQs/src/lib.rs 15_virtual_mem_part2_mmio_remap/src/lib.rs
--- 14_exceptions_part2_peripheral_IRQs/src/lib.rs --- 14_exceptions_part2_peripheral_IRQs/src/lib.rs
+++ 15_virtual_memory_part2_mmio_remap/src/lib.rs +++ 15_virtual_mem_part2_mmio_remap/src/lib.rs
@@ -113,6 +113,7 @@ @@ -113,6 +113,7 @@
#![allow(incomplete_features)] #![allow(incomplete_features)]
@ -2045,9 +2045,9 @@ diff -uNr 14_exceptions_part2_peripheral_IRQs/src/lib.rs 15_virtual_memory_part2
pub mod cpu; pub mod cpu;
pub mod driver; pub mod driver;
diff -uNr 14_exceptions_part2_peripheral_IRQs/src/main.rs 15_virtual_memory_part2_mmio_remap/src/main.rs diff -uNr 14_exceptions_part2_peripheral_IRQs/src/main.rs 15_virtual_mem_part2_mmio_remap/src/main.rs
--- 14_exceptions_part2_peripheral_IRQs/src/main.rs --- 14_exceptions_part2_peripheral_IRQs/src/main.rs
+++ 15_virtual_memory_part2_mmio_remap/src/main.rs +++ 15_virtual_mem_part2_mmio_remap/src/main.rs
@@ -26,21 +26,34 @@ @@ -26,21 +26,34 @@
#[no_mangle] #[no_mangle]
unsafe fn kernel_init() -> ! { unsafe fn kernel_init() -> ! {
@ -2101,9 +2101,9 @@ diff -uNr 14_exceptions_part2_peripheral_IRQs/src/main.rs 15_virtual_memory_part
let (_, privilege_level) = exception::current_privilege_level(); let (_, privilege_level) = exception::current_privilege_level();
info!("Current privilege level: {}", privilege_level); info!("Current privilege level: {}", privilege_level);
diff -uNr 14_exceptions_part2_peripheral_IRQs/src/memory/mmu/mapping_record.rs 15_virtual_memory_part2_mmio_remap/src/memory/mmu/mapping_record.rs diff -uNr 14_exceptions_part2_peripheral_IRQs/src/memory/mmu/mapping_record.rs 15_virtual_mem_part2_mmio_remap/src/memory/mmu/mapping_record.rs
--- 14_exceptions_part2_peripheral_IRQs/src/memory/mmu/mapping_record.rs --- 14_exceptions_part2_peripheral_IRQs/src/memory/mmu/mapping_record.rs
+++ 15_virtual_memory_part2_mmio_remap/src/memory/mmu/mapping_record.rs +++ 15_virtual_mem_part2_mmio_remap/src/memory/mmu/mapping_record.rs
@@ -0,0 +1,224 @@ @@ -0,0 +1,224 @@
+// SPDX-License-Identifier: MIT OR Apache-2.0 +// SPDX-License-Identifier: MIT OR Apache-2.0
+// +//
@ -2330,9 +2330,9 @@ diff -uNr 14_exceptions_part2_peripheral_IRQs/src/memory/mmu/mapping_record.rs 1
+ m.read(|mr| mr.print()); + m.read(|mr| mr.print());
+} +}
diff -uNr 14_exceptions_part2_peripheral_IRQs/src/memory/mmu/types.rs 15_virtual_memory_part2_mmio_remap/src/memory/mmu/types.rs diff -uNr 14_exceptions_part2_peripheral_IRQs/src/memory/mmu/types.rs 15_virtual_mem_part2_mmio_remap/src/memory/mmu/types.rs
--- 14_exceptions_part2_peripheral_IRQs/src/memory/mmu/types.rs --- 14_exceptions_part2_peripheral_IRQs/src/memory/mmu/types.rs
+++ 15_virtual_memory_part2_mmio_remap/src/memory/mmu/types.rs +++ 15_virtual_mem_part2_mmio_remap/src/memory/mmu/types.rs
@@ -0,0 +1,283 @@ @@ -0,0 +1,283 @@
+// SPDX-License-Identifier: MIT OR Apache-2.0 +// SPDX-License-Identifier: MIT OR Apache-2.0
+// +//
@ -2618,9 +2618,9 @@ diff -uNr 14_exceptions_part2_peripheral_IRQs/src/memory/mmu/types.rs 15_virtual
+ } + }
+} +}
diff -uNr 14_exceptions_part2_peripheral_IRQs/src/memory/mmu.rs 15_virtual_memory_part2_mmio_remap/src/memory/mmu.rs diff -uNr 14_exceptions_part2_peripheral_IRQs/src/memory/mmu.rs 15_virtual_mem_part2_mmio_remap/src/memory/mmu.rs
--- 14_exceptions_part2_peripheral_IRQs/src/memory/mmu.rs --- 14_exceptions_part2_peripheral_IRQs/src/memory/mmu.rs
+++ 15_virtual_memory_part2_mmio_remap/src/memory/mmu.rs +++ 15_virtual_mem_part2_mmio_remap/src/memory/mmu.rs
@@ -3,23 +3,18 @@ @@ -3,23 +3,18 @@
// Copyright (c) 2020 Andre Richter <andre.o.richter@gmail.com> // Copyright (c) 2020 Andre Richter <andre.o.richter@gmail.com>
@ -3034,9 +3034,9 @@ diff -uNr 14_exceptions_part2_peripheral_IRQs/src/memory/mmu.rs 15_virtual_memor
} }
} }
diff -uNr 14_exceptions_part2_peripheral_IRQs/tests/02_exception_sync_page_fault.rs 15_virtual_memory_part2_mmio_remap/tests/02_exception_sync_page_fault.rs diff -uNr 14_exceptions_part2_peripheral_IRQs/tests/02_exception_sync_page_fault.rs 15_virtual_mem_part2_mmio_remap/tests/02_exception_sync_page_fault.rs
--- 14_exceptions_part2_peripheral_IRQs/tests/02_exception_sync_page_fault.rs --- 14_exceptions_part2_peripheral_IRQs/tests/02_exception_sync_page_fault.rs
+++ 15_virtual_memory_part2_mmio_remap/tests/02_exception_sync_page_fault.rs +++ 15_virtual_mem_part2_mmio_remap/tests/02_exception_sync_page_fault.rs
@@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
#[no_mangle] #[no_mangle]

Loading…
Cancel
Save