Load init from initfs

This commit is contained in:
Jeremy Soller 2016-09-10 19:42:26 -06:00
parent 00db6ddd62
commit f2ca411cd6
3 changed files with 94 additions and 10 deletions

View file

@ -16,10 +16,14 @@ use spin::{Once, Mutex, RwLock, RwLockReadGuard, RwLockWriteGuard};
use syscall::{Error, Result};
use self::debug::DebugScheme;
use self::initfs::InitFsScheme;
/// Debug scheme
pub mod debug;
/// InitFS scheme
pub mod initfs;
/// Limit on number of schemes
pub const SCHEME_MAX_SCHEMES: usize = 65536;
@ -88,6 +92,7 @@ static SCHEMES: Once<RwLock<SchemeList>> = Once::new();
fn init_schemes() -> RwLock<SchemeList> {
let mut list: SchemeList = SchemeList::new();
list.insert(Box::new(*b"debug"), Arc::new(Mutex::new(Box::new(DebugScheme)))).expect("failed to insert debug: scheme");
list.insert(Box::new(*b"initfs"), Arc::new(Mutex::new(Box::new(InitFsScheme::new())))).expect("failed to insert initfs: scheme");
RwLock::new(list)
}