summaryrefslogtreecommitdiff
path: root/kernel/src/lib.rs
diff options
context:
space:
mode:
authorNathan Ringo <nathan@remexre.com>2024-02-24 22:03:49 -0600
committerNathan Ringo <nathan@remexre.com>2024-02-24 22:03:49 -0600
commitc8de43bf43242c4ebac3d0ecb8e7951fe2371506 (patch)
treeb438bb1b47b41241702f5783fb7ec3326a4e8ab7 /kernel/src/lib.rs
Initial commit
Diffstat (limited to 'kernel/src/lib.rs')
-rw-r--r--kernel/src/lib.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/kernel/src/lib.rs b/kernel/src/lib.rs
new file mode 100644
index 0000000..bd5a19f
--- /dev/null
+++ b/kernel/src/lib.rs
@@ -0,0 +1,16 @@
+#![no_std]
+
+mod panic;
+
+/// The entrypoint to the kernel. This should be executed by hart0 alone. It performs some early
+/// boot tasks, then wakes up any other harts.
+#[no_mangle]
+pub extern "C" fn hart0_boot() {
+ for byte in "Hello, world!\n".bytes() {
+ unsafe {
+ core::ptr::write_volatile(0x10000000 as *mut u8, byte);
+ }
+ }
+
+ todo!()
+}