1
0
Fork 0
forked from AbleOS/ableos
ableOS_v1Change/ableos/src/experiments/kinfo.rs

32 lines
837 B
Rust
Raw Normal View History

2021-11-16 00:09:27 -06:00
// Can be standardized
// NOTE: Move this to relib
pub struct SemanticVersion {
2022-02-18 12:25:54 -06:00
pub major: u8,
pub minor: u8,
pub patch: u8,
2021-11-16 00:09:27 -06:00
}
impl core::fmt::Display for SemanticVersion {
2022-02-18 12:25:54 -06:00
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
write!(f, "v{}.{}.{}", self.major, self.minor, self.patch)
}
2021-11-16 00:09:27 -06:00
}
// NOTE: Move to somewhere else
pub static KINFO: KernelInfo = KernelInfo {
kernel_version: SemanticVersion {
major: 0,
minor: 0,
patch: 0,
},
memory: SystemMemory { used: 0, total: 0 },
};
2021-11-16 00:09:27 -06:00
/// simple info you would want to know in a neofetch like program
pub struct KernelInfo {
2022-02-18 12:25:54 -06:00
// os: String,
// host: String,
pub kernel_version: SemanticVersion,
// cpu: String,
// gpu: String,
pub memory: SystemMemory,
2021-11-16 00:09:27 -06:00
}
use super::systeminfo::SystemMemory;