summaryrefslogtreecommitdiff
path: root/userspace/foolshell.c
diff options
context:
space:
mode:
authorMiguel <m.i@gmx.at>2018-08-17 02:28:02 +0200
committerMiguel <m.i@gmx.at>2018-08-17 02:28:02 +0200
commitc742be9c738c91703a7be787639cad167de3a6b1 (patch)
treedb0e170dab1b7f34630489d0cb1d396c92f15c79 /userspace/foolshell.c
parent559eea53ecdd1e3e45f24d15e8739419b0cd647a (diff)
started reviving my fool os
Diffstat (limited to 'userspace/foolshell.c')
-rw-r--r--userspace/foolshell.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/userspace/foolshell.c b/userspace/foolshell.c
index ba73e1d..a502f47 100644
--- a/userspace/foolshell.c
+++ b/userspace/foolshell.c
@@ -8,13 +8,8 @@
extern char **environ;
extern struct _reent *_impure_ptr;
-
-
uint8_t buf_test[1024*300];
-
-
-
//
void hello()
{
@@ -36,7 +31,7 @@ void hello()
"\033[37;44m"
" \n"
- " Welcome to FoolShell v0.8 (Compiled on " __DATE__ " at " __TIME__")\n"
+ " Welcome to FoolShell v0.12 (Compiled on " __DATE__ " at " __TIME__")\n"
" ------------------------------------------------------------------\n\n"
" Please type 'help' anytime, to show shell \"built-ins\". You can execute \n"
" user programms that are in your $PATH directory by simply typing \n"
@@ -147,6 +142,7 @@ int process(char *buf)
"'cd [dir]' - change directory (set $PWD)\n"
"'exit' - exit running foolshell\n\n");
}
+
else if(!strcmp(command,"cd"))
{
char *dir=getenv("PWD");
@@ -241,7 +237,7 @@ int process(char *buf)
}
else
{
- int pid=fork();
+ int pid=_fork();
if(pid!=0)
{
// printf("new task pid: %i \n",pid);
@@ -250,15 +246,15 @@ int process(char *buf)
{
char buf[256];
sprintf(buf,"%s",token[0]);
- execve(buf,token,environ);
+ _execve(buf,token,environ);
//sprintf(buf,"%s/%s",getenv("PATH"),token[0]);
sprintf(buf,"%s/%s","/bin",token[0]);
- execve(buf,token,environ);
+ _execve(buf,token,environ);
puts("foolshell: command not found");
exit(1);
}
int status;
- if(strcmp(token[1],"branch"))wait(&status);
+ if(strcmp(token[1],"branch"))_wait(&status);
}
return 0;