From 236949682ebcc796d5db3860d0278b11a96807c2 Mon Sep 17 00:00:00 2001 From: able Date: Sat, 18 Jun 2022 15:00:16 -0500 Subject: [PATCH] arch specific updates to the kernel --- kernel/src/arch/mod.rs | 6 ++++++ kernel/src/arch/x86_64/mod.rs | 9 +++++++++ kernel/src/lib.rs | 1 + 3 files changed, 16 insertions(+) create mode 100644 kernel/src/arch/mod.rs create mode 100644 kernel/src/arch/x86_64/mod.rs diff --git a/kernel/src/arch/mod.rs b/kernel/src/arch/mod.rs new file mode 100644 index 00000000..1947fbc5 --- /dev/null +++ b/kernel/src/arch/mod.rs @@ -0,0 +1,6 @@ +//! Architecture-specific code. + +/// X86 specific code +#[cfg(target_arch = "x86_64")] +#[path = "x86_64/mod.rs"] +pub mod arch; diff --git a/kernel/src/arch/x86_64/mod.rs b/kernel/src/arch/x86_64/mod.rs new file mode 100644 index 00000000..eee7ced2 --- /dev/null +++ b/kernel/src/arch/x86_64/mod.rs @@ -0,0 +1,9 @@ +/// + +pub fn sloop() { + loop { + unsafe { + core::arch::asm!("hlt"); + } + } +} diff --git a/kernel/src/lib.rs b/kernel/src/lib.rs index 53f1f734..5ee5a823 100644 --- a/kernel/src/lib.rs +++ b/kernel/src/lib.rs @@ -9,6 +9,7 @@ extern crate alloc; pub mod allocator; +pub mod arch; pub mod device_interface; pub mod messaging; pub mod panic;