Move arch to seperate crate
This commit is contained in:
parent
3967c0f291
commit
2730144e2a
22 changed files with 156 additions and 101 deletions
55
arch/x86_64/src/lib.rs
Normal file
55
arch/x86_64/src/lib.rs
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
//! Architecture support for x86_64
|
||||
|
||||
#![feature(asm)]
|
||||
#![feature(const_fn)]
|
||||
#![feature(core_intrinsics)]
|
||||
#![feature(naked_functions)]
|
||||
#![no_std]
|
||||
|
||||
#[macro_use]
|
||||
extern crate bitflags;
|
||||
|
||||
/// Print to console
|
||||
#[macro_export]
|
||||
macro_rules! print {
|
||||
($($arg:tt)*) => ({
|
||||
use core::fmt::Write;
|
||||
let _ = write!($crate::serial::SerialConsole::new(), $($arg)*);
|
||||
});
|
||||
}
|
||||
|
||||
/// Print with new line to console
|
||||
#[macro_export]
|
||||
macro_rules! println {
|
||||
($fmt:expr) => (print!(concat!($fmt, "\n")));
|
||||
($fmt:expr, $($arg:tt)*) => (print!(concat!($fmt, "\n"), $($arg)*));
|
||||
}
|
||||
|
||||
/// Global descriptor table
|
||||
pub mod gdt;
|
||||
|
||||
/// Interrupt descriptor table
|
||||
pub mod idt;
|
||||
|
||||
/// IO Handling
|
||||
pub mod io;
|
||||
|
||||
/// IRQ Handling
|
||||
pub mod irq;
|
||||
|
||||
/// Interrupt instructions
|
||||
pub mod interrupt;
|
||||
|
||||
/// Initialization and main function
|
||||
pub mod main;
|
||||
|
||||
/// Memcpy, memmove, etc.
|
||||
pub mod mem;
|
||||
|
||||
/// Serial driver and print! support
|
||||
pub mod serial;
|
||||
|
||||
/// Task state segment
|
||||
pub mod tss;
|
||||
|
||||
pub mod physical;
|
||||
Loading…
Add table
Add a link
Reference in a new issue