rust-operating-system/src/main.rs

38 lines
561 B
Rust
Raw Normal View History

//#![feature(abi_x86_interrupt, asm)]
2019-07-09 09:42:41 -07:00
#![no_std]
#![no_main]
/*
2019-07-11 01:46:28 -07:00
#[macro_use]
2019-07-10 02:25:12 -07:00
mod vga_buffer;
*/
2019-07-10 02:25:12 -07:00
2019-07-09 09:42:41 -07:00
use core::panic::PanicInfo;
#[panic_handler]
fn panic(_info: &PanicInfo) -> ! {
loop {}
2019-07-09 09:42:41 -07:00
}
static GAMARJOBA: &[u8] = b"Gamarjoba, MVNDE!";
2019-07-11 02:35:02 -07:00
2019-07-09 09:42:41 -07:00
#[no_mangle]
pub extern "C" fn _start() -> ! {
let vga_buffer = 0xb8000 as *mut u8;
2019-07-11 02:35:02 -07:00
for (i, &byte) in GAMARJOBA.iter().enumerate() {
let i = i as isize;
unsafe {
*vga_buffer.offset(i * 2) = byte;
*vga_buffer.offset(i * 2 + 1) = 0xd;
}
2019-07-18 10:31:02 -07:00
}
loop {}
2019-07-09 02:02:08 -07:00
}
2019-07-10 02:25:12 -07:00