diff --git a/01_wait_forever/README.md b/01_wait_forever/README.md index 52f7f839..b1927c9b 100644 --- a/01_wait_forever/README.md +++ b/01_wait_forever/README.md @@ -2,8 +2,8 @@ ## tl;dr -The project skeleton is set up; A small piece of assembly code runs that just halts all CPU cores -executing the kernel code. +- The project skeleton is set up. +- A small piece of assembly code runs that just halts all CPU cores executing the kernel code. ## Building diff --git a/02_runtime_init/README.md b/02_runtime_init/README.md index b7a8ae72..37a76e4e 100644 --- a/02_runtime_init/README.md +++ b/02_runtime_init/README.md @@ -2,9 +2,9 @@ ## tl;dr -We extend `cpu.S` to call into Rust code for the first time. There,we zero the [bss] section before -execution is halted with a call to `panic()`. Check out `make qemu` again to see the additional code -run. +- We extend `cpu.S` to call into Rust code for the first time. There, we zero the [bss] section + before execution is halted with a call to `panic()`. +- Check out `make qemu` again to see the additional code run. ## Notable additions diff --git a/03_hacky_hello_world/README.md b/03_hacky_hello_world/README.md index 7871a119..9bbcf105 100644 --- a/03_hacky_hello_world/README.md +++ b/03_hacky_hello_world/README.md @@ -2,10 +2,10 @@ ## tl;dr -Introducing global `print!()` macros to enable "printf debugging" at the earliest; To keep tutorial -length reasonable, printing functions for now "abuse" a QEMU property that lets us use the RPi's -`UART` without setting it up properly; Using the real hardware `UART` is enabled step-by-step in -following tutorials. +- Introducing global `print!()` macros to enable "printf debugging" at the earliest. +- To keep tutorial length reasonable, printing functions for now "abuse" a QEMU property that lets + us use the RPi's `UART` without setting it up properly. +- Using the real hardware `UART` is enabled step-by-step in following tutorials. ## Notable additions diff --git a/04_zero_overhead_abstraction/README.md b/04_zero_overhead_abstraction/README.md index 2ada1662..a20e0576 100644 --- a/04_zero_overhead_abstraction/README.md +++ b/04_zero_overhead_abstraction/README.md @@ -2,8 +2,8 @@ ## tl;dr -All hand-written assembly is replaced by Rust code from the [cortex-a] crate, which provides -zero-overhead abstractions and wraps the `unsafe` parts. +- All hand-written assembly is replaced by Rust code from the [cortex-a] crate, which provides + zero-overhead abstractions and wraps the `unsafe` parts. [cortex-a]: https://github.com/rust-embedded/cortex-a diff --git a/05_safe_globals/README.md b/05_safe_globals/README.md index 163bce95..cff5a8dd 100644 --- a/05_safe_globals/README.md +++ b/05_safe_globals/README.md @@ -2,8 +2,9 @@ ## tl;dr -A pseudo-lock is introduced; It is a first showcase of OS synchronization primitives and enables -safe access to a global data structure. +- A pseudo-lock is introduced. +- It is a first showcase of OS synchronization primitives and enables safe access to a global data + structure. ## Mutable globals in Rust diff --git a/06_drivers_gpio_uart/README.md b/06_drivers_gpio_uart/README.md index d07a65da..6481a31f 100644 --- a/06_drivers_gpio_uart/README.md +++ b/06_drivers_gpio_uart/README.md @@ -2,9 +2,9 @@ ## tl;dr -Now that we enabled safe globals in the previous tutorial, the infrastructure is laid for adding the -first real device drivers. We throw out the magic QEMU console and use a real `UART` now. Like -serious embedded hackers do! +- Now that we enabled safe globals in the previous tutorial, the infrastructure is laid for adding + the first real device drivers. +- We throw out the magic QEMU console and use a real `UART` now. Like serious embedded hackers do! ## Notable additions diff --git a/07_uart_chainloader/README.md b/07_uart_chainloader/README.md index 7ac6a013..bbcc4bcb 100644 --- a/07_uart_chainloader/README.md +++ b/07_uart_chainloader/README.md @@ -2,10 +2,10 @@ ## tl;dr -Running from an SD card was a nice experience, but it would be extremely tedious to do it for every -new binary. Let's write a [chainloader] using [position independent code]. This will be the last -binary you need to put on the SD card. Each following tutorial will provide a `chainboot` target in -the `Makefile` that lets you conveniently load the kernel over `UART`. +- Running from an SD card was a nice experience, but it would be extremely tedious to do it for + every new binary. Let's write a [chainloader] using [position independent code]. +- This will be the last binary you need to put on the SD card. Each following tutorial will provide + a `chainboot` target in the `Makefile` that lets you conveniently load the kernel over `UART`. [chainloader]: https://en.wikipedia.org/wiki/Chain_loading [position independent code]: https://en.wikipedia.org/wiki/Position-independent_code diff --git a/08_timestamps/README.md b/08_timestamps/README.md index a8816109..77426301 100644 --- a/08_timestamps/README.md +++ b/08_timestamps/README.md @@ -2,8 +2,9 @@ ## tl;dr -We add abstractions for the architectural timer, implement it for `aarch64` and use it to annotate -prints with timestamps; A `warn!()` macro is added. +- We add abstractions for the architectural timer, implement it for `aarch64` and use it to annotate + prints with timestamps. +- A `warn!()` macro is added. ## Test it diff --git a/10_privilege_level/README.md b/10_privilege_level/README.md index 5515c944..aea968d2 100644 --- a/10_privilege_level/README.md +++ b/10_privilege_level/README.md @@ -2,8 +2,8 @@ ## tl;dr -In early boot code, we transition from the `Hypervisor` privilege level (`EL2` in AArch64) to the -`Kernel` (`EL1`) privilege level. +- In early boot code, we transition from the `Hypervisor` privilege level (`EL2` in AArch64) to the + `Kernel` (`EL1`) privilege level. ## Table of Contents diff --git a/11_virtual_mem_part1_identity_mapping/README.md b/11_virtual_mem_part1_identity_mapping/README.md index a018f7a5..1355be4f 100644 --- a/11_virtual_mem_part1_identity_mapping/README.md +++ b/11_virtual_mem_part1_identity_mapping/README.md @@ -299,9 +299,9 @@ Minipush 1.0 ## Diff to previous ```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 -+++ 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 @@ +// 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 -+++ 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 @@ /* Set current address to the value from which the RPi starts execution */ . = 0x80000; @@ -658,9 +658,9 @@ diff -uNr 10_privilege_level/src/bsp/raspberrypi/link.ld 11_virtual_memory_part1 .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 -+++ 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 @@ +// 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 +} -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 -+++ 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 @@ //! 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 -+++ 11_virtual_memory_part1_identity_mapping/src/bsp.rs ++++ 11_virtual_mem_part1_identity_mapping/src/bsp.rs @@ -4,7 +4,7 @@ //! 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"))] 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 -+++ 11_virtual_memory_part1_identity_mapping/src/main.rs ++++ 11_virtual_mem_part1_identity_mapping/src/main.rs @@ -11,10 +11,12 @@ //! //! - [`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 { 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 -+++ 11_virtual_memory_part1_identity_mapping/src/memory/mmu.rs ++++ 11_virtual_mem_part1_identity_mapping/src/memory/mmu.rs @@ -0,0 +1,199 @@ +// 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 -+++ 11_virtual_memory_part1_identity_mapping/src/memory.rs ++++ 11_virtual_mem_part1_identity_mapping/src/memory.rs @@ -4,6 +4,8 @@ //! Memory Management. diff --git a/12_exceptions_part1_groundwork/README.md b/12_exceptions_part1_groundwork/README.md index 50b84d47..64d851a1 100644 --- a/12_exceptions_part1_groundwork/README.md +++ b/12_exceptions_part1_groundwork/README.md @@ -2,12 +2,11 @@ ## tl;dr -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 -development and runtime. - -For demo purposes, MMU `page faults` are used to demonstrate (i) returning from an exception and -(ii) the default `panic!` behavior. +- 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 development and runtime. +- For demo purposes, MMU `page faults` are used to demonstrate (i) returning from an exception and + (ii) the default `panic!` behavior. ## Table of Contents @@ -479,8 +478,8 @@ General purpose register: ## Diff to previous ```diff -diff -uNr 11_virtual_memory_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 +diff -uNr 11_virtual_mem_part1_identity_mapping/src/_arch/aarch64/exception.rs 12_exceptions_part1_groundwork/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 @@ -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); +} -diff -uNr 11_virtual_memory_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 +diff -uNr 11_virtual_mem_part1_identity_mapping/src/_arch/aarch64/exception.S 12_exceptions_part1_groundwork/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 @@ -0,0 +1,138 @@ +// 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 -diff -uNr 11_virtual_memory_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 +diff -uNr 11_virtual_mem_part1_identity_mapping/src/bsp/raspberrypi/link.ld 12_exceptions_part1_groundwork/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 @@ -14,6 +14,11 @@ *(.text._start) *(.text*) @@ -899,8 +898,8 @@ diff -uNr 11_virtual_memory_part1_identity_mapping/src/bsp/raspberrypi/link.ld 1 { *(.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 ---- 11_virtual_memory_part1_identity_mapping/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_mem_part1_identity_mapping/src/bsp/raspberrypi/memory/mmu.rs +++ 12_exceptions_part1_groundwork/src/bsp/raspberrypi/memory/mmu.rs @@ -12,7 +12,7 @@ // 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) } -diff -uNr 11_virtual_memory_part1_identity_mapping/src/bsp.rs 12_exceptions_part1_groundwork/src/bsp.rs ---- 11_virtual_memory_part1_identity_mapping/src/bsp.rs +diff -uNr 11_virtual_mem_part1_identity_mapping/src/bsp.rs 12_exceptions_part1_groundwork/src/bsp.rs +--- 11_virtual_mem_part1_identity_mapping/src/bsp.rs +++ 12_exceptions_part1_groundwork/src/bsp.rs @@ -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"))] mod raspberrypi; -diff -uNr 11_virtual_memory_part1_identity_mapping/src/main.rs 12_exceptions_part1_groundwork/src/main.rs ---- 11_virtual_memory_part1_identity_mapping/src/main.rs +diff -uNr 11_virtual_mem_part1_identity_mapping/src/main.rs 12_exceptions_part1_groundwork/src/main.rs +--- 11_virtual_mem_part1_identity_mapping/src/main.rs +++ 12_exceptions_part1_groundwork/src/main.rs @@ -108,6 +108,7 @@ #![feature(const_generics)] @@ -1010,8 +1009,8 @@ diff -uNr 11_virtual_memory_part1_identity_mapping/src/main.rs 12_exceptions_par loop { 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 ---- 11_virtual_memory_part1_identity_mapping/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_mem_part1_identity_mapping/src/memory/mmu.rs +++ 12_exceptions_part1_groundwork/src/memory/mmu.rs @@ -42,6 +42,7 @@ diff --git a/15_virtual_mem_part2_mmio_remap/README.md b/15_virtual_mem_part2_mmio_remap/README.md index 3587c349..5c341362 100644 --- a/15_virtual_mem_part2_mmio_remap/README.md +++ b/15_virtual_mem_part2_mmio_remap/README.md @@ -309,9 +309,9 @@ Minipush 1.0 ## Diff to previous ```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 -+++ 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 @@ 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. 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 -+++ 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 @@ //! 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 -+++ 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 @@ //! 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 -+++ 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 @@ //! - SPI - Shared Peripheral Interrupt. @@ -976,9 +976,9 @@ diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/arm/gicv2/gi // 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 -+++ 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 @@ mod gicc; 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(); } -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 -+++ 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 @@ //! 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 -+++ 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 @@ // // Copyright (c) 2020 Andre Richter @@ -1247,9 +1247,9 @@ diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/device_driver/bcm/bcm2xxx_ 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 -+++ 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 @@ 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 { -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 -+++ 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 @@ //! 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 { -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 -+++ 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 @@ //! 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 -+++ 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 @@ &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(); } -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 -+++ 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 @@ . = ALIGN(8); __bss_end = .; @@ -1478,9 +1478,9 @@ diff -uNr 14_exceptions_part2_peripheral_IRQs/src/bsp/raspberrypi/link.ld 15_vir /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 -+++ 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 @@ //! 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 -+++ 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 @@ // Copyright (c) 2018-2020 Andre Richter @@ -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. -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 -+++ 15_virtual_memory_part2_mmio_remap/src/bsp/raspberrypi.rs ++++ 15_virtual_mem_part2_mmio_remap/src/bsp/raspberrypi.rs @@ -10,17 +10,20 @@ pub mod exception; 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 -+++ 15_virtual_memory_part2_mmio_remap/src/common.rs ++++ 15_virtual_mem_part2_mmio_remap/src/common.rs @@ -0,0 +1,21 @@ +// 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) +} -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 -+++ 15_virtual_memory_part2_mmio_remap/src/driver.rs ++++ 15_virtual_mem_part2_mmio_remap/src/driver.rs @@ -31,6 +31,14 @@ fn register_and_enable_irq_handler(&'static self) -> Result<(), &'static str> { 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 -+++ 15_virtual_memory_part2_mmio_remap/src/lib.rs ++++ 15_virtual_mem_part2_mmio_remap/src/lib.rs @@ -113,6 +113,7 @@ #![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 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 -+++ 15_virtual_memory_part2_mmio_remap/src/main.rs ++++ 15_virtual_mem_part2_mmio_remap/src/main.rs @@ -26,21 +26,34 @@ #[no_mangle] 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(); 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 -+++ 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 @@ +// 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()); +} -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 -+++ 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 @@ +// 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 -+++ 15_virtual_memory_part2_mmio_remap/src/memory/mmu.rs ++++ 15_virtual_mem_part2_mmio_remap/src/memory/mmu.rs @@ -3,23 +3,18 @@ // Copyright (c) 2020 Andre Richter @@ -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 -+++ 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 @@ #[no_mangle]