diff options
Diffstat (limited to 'userspace')
| -rw-r--r-- | userspace/Makefile | 2 | ||||
| -rw-r--r-- | userspace/files/file.txt | 4 | ||||
| -rw-r--r-- | userspace/fsh.c | 5 | ||||
| -rw-r--r-- | userspace/init.c | 6 | ||||
| -rw-r--r-- | userspace/xterm/xterm.c | 7 |
5 files changed, 17 insertions, 7 deletions
diff --git a/userspace/Makefile b/userspace/Makefile index b1b077d..af799fb 100644 --- a/userspace/Makefile +++ b/userspace/Makefile @@ -1,4 +1,4 @@ -IMAGESIZE=20000 #ext2.img size in Kb +IMAGESIZE=30000 #ext2.img size in Kb ####################### diff --git a/userspace/files/file.txt b/userspace/files/file.txt index 8cdd524..7a8a521 100644 --- a/userspace/files/file.txt +++ b/userspace/files/file.txt @@ -80,3 +80,7 @@ both eyes so that they made a half-garland on the projecting steel. There was no part of the hook that a great fish could feel which was not sweet smelling and good tasting. +smelling and good tasting. +smelling and good tasting. +smelling and good tasting. + diff --git a/userspace/fsh.c b/userspace/fsh.c index 62cd27e..76c0954 100644 --- a/userspace/fsh.c +++ b/userspace/fsh.c @@ -33,6 +33,7 @@ void version() { puts("Fool's Shell version git-commit:" GIT_REVISION "\ncompiled on " __DATE__ " at " __TIME__); } + void help() { puts( "\nfoolshell: supported built-in commands/functions:\n\n" @@ -58,6 +59,8 @@ void prompt() int main(int argc, char **argv) { + while(1); + for(int i=0;i<argc;i++) { if(!strcmp(argv[i],"--version")) @@ -242,7 +245,7 @@ bool process(char *buf) int last=0; for(last=0;token[last+1]!=NULL;last++); - printf("last: %s\n",token[last]); + //printf("last: %s\n",token[last]); if(strcmp(token[last],"&"))_wait(pid); } diff --git a/userspace/init.c b/userspace/init.c index 645acd9..a2b2425 100644 --- a/userspace/init.c +++ b/userspace/init.c @@ -6,11 +6,7 @@ int main(int argc, char **argv) { - - // loop forever and spawn shells if the top-shell exits - int fds[2]; - _pipe(fds); - + _execve("/bin/xterm",NULL,NULL); int pid=_fork(); diff --git a/userspace/xterm/xterm.c b/userspace/xterm/xterm.c index 96389a9..31feea7 100644 --- a/userspace/xterm/xterm.c +++ b/userspace/xterm/xterm.c @@ -16,6 +16,7 @@ int main() int pid=_fork(); + if(!pid) { _close(xterm_in[1]); @@ -25,9 +26,13 @@ int main() _dup2(xterm_out[1],1);// stdout _dup2(xterm_out[1],2);// stderr + while(1); + char *argv1[]={"/bin/fsh",0}; char *env1[]={"HOME=/home/miguel","PS1=\033[34m$\033[37m","PWD=/home/miguel","PATH=/bin","TERM=fool-term",0}; + while(1); + _execve("/bin/fsh",argv1,env1); // replace process with our foolshell :) } @@ -36,6 +41,8 @@ int main() _dup2(xterm_in[1],1); // compositor writes here. + while(1); + while(1) { char buf[1]; |
