diff options
| author | Michal Idziorek <m.i@gmx.at> | 2014-10-21 19:08:03 +0200 |
|---|---|---|
| committer | Michal Idziorek <m.i@gmx.at> | 2014-10-21 19:08:03 +0200 |
| commit | d25834310293c8a30b4a31418ff4ffd8fad8ef24 (patch) | |
| tree | 97ae696211f7709002d80ecbfb8595123611d3c1 /userspace/foolshell.c | |
| parent | 5b9ea685dfd12415774e4e97ad387c601dd2b43b (diff) | |
started implementing our first fool-shell.
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; +} |
