it now boots and prints hello world

This commit is contained in:
clizia 2025-08-25 01:47:42 +02:00
parent ff4bbdd263
commit 2f8efad24a
4 changed files with 38 additions and 1 deletions

View file

@ -3,11 +3,22 @@
use core::panic::PanicInfo;
static HELLO: &[u8] = b"Hello toto :3";
// this function is the entry point since the linker
// looks for a function named `_start` by default
#[unsafe(no_mangle)]
pub extern "C" fn _start() -> ! {
loop{}
let vga_buffer = 0xb8000 as *mut u8;
for (i, &byte) in HELLO.iter().enumerate() {
unsafe {
*vga_buffer.offset(i as isize * 2) = byte;
*vga_buffer.offset(i as isize * 2 + 1) = 0xb;
}
}
loop {}
}
// called on panic