mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-17 06:47:49 +00:00
WIP code for upcoming post
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#![feature(const_fn, unique)]
|
||||
#![feature(alloc, collections)]
|
||||
#![feature(asm)]
|
||||
#![feature(naked_functions)]
|
||||
#![no_std]
|
||||
|
||||
extern crate rlibc;
|
||||
@@ -47,6 +48,7 @@ pub extern "C" fn rust_main(multiboot_information_address: usize) {
|
||||
// set up guard page and map the heap pages
|
||||
memory::init(boot_info);
|
||||
|
||||
|
||||
// initialize our IDT
|
||||
interrupts::init();
|
||||
|
||||
@@ -54,6 +56,11 @@ pub extern "C" fn rust_main(multiboot_information_address: usize) {
|
||||
unsafe { asm!("mov dx, 0; div dx" ::: "ax", "dx" : "volatile", "intel") }
|
||||
}
|
||||
|
||||
//println!("{:?}", divide_by_zero());
|
||||
|
||||
// provoke a page fault inside println
|
||||
println!("{:?}", unsafe { *(0xdeadbeaf as *mut u64) = 42 });
|
||||
|
||||
// provoke a divide by zero fault inside println
|
||||
println!("{:?}", divide_by_zero());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user