summaryrefslogtreecommitdiff
path: root/userspace/init.c
diff options
context:
space:
mode:
authorMichal Idziorek <m.i@gmx.at>2014-12-01 23:33:31 +0100
committerMichal Idziorek <m.i@gmx.at>2014-12-01 23:33:31 +0100
commitf20db37ca17245d5d20302a1ac1da347de5c3607 (patch)
treece0712176387f4555cf290615b71cdd1c935557d /userspace/init.c
parentd8331335ff1720ce28eba45afe1a02814b38b033 (diff)
very buggy fork, execve and exit
Diffstat (limited to 'userspace/init.c')
-rw-r--r--userspace/init.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/userspace/init.c b/userspace/init.c
index d03d173..fd562a9 100644
--- a/userspace/init.c
+++ b/userspace/init.c
@@ -1,12 +1,21 @@
int main(int argc, char **argv)
{
- printf("Fool OS Init 0.1 \n");
-
int pid=fork();
- while(1)
+ if(pid!=0)
{
- printf("I am pid: %i\n",pid);
+ printf("fool-init: forked child (pid: %i) spawning a Fools Shell\n",pid);
+ execve("/bin/foolshell",0,0);
+
+ }
+ else
+ {
+ // TODO: wait for child and respawn shell if needed!
+ volatile int i=0;
+ while(1)
+ {
+
+ }
}
return 0;
}