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;