rust-operating-system/src/main.rs

27 lines
452 B
Rust
Raw Normal View History

2019-07-09 09:42:41 -07:00
#![no_std]
#![no_main]
use core::panic::PanicInfo;
#[panic_handler]
fn panic(_info: &PanicInfo) -> !{
loop {}
}
2019-07-10 01:37:58 -07:00
static GREETING: &[u8] = b"Gamarjoba, munde";
2019-07-09 09:42:41 -07:00
#[no_mangle]
pub extern "C" fn _start() -> ! {
2019-07-10 01:37:58 -07:00
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
}
}
2019-07-09 09:42:41 -07:00
loop {}
2019-07-09 02:02:08 -07:00
}