1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#![no_std]
#![feature(alloc_prelude)]
extern crate alloc;
#[cfg(feature = "std")]
extern crate std;
#[allow(unused_imports)]
use self::alloc_prelude::*;
use alloc::prelude::v1 as alloc_prelude;
use core::fmt::Debug;
use slos_filesystem::FsFileHandle;
pub mod null_system;
pub trait SystemConsole: Debug + FsFileHandle {}
pub trait SystemCpu {
fn interrupts_disable(&mut self);
fn interrupts_enable(&mut self);
fn interrupts_are_enabled(&self) -> bool;
fn halt(&mut self);
}
pub trait SystemKmainHooks {
fn hook_kmain_loop_head(&mut self) {}
fn hook_kmain_loop_inner_part(&mut self) {}
}
pub trait SystemHardware: Send + Debug + SystemKmainHooks {
fn system_name(&self) -> &'static str;
fn console(&mut self) -> &'static mut dyn SystemConsole;
fn has_requested_return(&self) -> bool;
fn current_cpu(&mut self) -> &'static mut dyn SystemCpu;
fn virtualization(&self) -> Option<(&'static str, ())>;
}