forked from AbleOS/ableos
37 lines
821 B
Rust
37 lines
821 B
Rust
use {core::arch::asm, limine::FramebufferRequest};
|
|
|
|
pub mod logging;
|
|
pub use logging::log;
|
|
|
|
pub const PAGE_SIZE: usize = 4096;
|
|
|
|
#[no_mangle]
|
|
unsafe extern "C" fn _kernel_start() -> ! {
|
|
crate::logger::init().expect("failed to set logger");
|
|
log::info!("Initialising AKern {}", crate::VERSION);
|
|
|
|
static FB_REQ: FramebufferRequest = FramebufferRequest::new(0);
|
|
let fb1 = &FB_REQ.get_response().get().unwrap().framebuffers()[0];
|
|
|
|
for i in 0..100_usize {
|
|
let offset = i * fb1.pitch as usize + i * 4;
|
|
unsafe {
|
|
*(fb1.address.as_ptr().unwrap().offset(offset as isize) as *mut u32) = 0xFFFFFFFF;
|
|
}
|
|
}
|
|
|
|
spin_loop();
|
|
}
|
|
|
|
pub fn spin_loop() -> ! {
|
|
loop {
|
|
unsafe { asm!("wfi") }
|
|
}
|
|
}
|
|
|
|
pub fn hardware_random_u64() -> u64 {
|
|
0
|
|
}
|
|
|
|
pub fn register_dump() {}
|