diff options
Diffstat (limited to 'userspace/init.c')
| -rw-r--r-- | userspace/init.c | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/userspace/init.c b/userspace/init.c index d130bc8..7237fdc 100644 --- a/userspace/init.c +++ b/userspace/init.c @@ -5,18 +5,35 @@ int main(int argc, char **argv) { - // int x=10/0; // provoke divide by zero + // loop forever and spawn shells if the top-shell exits + + int pid=_fork(); - uint8_t *mem=0xf6000000; - *mem='a'; - while(1); + if(pid==0) + { + _execve("/bin/pain1",NULL,NULL); + } + else + { + int pid=_fork(); + if(pid==0) + { + _execve("/bin/pain2",NULL,NULL); + } + else + { + _execve("/bin/pain3",NULL,NULL); + } + } + + + return 0; + // char *argv1[]={"/bin/fsh",0}; char *env1[]={"HOME=/home/miguel","PS1=\033[34m$\033[37m","PWD=/home/miguel","PATH=/bin","TERM=fool-term",0}; - - // loop forever and spawn shells if the top-shell exits while(1) { |
