2019-07-18 03:01:57 -07:00
|
|
|
#![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-11 02:27:58 -07:00
|
|
|
mod interrupts;
|
2019-07-18 03:01:57 -07:00
|
|
|
mod gdt;
|
2019-07-10 02:25:12 -07:00
|
|
|
|
2019-07-09 09:42:41 -07:00
|
|
|
use core::panic::PanicInfo;
|
|
|
|
|
|
|
|
#[panic_handler]
|
2019-07-11 01:47:49 -07:00
|
|
|
fn panic(info: &PanicInfo) -> !{
|
|
|
|
println!("{}", info);
|
2019-07-09 09:42:41 -07:00
|
|
|
loop {}
|
|
|
|
}
|
|
|
|
|
2019-07-11 02:35:02 -07:00
|
|
|
pub fn init() {
|
2019-07-18 03:01:57 -07:00
|
|
|
gdt::init();
|
2019-07-11 02:35:02 -07:00
|
|
|
interrupts::init_idt();
|
|
|
|
}
|
|
|
|
|
2019-07-09 09:42:41 -07:00
|
|
|
#[no_mangle]
|
|
|
|
pub extern "C" fn _start() -> ! {
|
2019-07-11 02:35:02 -07:00
|
|
|
init();
|
|
|
|
|
2019-07-18 03:01:57 -07:00
|
|
|
fn yolo() {
|
|
|
|
yolo();
|
2019-07-11 02:44:26 -07:00
|
|
|
}
|
|
|
|
|
2019-07-18 03:01:57 -07:00
|
|
|
yolo();
|
|
|
|
|
|
|
|
|
|
|
|
for i in 1..10 {
|
|
|
|
println!("Gamarjoba, munde: {}", i);
|
|
|
|
}
|
2019-07-09 09:42:41 -07:00
|
|
|
loop {}
|
2019-07-09 02:02:08 -07:00
|
|
|
}
|
2019-07-10 02:25:12 -07:00
|
|
|
|