it now boots and prints hello world
This commit is contained in:
parent
ff4bbdd263
commit
2f8efad24a
4 changed files with 38 additions and 1 deletions
13
src/main.rs
13
src/main.rs
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue