diff options
Diffstat (limited to 'userspace')
| -rw-r--r-- | userspace/clear.c | 7 | ||||
| -rw-r--r-- | userspace/foolshell.c | 31 |
2 files changed, 23 insertions, 15 deletions
diff --git a/userspace/clear.c b/userspace/clear.c index 09913c3..38efeb6 100644 --- a/userspace/clear.c +++ b/userspace/clear.c @@ -1,9 +1,6 @@ int main() { - for(int i=0;i<24;i++) - { - puts(""); - } - + printf("\033c"); + fflush(0); // force printing to console return 0; } diff --git a/userspace/foolshell.c b/userspace/foolshell.c index 8496b05..bf0501f 100644 --- a/userspace/foolshell.c +++ b/userspace/foolshell.c @@ -8,7 +8,12 @@ extern char **environ; void hello() { // ascci art: http://patorjk.com/software/taag/#p=testall&f=Cards&t=Fool%20OS + // + puts( + + "\033c" + "\033[37;44m" " ______ __ ____ _____ \n" " / ____/___ ____ / / / __ \\/ ___/ \n" @@ -16,16 +21,22 @@ void hello() " / __/ / /_/ / /_/ / / / /_/ /___/ / \n" " /_/ \\____/\\____/_/ \\____//____/ \n" " \n" - "Welcome to FoolShell v0.6 (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" - "their filenames. Get additional information for many, of the available\n" - "commands by invoking them with --help or -h. (e.g. ls --help) \n" + "\033[37;43m" + " \n" + + " Welcome to FoolShell v0.7 (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" + " their filenames. Get additional information for many, of the available\n" + " commands by invoking them with --help or -h. (e.g. ls --help) \n" + " \n" + + "\033[37;40m" ); - printf("Your $PATH is currently set to: %s\n",getenv("PATH")); - printf("Type 'ls %s' to list programms on your $PATH.\n\n",getenv("PATH")); + printf(" Your $PATH is currently set to: %s\n",getenv("PATH")); + printf(" Type 'ls %s' to list programms on your $PATH.\n\n",getenv("PATH")); } void prompt() @@ -45,6 +56,7 @@ int main(int argc, char **argv) if(!silent)hello(); char *buf=malloc(256); + while(1) @@ -215,7 +227,7 @@ 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) { @@ -225,7 +237,6 @@ int process(char *buf) //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); } |
