blob: 7427d3a7f73efde23bee6aa3d2cdc235b9a71ce5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#![no_main]
#![feature(abi_x86_interrupt)]
#![feature(panic_info_message)]
#![no_std]
use core::fmt::Write;
use kernel;
use kernel::interrupts;
use kernel::interrupts::exception_handlers;
use kernel::io::qemu;
#[no_mangle]
extern "C" fn _start() -> ! {
kernel::init();
unsafe {
exception_handlers::expect_fault(interrupts::InterruptType::PageFault);
}
_loop(0);
panic!("PAGE_FAULT not caught")
}
fn _loop(i: u128) -> u128 {
if i > 1u128 << 120 {
return i;
}
let n = i;
kernel::vga_println!("{:x}", &n as *const u128 as u128);
_loop(i + 1)
}
#[cfg(test)]
#[panic_handler]
#[no_mangle]
extern "C" fn panic_handler(info: &core::panic::PanicInfo) -> ! {
kernel::testing::serial_panic(info)
}
|