2022-02-28 08:54:41 -06:00
|
|
|
#![deny(missing_docs)]
|
|
|
|
#![no_std]
|
|
|
|
//! The ableOS kernel.
|
|
|
|
|
2022-03-02 08:38:22 -06:00
|
|
|
pub mod device_interface;
|
2022-02-28 08:54:41 -06:00
|
|
|
pub mod messaging;
|
|
|
|
pub mod panic;
|
2022-03-02 08:38:22 -06:00
|
|
|
pub mod proccess;
|
|
|
|
pub mod time;
|
2022-02-28 08:54:41 -06:00
|
|
|
|
|
|
|
use core::sync::atomic::{AtomicU64, Ordering::Relaxed};
|
|
|
|
|
2022-03-02 08:38:22 -06:00
|
|
|
use versioning::Version;
|
|
|
|
|
2022-02-28 08:54:41 -06:00
|
|
|
/// called by arch specific timers to tick up all kernel related functions
|
|
|
|
pub fn tick() {
|
|
|
|
let mut data = TICK.load(Relaxed);
|
|
|
|
data = data.wrapping_add(1);
|
|
|
|
|
|
|
|
TICK.store(data, Relaxed)
|
|
|
|
}
|
|
|
|
|
|
|
|
lazy_static::lazy_static! {
|
|
|
|
/// The number of ticks since the first CPU was started
|
|
|
|
pub static ref TICK: AtomicU64 = AtomicU64::new(0);
|
|
|
|
}
|
2022-03-02 08:38:22 -06:00
|
|
|
|
|
|
|
///
|
|
|
|
pub const KERNEL_VERSION: Version = Version {
|
|
|
|
major: 0,
|
|
|
|
minor: 1,
|
|
|
|
patch: 2,
|
|
|
|
};
|