diff kernel/src/process.c3 @ 393:6ae782a085e0

Added init program
author Windel Bouwman
date Sat, 17 May 2014 21:17:40 +0200
parents 2ec730e45ea1
children
line wrap: on
line diff
--- a/kernel/src/process.c3	Fri May 16 13:05:10 2014 +0200
+++ b/kernel/src/process.c3	Sat May 17 21:17:40 2014 +0200
@@ -15,6 +15,7 @@
 
 // init is the root of all processes:
 var process_t* root_process;
+
 var int next_pid;
 
 function void init()
@@ -30,10 +31,10 @@
 function process_t* Create()
 {
     var process_t* p;
-    //TODO: implement alloc:
 
-    //= memory.Alloc(sizeof(process_t));
+    p = cast<process_t*>(memory.alloc(sizeof(process_t)));
     p->id = next_pid;
+    p->status = 0; // Ready!
     p->next = cast<process_t*>(0);
 
     // Increment PID:
@@ -52,14 +53,13 @@
         {
             parent = parent->next;
         }
+
         parent->next = p;
     }
 
     return p;
 }
 
-// function
-
 
 function void Kill(process_t* p)
 {