1
0
Fork 0
forked from AbleOS/ableos
ableos-idl/kernel/src/lib.rs
funky 80ae717dd9 Introduced kernel testing system ktest
This commit also fixed a small issue with panic handler formatting
2024-11-24 11:21:39 +11:00

66 lines
1.4 KiB
Rust

//! The ableOS kernel.
//! Named akern.
//! Akern is woefully undersupported at the moment but we are looking to add support improve hardware discovery and make our lives as kernel and operating system developers easier and better
#![no_std]
#![no_main]
#![feature(
slice_split_once,
exclusive_wrapper,
core_intrinsics,
abi_x86_interrupt,
lazy_get,
alloc_error_handler,
ptr_sub_ptr,
naked_functions,
pointer_is_aligned_to,
)]
#![allow(dead_code, internal_features, static_mut_refs)]
extern crate alloc;
mod allocator;
mod arch;
mod bootmodules;
mod capabilities;
mod device_tree;
mod exe_format;
mod handle;
mod holeybytes;
mod ipc;
mod kmain;
mod logger;
mod memory;
mod task;
mod utils;
// #[cfg(feature = "tests")]
mod ktest;
use alloc::string::ToString;
use versioning::Version;
/// Kernel's version
pub const VERSION: Version = Version {
major: 0,
minor: 2,
patch: 0,
};
#[panic_handler]
#[cfg(target_os = "none")]
fn panic(info: &core::panic::PanicInfo) -> ! {
arch::register_dump();
if let Some(loc) = info.location() {
let _ = crate::arch::log(format_args!(
"Location: {}: {}, {}\r\n",
loc.file(),
loc.line(),
loc.column()
));
}
let msg = info.message().to_string().replace("\n", "\r\n");
let _ = crate::arch::log(format_args!("{msg}\r\n"));
loop {}
}