This commit is contained in:
Philipp Oppermann
2016-05-25 12:03:56 +02:00
parent 74f33c0f44
commit 59382699d0
6 changed files with 397 additions and 75 deletions

View File

@@ -11,6 +11,8 @@
#![feature(const_fn, unique)]
#![feature(alloc, collections)]
#![feature(asm)]
#![feature(drop_types_in_const)]
#![feature(heap_api)]
#![no_std]
extern crate rlibc;
@@ -47,16 +49,17 @@ pub extern "C" fn rust_main(multiboot_information_address: usize) {
// set up guard page and map the heap pages
memory::init(boot_info);
use alloc::boxed::Box;
let heap_test = Box::new(42);
for i in 0..10000 {
format!("Some String");
}
interrupts::init();
unsafe { *(0xdeadbeaf as *mut u32) = 42};
//println!("{:?}", unsafe { *(0xdeadbeaf as *mut u32) });
//unsafe { *(0xdeadbeaf as *mut u32) = 42 };
fn recursive() {
recursive();
}
recursive();
unsafe { *(0xdeadbeaf as *mut u32) = 42 };
unsafe {
asm!("xor eax, eax; idiv eax" :::: "intel");
@@ -91,8 +94,11 @@ extern "C" fn eh_personality() {}
#[cfg(not(test))]
#[lang = "panic_fmt"]
extern "C" fn panic_fmt(fmt: core::fmt::Arguments, file: &str, line: u32) -> ! {
println!("\n\nPANIC in {} at line {}:", file, line);
println!(" {}", fmt);
use vga_buffer::print_error;
unsafe {
print_error(format_args!("\n\nPANIC in {} at line {}:", file, line));
print_error(format_args!(" {}", fmt));
}
loop {}
}