2017-04-11 17:02:21 +04:00
|
|
|
#![feature(lang_items)]
|
2017-04-12 21:16:04 +04:00
|
|
|
#![feature(const_fn)]
|
2017-04-12 21:32:59 +04:00
|
|
|
#![feature(const_unique_new)]
|
2017-04-12 21:20:15 +04:00
|
|
|
#![feature(unique)]
|
2017-04-11 17:02:21 +04:00
|
|
|
#![no_std]
|
|
|
|
|
2017-04-11 20:25:51 +04:00
|
|
|
extern crate rlibc;
|
2017-04-12 21:24:25 +04:00
|
|
|
extern crate volatile;
|
2017-04-12 21:32:59 +04:00
|
|
|
extern crate spin;
|
2017-04-11 20:25:51 +04:00
|
|
|
|
2017-04-12 21:16:04 +04:00
|
|
|
mod vga_buffer;
|
|
|
|
|
2017-04-11 17:02:21 +04:00
|
|
|
#[no_mangle]
|
2017-04-11 20:25:51 +04:00
|
|
|
pub extern fn rust_main() {
|
2017-04-11 21:30:19 +04:00
|
|
|
// ATTENTION: we have a very small stack and no guard page
|
|
|
|
|
2017-04-12 21:32:59 +04:00
|
|
|
use core::fmt::Write;
|
|
|
|
|
|
|
|
vga_buffer::WRITER.lock().write_str("Hello again");
|
|
|
|
write!(vga_buffer::WRITER.lock(), ", some numbers: {} {}", 42, 1.337);
|
2017-04-11 21:30:19 +04:00
|
|
|
|
|
|
|
loop{}
|
2017-04-11 20:25:51 +04:00
|
|
|
}
|
2017-04-11 17:02:21 +04:00
|
|
|
|
|
|
|
#[lang = "eh_personality"] extern fn eh_personality() {}
|
|
|
|
#[lang = "panic_fmt"] #[no_mangle] pub extern fn panic_fmt() -> ! {loop{}}
|