From 81a8252db679351f5ba388b420519724c9c2c2be Mon Sep 17 00:00:00 2001 From: Miguel Date: Thu, 4 Oct 2018 02:17:13 +0200 Subject: reverting userspace idea --- userspace/init.c | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'userspace/init.c') 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) { -- cgit v1.2.3