rust-operating-system/src/main.rs

42 lines
546 B
Rust

#![feature(abi_x86_interrupt, asm)]
#![no_std]
#![no_main]
#[macro_use]
mod vga_buffer;
mod interrupts;
mod gdt;
use core::panic::PanicInfo;
#[panic_handler]
fn panic(info: &PanicInfo) -> ! {
println!("{}", info);
halt_loop();
}
pub fn init() {
interrupts::initalize_pics();
gdt::init();
interrupts::init_idt();
}
#[no_mangle]
pub extern "C" fn _start() -> ! {
init();
for i in 1..10 {
println!("Gamarjoba, munde: {}", i);
}
halt_loop();
}
pub fn halt_loop() -> ! {
loop {
x86_64::instructions::hlt();
}
}