diff --git a/.travis.yml b/.travis.yml index 8b2e7ea..9eda8c9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -63,5 +63,5 @@ before_script: fi script: + - cd user && make sfsimg arch=$ARCH && cd .. - cd kernel && make build arch=$ARCH $OPTS && cd .. - - cd user && make arch=$ARCH diff --git a/kernel/src/process/context.rs b/kernel/src/process/context.rs index 1e012af..ac7e0a6 100644 --- a/kernel/src/process/context.rs +++ b/kernel/src/process/context.rs @@ -1,7 +1,7 @@ use alloc::{boxed::Box, collections::BTreeMap, string::String, sync::Arc, vec::Vec}; use log::*; -use simple_filesystem::file::File; +use simple_filesystem::{file::File, INode}; use spin::Mutex; use rcore_process::Context; use xmas_elf::{ElfFile, header, program::{Flags, Type}}; @@ -16,7 +16,7 @@ pub struct Process { pub arch: ArchContext, pub memory_set: MemorySet, pub kstack: KernelStack, - pub files: BTreeMap>>, + pub files: BTreeMap>>, // FIXME: => Box pub cwd: String, } @@ -100,6 +100,11 @@ impl Process { let kstack = KernelStack::new(); + let mut files = BTreeMap::new(); + files.insert(0, Arc::new(Mutex::new(File::new(crate::fs::STDIN.clone(), true, false)))); + files.insert(1, Arc::new(Mutex::new(File::new(crate::fs::STDOUT.clone(), false, true)))); + files.insert(2, Arc::new(Mutex::new(File::new(crate::fs::STDOUT.clone(), false, true)))); + Box::new(Process { arch: unsafe { ArchContext::new_user_thread( @@ -107,7 +112,7 @@ impl Process { }, memory_set, kstack, - files: BTreeMap::default(), + files, cwd: String::new(), }) } diff --git a/user b/user index 86bb44b..d84f214 160000 --- a/user +++ b/user @@ -1 +1 @@ -Subproject commit 86bb44b00d6af6f8fc63bc6179bc0b6cb5d3373b +Subproject commit d84f21465c97dbcdbc998be72f3431de3b077fb0