1
0
Fork 0
ableos/kernel/src/lib.rs

53 lines
903 B
Rust
Raw Normal View History

2022-04-11 22:23:11 +00:00
//! The ableOS kernel.
2023-03-30 21:43:04 +00:00
#![feature(
abi_x86_interrupt,
alloc_error_handler,
inline_const,
panic_info_message,
pointer_is_aligned,
prelude_import,
ptr_sub_ptr
)]
2022-05-07 12:08:34 +00:00
#![no_std]
2023-04-10 06:16:30 +00:00
// #![deny(missing_docs)]
2022-05-07 12:08:34 +00:00
extern crate alloc;
2023-03-30 21:43:04 +00:00
mod allocator;
mod arch;
2023-04-07 21:44:33 +00:00
pub mod handle;
2023-04-05 17:29:20 +00:00
pub mod interp;
2023-03-30 21:43:04 +00:00
mod kmain;
mod logger;
mod memory;
2023-04-10 06:16:30 +00:00
mod schedule;
2023-03-30 21:43:04 +00:00
mod task;
2022-03-02 14:38:22 +00:00
use versioning::Version;
2022-04-11 22:23:11 +00:00
/// Kernel's version
2023-03-30 21:43:04 +00:00
pub const VERSION: Version = Version {
2022-03-02 14:38:22 +00:00
major: 0,
2023-03-30 21:43:04 +00:00
minor: 2,
patch: 0,
2022-03-02 14:38:22 +00:00
};
2023-03-30 21:43:04 +00:00
#[panic_handler]
fn panic(info: &core::panic::PanicInfo) -> ! {
if let Some(loc) = info.location() {
let _ = crate::arch::log(format_args!(
"Location: {}: {}, {}\r\n",
loc.file(),
loc.line(),
loc.column()
));
}
if let Some(msg) = info.message() {
let _ = crate::arch::log(format_args!("{msg}\r\n"));
}
loop {}
}