From b74c5c8fb4de3b2847bc942e57dcf8f0dea705be Mon Sep 17 00:00:00 2001 From: Michal Idziorek Date: Wed, 13 May 2015 23:58:39 +0200 Subject: fixed libc and 'userspace' --- userspace/foolshell.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'userspace/foolshell.c') diff --git a/userspace/foolshell.c b/userspace/foolshell.c index 3a87158..da05e96 100644 --- a/userspace/foolshell.c +++ b/userspace/foolshell.c @@ -45,6 +45,7 @@ int main(int argc, char **argv) if(!silent)hello(); char *buf=malloc(256); + // printf("malloc returned: 0x%08X\n",buf); while(1) { @@ -87,8 +88,6 @@ char **tokenize(char *buf) i++; } token[c][t]=0; - - // printf("token %i : <%s>\n",c, token[c]); c++; @@ -216,15 +215,17 @@ int process(char *buf) int pid=fork(); if(pid!=0) { - //printf("new task pid: %i \n",pid); + printf("new task pid: %i \n",pid); } if(pid==0) { char buf[256]; sprintf(buf,"%s",token[0]); execve(buf,token,environ); - sprintf(buf,"%s/%s",getenv("PATH"),token[0]); + //sprintf(buf,"%s/%s",getenv("PATH"),token[0]); + sprintf(buf,"%s/%s","/bin",token[0]); execve(buf,token,environ); + puts("foolshell: command not found"); exit(1); } -- cgit v1.2.3