diff options
Diffstat (limited to 'userspace/foolshell.c')
| -rw-r--r-- | userspace/foolshell.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/userspace/foolshell.c b/userspace/foolshell.c new file mode 100644 index 0000000..bc02102 --- /dev/null +++ b/userspace/foolshell.c @@ -0,0 +1,34 @@ +#include <stdio.h> +#include "syscalls.c" + +void hello() { + puts( + "Welcome to FoolShell v0.1" + ); +} + +void prompt() { + printf( + "$ " + ); +} +int main(int argc, char **argv) +{ + syscalls_init(); + hello(); + + FILE *input; + input=fopen(1,"r"); + char *buf=malloc(256); + + while(1) + { + prompt(); + fgets(buf,255,input); + buf[strlen(buf)-1]=0; + puts(buf); + } + + + return 0; +} |
