Print to vga buffer
This commit is contained in:
parent
3ed67bfd33
commit
b2af51ffa6
@ -11,4 +11,5 @@ panic = "abort"
|
|||||||
panic = "abort"
|
panic = "abort"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
bootloader = "0.6.0"
|
||||||
|
|
||||||
|
12
src/main.rs
12
src/main.rs
@ -8,7 +8,19 @@ fn panic(_info: &PanicInfo) -> !{
|
|||||||
loop {}
|
loop {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static GREETING: &[u8] = b"Gamarjoba, munde";
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn _start() -> ! {
|
pub extern "C" fn _start() -> ! {
|
||||||
|
|
||||||
|
let vga_buffer = 0xb8000 as *mut u8;
|
||||||
|
|
||||||
|
for (i, &byte) in GREETING.iter().enumerate() {
|
||||||
|
unsafe {
|
||||||
|
*vga_buffer.offset(i as isize * 2) = byte;
|
||||||
|
*vga_buffer.offset(i as isize * 2 + 1) = 0xb; //light cyan
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
loop {}
|
loop {}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user