From 75a8602c5baff9fced38773efa5c1152e9116f84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Tue, 25 Dec 2018 19:39:40 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20correction=20PS=20pour=20avoir=20TOUTES?= =?UTF-8?q?=20les=20t=C3=A2ches?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/shell.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/lib/shell.c b/lib/shell.c index 6b49f0e..2a74090 100644 --- a/lib/shell.c +++ b/lib/shell.c @@ -109,12 +109,19 @@ int ps() 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"); - task* atask=findtask(maketid(1,1)); + aprocess=findprocess((pid_t)1); + task* atask; 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); - atask=getnexttask(atask,TASK_STATUS_ALL); - if (atask==NULL || atask->tid.number==1) break; + { + atask=findfirsttask(aprocess); + 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); + atask=getnexttask(atask,TASK_STATUS_ALL); + 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 = createprocess(&programs_test2, false); runprocess(pid); - pid = createprocess(&programs_test, false); - runprocess(pid); + //pid = createprocess(&programs_test, false); + //runprocess(pid); } /*******************************************************************************/