Files
FoundryOS/kernel/src/main.rs
T

54 lines
2.0 KiB
Rust

#![no_std]
#![no_main]
extern crate alloc;
use libk::{
io,
prelude::*,
scheduling::task::{Executor, Task},
};
#[unsafe(no_mangle)]
extern "C" fn kmain() -> ! {
println_log!(" [ Initialising Kernel Systems ] ");
if let Err(err) = foundry_os::boot() {
panic!("{}", err);
}
println_log!("[ Kernel Initialised Successfully ] ");
let dimensions = io::ascii::screensize_chars();
let dimensions2 = io::ascii::screensize_px();
println!("Dimensions: {}x{} (px)", dimensions2.0, dimensions2.1);
println!("Dimensions: {}x{} (chars)", dimensions.0, dimensions.1);
println!(
"
$$$$$$$$\\ $$\\
$$ _____| $$ |
$$ | $$$$$$\\ $$\\ $$\\ $$$$$$$\\ $$$$$$$ | $$$$$$\\ $$\\ $$\\
$$$$$\\ $$ __$$\\ $$ | $$ |$$ __$$\\ $$ __$$ |$$ __$$\\ $$ | $$ |
$$ __|$$ / $$ |$$ | $$ |$$ | $$ |$$ / $$ |$$ | \\__|$$ | $$ |
$$ | $$ | $$ |$$ | $$ |$$ | $$ |$$ | $$ |$$ | $$ | $$ |
$$ | \\$$$$$$ |\\$$$$$$ |$$ | $$ |\\$$$$$$$ |$$ | \\$$$$$$$ |
\\__| \\______/ \\______/ \\__| \\__| \\_______|\\__| \\____$$ |
$$$$$$\\ $$$$$$\\ $$\\ $$\\ $$\\ $$\\ $$ |
$$ __$$\\ $$ __$$\\ $$ | $$ |$$$$ | \\$$$$$$ |
$$ / $$ |$$ / \\__| $$ | $$ |\\_$$ | \\______/
$$ | $$ |\\$$$$$$\\ \\$$\\ $$ | $$ |
$$ | $$ | \\____$$\\ \\$$\\$$ / $$ |
$$ | $$ |$$\\ $$ | \\$$$ / $$ |
$$$$$$ |\\$$$$$$ | \\$ / $$$$$$\\
\\______/ \\______/ \\_/ \\______|
"
);
let mut executor = Executor::new();
executor.spawn(Task::new(io::keyboard::print_keypresses()));
executor.try_run();
loop {}
}