Index: trunk/kernel/kern/process.c
===================================================================
--- trunk/kernel/kern/process.c	(revision 623)
+++ trunk/kernel/kern/process.c	(revision 624)
@@ -1209,5 +1209,5 @@
 
 // check th_nr value
-assert( (count > 0) , "process th_nr cannot be 0\n" );
+assert( (count > 0) , "process th_nr cannot be 0" );
 
     // remove thread from th_tbl[]
@@ -1249,5 +1249,5 @@
 // check parent process is the reference process
 assert( (parent_process_xp == ref_xp ) ,
-"parent process must be the reference process\n" );
+"parent process must be the reference process" );
 
 #if DEBUG_PROCESS_MAKE_FORK
@@ -1352,5 +1352,5 @@
 // check main thread LTID
 assert( (LTID_FROM_TRDID(thread->trdid) == 0) ,
-"main thread must have LTID == 0\n" );
+"main thread must have LTID == 0" );
 
 #if( DEBUG_PROCESS_MAKE_FORK & 1 )
@@ -1552,4 +1552,7 @@
 #endif
 
+    // get pointer on VMM
+    vmm_t * vmm = &process->vmm;
+
     // get PID from local cluster manager for this kernel process
     error = cluster_pid_alloc( process , &pid );
@@ -1571,6 +1574,29 @@
     process->term_state = 0;
 
-    // initialise kernel GPT and VSL, depending on architecture
-    hal_vmm_kernel_init( info );
+    // initilise VSL as empty
+    vmm->vsegs_nr = 0;
+	xlist_root_init( XPTR( local_cxy , &vmm->vsegs_root ) );
+	remote_rwlock_init( XPTR( local_cxy , &vmm->vsegs_lock ) , LOCK_VMM_VSL );
+
+    // initialise GPT as empty
+    error = hal_gpt_create( &vmm->gpt );
+
+    if( error ) 
+    {
+        printk("\n[PANIC] in %s : cannot create empty GPT\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // initialize GPT lock
+    remote_rwlock_init( XPTR( local_cxy , &vmm->gpt_lock ) , LOCK_VMM_GPT );
+    
+    // create kernel vsegs in GPT and VSL, as required by the hardware architecture
+    error = hal_vmm_kernel_init( info );
+
+    if( error ) 
+    {
+        printk("\n[PANIC] in %s : cannot create kernel vsegs in VMM\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
 
     // reset th_tbl[] array and associated fields
@@ -1629,5 +1655,5 @@
 // check memory allocator
 assert( (process != NULL),
-"no memory for process descriptor in cluster %x\n", local_cxy  );
+"no memory for process descriptor in cluster %x", local_cxy  );
 
     // set the CWD and VFS_ROOT fields in process descriptor
@@ -1640,9 +1666,9 @@
 // check PID allocator 
 assert( (error == 0),
-"cannot allocate PID in cluster %x\n", local_cxy );
+"cannot allocate PID in cluster %x", local_cxy );
 
 // check PID value
 assert( (pid == 1) ,
-"process INIT must be first process in cluster 0\n" );
+"process INIT must be first process in cluster 0" );
 
     // initialize process descriptor / parent is local process_zero
@@ -1669,5 +1695,5 @@
 
 assert( (error == 0),
-"failed to open file <%s>\n", CONFIG_PROCESS_INIT_PATH );
+"failed to open file <%s>", CONFIG_PROCESS_INIT_PATH );
 
 #if(DEBUG_PROCESS_INIT_CREATE & 1)
@@ -1682,5 +1708,5 @@
 
 assert( (error == 0),
-"cannot access .elf file <%s>\n", CONFIG_PROCESS_INIT_PATH );
+"cannot access .elf file <%s>", CONFIG_PROCESS_INIT_PATH );
 
 #if(DEBUG_PROCESS_INIT_CREATE & 1)
@@ -1726,8 +1752,8 @@
 
 assert( (error == 0),
-"cannot create main thread for <%s>\n", CONFIG_PROCESS_INIT_PATH );
+"cannot create main thread for <%s>", CONFIG_PROCESS_INIT_PATH );
 
 assert( (thread->trdid == 0),
-"main thread must have index 0 for <%s>\n", CONFIG_PROCESS_INIT_PATH );
+"main thread must have index 0 for <%s>", CONFIG_PROCESS_INIT_PATH );
 
 #if(DEBUG_PROCESS_INIT_CREATE & 1)
@@ -1816,5 +1842,5 @@
 
         assert( (txt_file_xp != XPTR_NULL) ,
-        "process must be attached to one TXT terminal\n" ); 
+        "process must be attached to one TXT terminal" ); 
 
         // get TXT_RX chdev pointers
@@ -2012,5 +2038,5 @@
     // check owner cluster
     assert( (process_cxy == CXY_FROM_PID( process_pid )) ,
-    "process descriptor not in owner cluster\n" );
+    "process descriptor not in owner cluster" );
 
     // get extended pointer on stdin pseudo file
@@ -2067,5 +2093,5 @@
     // check owner cluster
     assert( (process_cxy == CXY_FROM_PID( process_pid )) ,
-    "process descriptor not in owner cluster\n" );
+    "process descriptor not in owner cluster" );
 
     // get extended pointer on stdin pseudo file
@@ -2198,5 +2224,5 @@
 pid_t process_pid = hal_remote_l32( XPTR( process_cxy , &process_ptr->pid ) );
 assert( (process_cxy == CXY_FROM_PID( process_pid )) ,
-"process descriptor not in owner cluster\n" );
+"process descriptor not in owner cluster" );
 
     // get extended pointer on stdin pseudo file
