2022-02-13 19:56:35 -08:00
|
|
|
//#![feature(abi_x86_interrupt, asm)]
|
2019-07-09 09:42:41 -07:00
|
|
|
#![no_std]
|
|
|
|
#![no_main]
|
|
|
|
|
2022-02-13 19:56:35 -08:00
|
|
|
/*
|
2019-07-11 01:46:28 -07:00
|
|
|
#[macro_use]
|
2019-07-10 02:25:12 -07:00
|
|
|
mod vga_buffer;
|
2022-02-13 19:56:35 -08:00
|
|
|
*/
|
2019-07-10 02:25:12 -07:00
|
|
|
|
2019-07-09 09:42:41 -07:00
|
|
|
use core::panic::PanicInfo;
|
|
|
|
|
|
|
|
#[panic_handler]
|
2022-02-13 19:56:35 -08:00
|
|
|
fn panic(_info: &PanicInfo) -> ! {
|
|
|
|
loop {}
|
2019-07-09 09:42:41 -07:00
|
|
|
}
|
|
|
|
|
2022-02-13 19:56:35 -08: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() -> ! {
|
2022-02-13 19:56:35 -08:00
|
|
|
let vga_buffer = 0xb8000 as *mut u8;
|
2019-07-11 02:35:02 -07:00
|
|
|
|
2022-02-13 19:56:35 -08: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 03:01:57 -07:00
|
|
|
|
|
|
|
|
2022-02-13 19:56:35 -08:00
|
|
|
}
|
2019-07-18 10:31:02 -07:00
|
|
|
|
2022-02-13 19:56:35 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
loop {}
|
2019-07-09 02:02:08 -07:00
|
|
|
}
|
2019-07-10 02:25:12 -07:00
|
|
|
|
2022-02-13 19:56:35 -08:00
|
|
|
|