File tree Expand file tree Collapse file tree 3 files changed +15
-11
lines changed
Expand file tree Collapse file tree 3 files changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -207,12 +207,12 @@ fn main(hart_id: usize) {
207207 IRQ :: int_enable ( ) ;
208208
209209 // cache task with task templates
210- // tasks::exec::cache_task_template(". /busybox").expect("can't cache task");
211- // tasks::exec::cache_task_template(". /runtest.exe").expect("can't cache task");
212- // tasks::exec::cache_task_template("entry-static.exe").expect("can't cache task");
213- // tasks::exec::cache_task_template("libc.so").expect("can't cache task");
214- // tasks::exec::cache_task_template(". /lua").expect("can't cache task");
215- // tasks::exec::cache_task_template("lmbench_all").expect("can't cache task");
210+ tasks:: exec:: cache_task_template ( "/busybox" ) . expect ( "can't cache task" ) ;
211+ tasks:: exec:: cache_task_template ( "/runtest.exe" ) . expect ( "can't cache task" ) ;
212+ tasks:: exec:: cache_task_template ( "/ entry-static.exe" ) . expect ( "can't cache task" ) ;
213+ tasks:: exec:: cache_task_template ( "/ libc.so" ) . expect ( "can't cache task" ) ;
214+ tasks:: exec:: cache_task_template ( "/lua" ) . expect ( "can't cache task" ) ;
215+ // tasks::exec::cache_task_template("/ lmbench_all").expect("can't cache task");
216216
217217 // init kernel threads and async executor
218218 tasks:: init ( ) ;
Original file line number Diff line number Diff line change @@ -141,6 +141,15 @@ pub async fn exec_with_process(
141141 Some ( dir) => format ! ( "{}/{}" , dir. path( ) , path) ,
142142 None => path,
143143 } ;
144+ let mut paths = Vec :: new ( ) ;
145+ path. split ( "/" )
146+ . into_iter ( )
147+ . filter ( |& x| x != "" && x != "." )
148+ . for_each ( |x| {
149+ paths. push ( x) ;
150+ } ) ;
151+ let path = String :: from ( "/" ) + & paths. join ( "/" ) ;
152+
144153 let user_task = task. clone ( ) ;
145154 user_task. pcb . lock ( ) . memset . clear ( ) ;
146155 user_task. page_table . restore ( ) ;
Original file line number Diff line number Diff line change @@ -223,11 +223,6 @@ impl UserTask {
223223 Some ( ppn)
224224 }
225225
226- // pub fn get_cx_ptr(&self) -> *mut Context {
227- // // (&mut self.tcb.read().cx) as *mut Context
228- // unsafe { &mut self.tcb.as_mut_ptr().as_mut().unwrap().cx as _ }
229- // }
230-
231226 pub fn force_cx_ref ( & self ) -> & ' static mut TrapFrame {
232227 unsafe { & mut self . tcb . as_mut_ptr ( ) . as_mut ( ) . unwrap ( ) . cx }
233228 }
You can’t perform that action at this time.
0 commit comments