Move arch to seperate crate
This commit is contained in:
parent
3967c0f291
commit
2730144e2a
1 changed files with 156 additions and 101 deletions
|
|
@ -64,45 +64,26 @@
|
|||
//! An error will be returned, `ENOBUFS`, if the buffer is not long enough for the name.
|
||||
//! In this case, it is recommended to add one page, 4096 bytes, to the buffer and retry.
|
||||
|
||||
#![feature(asm)]
|
||||
#![feature(const_fn)]
|
||||
#![feature(core_intrinsics)]
|
||||
#![feature(lang_items)]
|
||||
#![feature(naked_functions)]
|
||||
#![no_std]
|
||||
|
||||
#[macro_use]
|
||||
extern crate bitflags;
|
||||
|
||||
/// Print to console
|
||||
macro_rules! print {
|
||||
($($arg:tt)*) => ({
|
||||
use $crate::core::fmt::Write;
|
||||
let _ = write!($crate::arch::serial::SerialConsole::new(), $($arg)*);
|
||||
});
|
||||
}
|
||||
|
||||
/// Print with new line to console
|
||||
macro_rules! println {
|
||||
($fmt:expr) => (print!(concat!($fmt, "\n")));
|
||||
($fmt:expr, $($arg:tt)*) => (print!(concat!($fmt, "\n"), $($arg)*));
|
||||
}
|
||||
use arch::interrupt::{set_interrupts, halt};
|
||||
|
||||
/// Architecture specific items
|
||||
pub mod arch;
|
||||
#[macro_use]
|
||||
extern crate arch;
|
||||
|
||||
#[cfg(not(test))]
|
||||
#[lang = "eh_personality"]
|
||||
extern "C" fn eh_personality() {}
|
||||
pub mod panic;
|
||||
|
||||
#[cfg(not(test))]
|
||||
/// Required to handle panics
|
||||
#[lang = "panic_fmt"]
|
||||
extern "C" fn panic_fmt() -> ! {loop{}}
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
#[no_mangle]
|
||||
/// Required to handle panics
|
||||
pub extern "C" fn _Unwind_Resume() -> ! {
|
||||
loop {}
|
||||
pub extern fn kmain() {
|
||||
println!("TEST");
|
||||
|
||||
unsafe { set_interrupts() };
|
||||
loop {
|
||||
unsafe { halt() };
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue