-
-
Notifications
You must be signed in to change notification settings - Fork 816
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Remove the panic version of the GPIO and UART driver. While they were a neat idea, it proved tedious to drag them along different tutorials where the virtual memory situation kept on changing. Actually, not much is lost, since the benefit was only of theoretical nature until now, since everything is still single-threaded with NullLocks. It is still possible to re-introduce them later. - Refactor driver bringup starting with tutorial 14. Instantiating the drivers only when we are already capable of using the remapped MMIO address makes the kernel a lot more robust, and the drivers need not care whether their MMIO addresses are good to use already or not. - Use console and irq_manager references from the generic kernel code. This improves decoupling from the BSP, and is needed as a basis for tutorial 14.
- Loading branch information
1 parent
4ab609b
commit fec4f9b
Showing
284 changed files
with
4,839 additions
and
4,643 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,8 @@ | |
**/kernel8.img | ||
|
||
node_modules | ||
.bundle | ||
.vendor | ||
|
||
Gemfile.lock | ||
package-lock.json | ||
package*.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -188,13 +188,15 @@ diff -uNr 02_runtime_init/src/bsp/raspberrypi.rs 03_hacky_hello_world/src/bsp/ra | |
diff -uNr 02_runtime_init/src/console.rs 03_hacky_hello_world/src/console.rs | ||
--- 02_runtime_init/src/console.rs | ||
+++ 03_hacky_hello_world/src/console.rs | ||
@@ -0,0 +1,19 @@ | ||
@@ -0,0 +1,32 @@ | ||
+// SPDX-License-Identifier: MIT OR Apache-2.0 | ||
+// | ||
+// Copyright (c) 2018-2022 Andre Richter <[email protected]> | ||
+ | ||
+//! System console. | ||
+ | ||
+use crate::bsp; | ||
+ | ||
+//-------------------------------------------------------------------------------------------------- | ||
+// Public Definitions | ||
+//-------------------------------------------------------------------------------------------------- | ||
|
@@ -208,6 +210,17 @@ diff -uNr 02_runtime_init/src/console.rs 03_hacky_hello_world/src/console.rs | |
+ /// intention. | ||
+ pub use core::fmt::Write; | ||
+} | ||
+ | ||
+//-------------------------------------------------------------------------------------------------- | ||
+// Public Code | ||
+//-------------------------------------------------------------------------------------------------- | ||
+ | ||
+/// Return a reference to the console. | ||
+/// | ||
+/// This is the global console used by all printing macros. | ||
+pub fn console() -> impl interface::Write { | ||
+ bsp::console::console() | ||
+} | ||
|
||
diff -uNr 02_runtime_init/src/main.rs 03_hacky_hello_world/src/main.rs | ||
--- 02_runtime_init/src/main.rs | ||
|
@@ -317,7 +330,7 @@ diff -uNr 02_runtime_init/src/print.rs 03_hacky_hello_world/src/print.rs | |
+ | ||
+//! Printing. | ||
+ | ||
+use crate::{bsp, console}; | ||
+use crate::console; | ||
+use core::fmt; | ||
+ | ||
+//-------------------------------------------------------------------------------------------------- | ||
|
@@ -328,7 +341,7 @@ diff -uNr 02_runtime_init/src/print.rs 03_hacky_hello_world/src/print.rs | |
+pub fn _print(args: fmt::Arguments) { | ||
+ use console::interface::Write; | ||
+ | ||
+ bsp::console::console().write_fmt(args).unwrap(); | ||
+ console::console().write_fmt(args).unwrap(); | ||
+} | ||
+ | ||
+/// Prints without a newline. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.