This commit is contained in:
Jeremy Soller 2016-08-25 17:03:01 -06:00
parent c2a95c96d5
commit 6715d5c534
29 changed files with 385 additions and 21 deletions

15
kernel/console.rs Normal file
View file

@ -0,0 +1,15 @@
use ransid::Console;
use spin::{Once, Mutex, MutexGuard};
/// Console
static CONSOLE: Once<Mutex<Console>> = Once::new();
/// Initialize console, called if needed
fn init_console() -> Mutex<Console> {
Mutex::new(Console::new(0, 0))
}
/// Get the global console
pub fn console() -> MutexGuard<'static, Console> {
CONSOLE.call_once(init_console).lock()
}

View file

@ -80,6 +80,11 @@ use arch::interrupt;
#[macro_use]
extern crate arch_test as arch;
/// Architecture specific items (ARM)
#[cfg(all(not(test), target_arch = "arm"))]
#[macro_use]
extern crate arch_arm as arch;
/// Architecture specific items (x86_64)
#[cfg(all(not(test), target_arch = "x86_64"))]
#[macro_use]
@ -92,12 +97,17 @@ extern crate collections;
#[macro_use]
extern crate bitflags;
extern crate goblin;
extern crate ransid;
extern crate spin;
/// Console
pub mod console;
/// Context management
pub mod context;
/// ELF file parsing
#[cfg(all(not(test), target_arch = "x86_64"))]
pub mod elf;
/// Schemes, filesystem handlers

View file

@ -1,4 +1,5 @@
use core::str;
use syscall::Result;
use super::Scheme;