fix: correction PS pour avoir TOUTES les tâches
This commit is contained in:
parent
c894b99170
commit
75a8602c5b
15
lib/shell.c
15
lib/shell.c
|
@ -109,12 +109,19 @@ int ps()
|
||||||
if (aprocess==NULL || aprocess->pid==(pid_t)1) break;
|
if (aprocess==NULL || aprocess->pid==(pid_t)1) break;
|
||||||
}
|
}
|
||||||
print("\r\n\r\n*** Taches en memoire\r\n| TID | PID |Status| CS | EIP | SS | ESP |\r\n");
|
print("\r\n\r\n*** Taches en memoire\r\n| TID | PID |Status| CS | EIP | SS | ESP |\r\n");
|
||||||
task* atask=findtask(maketid(1,1));
|
aprocess=findprocess((pid_t)1);
|
||||||
|
task* atask;
|
||||||
|
while(true)
|
||||||
|
{
|
||||||
|
atask=findfirsttask(aprocess);
|
||||||
while(true)
|
while(true)
|
||||||
{
|
{
|
||||||
printf("|%Y|%Y| %s|%hY|%Y|%hY|%Y|\r\n",(u32)atask->tid.number,(u32)atask->tid.pid,taskstatus[atask->status],atask->dump.cs,atask->dump.eip,atask->dump.ss,atask->dump.esp);
|
printf("|%Y|%Y| %s|%hY|%Y|%hY|%Y|\r\n",(u32)atask->tid.number,(u32)atask->tid.pid,taskstatus[atask->status],atask->dump.cs,atask->dump.eip,atask->dump.ss,atask->dump.esp);
|
||||||
atask=getnexttask(atask,TASK_STATUS_ALL);
|
atask=getnexttask(atask,TASK_STATUS_ALL);
|
||||||
if (atask==NULL || atask->tid.number==1) break;
|
if (atask==NULL || (atask->tid.number==1 && atask->tid.pid==1)) break;
|
||||||
|
}
|
||||||
|
aprocess=getnextprocess(aprocess,PROCESS_STATUS_ALL);
|
||||||
|
if (aprocess==NULL || aprocess->pid==(pid_t)1) break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,8 +136,8 @@ int testtask()
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
pid = createprocess(&programs_test2, false);
|
pid = createprocess(&programs_test2, false);
|
||||||
runprocess(pid);
|
runprocess(pid);
|
||||||
pid = createprocess(&programs_test, false);
|
//pid = createprocess(&programs_test, false);
|
||||||
runprocess(pid);
|
//runprocess(pid);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************************************/
|
/*******************************************************************************/
|
||||||
|
|
Loading…
Reference in New Issue