First commit

This commit is contained in:
2026-01-22 18:09:14 +01:00
committed by Julien THILLARD
commit 7a25e89d4c
21 changed files with 609 additions and 0 deletions

42
src/main.rs Normal file
View File

@@ -0,0 +1,42 @@
#![no_std]
#![no_main]
use core::arch::asm;
use embedded_alloc::LlffHeap as Heap;
use log::info;
use crate::{
io::init_log,
vga::{Color, Vga},
};
extern crate alloc;
mod boot;
mod critical_section;
mod io;
mod panic_handler;
mod riscv;
mod uart;
mod vga;
pub const HEAP_SIZE: usize = 40960;
#[global_allocator]
static HEAP: Heap = Heap::empty();
#[unsafe(no_mangle)]
pub extern "C" fn main() {
unsafe {
embedded_alloc::init!(HEAP, HEAP_SIZE);
}
init_log().unwrap();
Vga::init();
info!("Hello World !");
unsafe { Vga::draw_string(10, 10, "Hello World !", Color::WHITE) };
loop {
unsafe { asm!("wfi") }
}
}