Index: trunk/kernel/kern/kernel_init.c
===================================================================
--- trunk/kernel/kern/kernel_init.c	(revision 285)
+++ trunk/kernel/kern/kernel_init.c	(revision 296)
@@ -29,4 +29,5 @@
 #include <hal_context.h>
 #include <hal_irqmask.h>
+#include <hal_ppm.h>
 #include <barrier.h>
 #include <remote_barrier.h>
@@ -784,6 +785,6 @@
 
     if( (core_lid ==  0) && (local_cxy == 0) ) 
-    kinit_dmsg("\n[INFO] %s exit barrier 0 at cycle %d : TXT0 initialized\n",
-               __FUNCTION__, (uint32_t)hal_time_stamp());
+    kinit_dmsg("\n[INFO] %s : exit barrier 0 : TXT0 initialized / cycle %d\n",
+    __FUNCTION__, hal_time_stamp() );
 
     /////////////////////////////////////////////////////////////////////////////
@@ -822,10 +823,10 @@
 
     if( (core_lid ==  0) && (local_cxy == 0) ) 
-    kinit_dmsg("\n[INFO] %s exit barrier 1 at cycle %d : clusters initialised\n",
-               __FUNCTION__, (uint32_t)hal_time_stamp());
+    kinit_dmsg("\n[INFO] %s : exit barrier 1 : clusters initialised / cycle %d\n",
+    __FUNCTION__, hal_time_stamp() );
 
     /////////////////////////////////////////////////////////////////////////////////
     // STEP 2 : all CP0s initialize the process_zero descriptor.
-    //          CP0 in cluster 0 initialises the IOPIC device.
+    //          CP0 in cluster 0 initializes the IOPIC device.
     /////////////////////////////////////////////////////////////////////////////////
 
@@ -847,11 +848,11 @@
 
     if( (core_lid ==  0) && (local_cxy == 0) ) 
-    kinit_dmsg("\n[INFO] %s exit barrier 2 at cycle %d : PIC initialised\n",
-               __FUNCTION__, (uint32_t)hal_time_stamp());
+    kinit_dmsg("\n[INFO] %s : exit barrier 2 : PIC initialised / cycle %d\n",
+    __FUNCTION__, hal_time_stamp() );
 
     ////////////////////////////////////////////////////////////////////////////////
-    // STEP 3 : all CP0s complete the distibuted LAPIC initialization.
-    //          all CP0s initialize their internal chdev descriptors
-    //          all CP0s initialize their local external chdev descriptors
+    // STEP 3 : all CP0s initialize the distibuted LAPIC descriptor.
+    //          all CP0s initialize the internal chdev descriptors
+    //          all CP0s initialize the local external chdev descriptors
     ////////////////////////////////////////////////////////////////////////////////
 
@@ -878,9 +879,10 @@
 
     if( (core_lid ==  0) && (local_cxy == 0) ) 
-    kinit_dmsg("\n[INFO] %s exit barrier 3 at cycle %d : all chdev initialised\n",
-               __FUNCTION__, (uint32_t)hal_time_stamp());
+    kinit_dmsg("\n[INFO] %s : exit barrier 3 : all chdev initialised / cycle %d\n",
+               __FUNCTION__, hal_time_stamp());
 
     /////////////////////////////////////////////////////////////////////////////////
     // STEP 4 : All cores enable IPI (Inter Procesor Interrupt),
+    //          All cores initialise specific core registers
     //          Alh cores initialize IDLE thread.
     //          Only CP0 in cluster 0 creates the VFS root inode.
@@ -891,16 +893,14 @@
     
     // All cores enable the shared IPI channel
-
-// @@@
-    hal_set_ebase( 0x1000 );
-// @@@
-
     dev_pic_enable_ipi();
     hal_enable_irq( &status );
 
+    // All cores initialize specific core registers
+    hal_core_init( info );
+
     kinit_dmsg("\n[INFO] %s : IRQs enabled for core[%x,%d] / SR = %x\n", 
                __FUNCTION__ , local_cxy , core_lid , hal_get_sr() );
 
-    // all cores create the idle thread descriptor
+    // all cores initialize the idle thread descriptor
     error = thread_kernel_init( thread,
                                 THREAD_IDLE,
@@ -915,15 +915,17 @@
     }
 
-    // all cores register idle thread in scheduler
+    // all cores unblock idle thread, and register it in scheduler
+    thread_unblock( XPTR( local_cxy , thread ) , THREAD_BLOCKED_GLOBAL );
     core->scheduler.idle = thread;
 
-    // all core activate the idle thread
-    thread_unblock( XPTR( local_cxy , thread ) , THREAD_BLOCKED_GLOBAL );
-
     if( (core_lid ==  0) && (local_cxy == 0) ) 
     {
-        kinit_dmsg("\n[INFO] %s : created idle thread %x at cycle %d\n",
-                   __FUNCTION__ , thread , (uint32_t)hal_time_stamp());
-    }
+        kinit_dmsg("\n[INFO] %s : initialized idle thread %x on core[%x,%d] / cycle %d\n",
+        __FUNCTION__ , thread->trdid , local_cxy, core_lid, (uint32_t)hal_time_stamp());
+    }
+
+    #if CONFIG_KINIT_DEBUG
+    sched_display();
+    #endif
 
     // CPO in cluster 0 creates the VFS root
@@ -991,6 +993,6 @@
 
     if( (core_lid ==  0) && (local_cxy == 0) ) 
-    kinit_dmsg("\n[INFO] %s exit barrier 4 at cycle %d : VFS OK in cluster 0\n",
-               __FUNCTION__, (uint32_t)hal_time_stamp());
+    kinit_dmsg("\n[INFO] %s : exit barrier 4 : VFS_root = %l in cluster 0 / cycle %d\n",
+               __FUNCTION__, vfs_root_inode_xp , hal_time_stamp());
 
     /////////////////////////////////////////////////////////////////////////////////
@@ -1010,6 +1012,5 @@
             fatfs_ctx_t * fatfs_ctx = fatfs_ctx_alloc();
 
-            assert( (fatfs_ctx != NULL) , __FUNCTION__ ,
-                    "cannot create FATFS context\n" );
+            assert( (fatfs_ctx != NULL) , __FUNCTION__ , "cannot create FATFS context\n" );
 
             // get local pointer on VFS context for FATFS
@@ -1031,5 +1032,5 @@
 
         // get extended pointer on VFS root inode from cluster 0
-        vfs_root_inode_xp = hal_remote_lwd( XPTR( 0 , process_zero.vfs_root_xp ) );
+        vfs_root_inode_xp = hal_remote_lwd( XPTR( 0 , &process_zero.vfs_root_xp ) );
 
         // update local process_zero descriptor
@@ -1044,8 +1045,7 @@
     /////////////////////////////////////////////////////////////////////////////////
 
-//    if( (core_lid ==  0) && (local_cxy == 0) ) 
-    kinit_dmsg("\n[INFO] %s exit barrier 5 at cycle %d : VFS OK in all clusters\n",
-               __FUNCTION__, (uint32_t)hal_time_stamp());
-
+    if( (core_lid ==  0) && (local_cxy == io_cxy) ) 
+    kinit_dmsg("\n[INFO] %s : exit barrier 5 : VFS_root = %l in cluster IO / cycle %d\n",
+    __FUNCTION__, vfs_root_inode_xp , hal_time_stamp() );
 
     /////////////////////////////////////////////////////////////////////////////////
@@ -1072,6 +1072,4 @@
     }    
 
-printk("\n@@@ %s : cluster %x reach barrier 6\n", __FUNCTION__ , local_cxy );
-
     /////////////////////////////////////////////////////////////////////////////////
     if( core_lid == 0 ) remote_barrier( XPTR( io_cxy , &global_barrier ), 
@@ -1080,7 +1078,7 @@
     /////////////////////////////////////////////////////////////////////////////////
 
-//    if( (core_lid ==  0) && (local_cxy == 0) ) 
-    kinit_dmsg("\n[INFO] %s exit barrier 6 at cycle %d : DEVFS OK in cluster IO\n",
-               __FUNCTION__, (uint32_t)hal_time_stamp());
+    if( (core_lid ==  0) && (local_cxy == io_cxy) ) 
+    kinit_dmsg("\n[INFO] %s : exit barrier 6 : dev_root = %l in cluster IO / cycle %d\n",
+    __FUNCTION__, devfs_dev_inode_xp , hal_time_stamp() );
 
     /////////////////////////////////////////////////////////////////////////////////
@@ -1118,6 +1116,6 @@
 
     if( (core_lid ==  0) && (local_cxy == 0) ) 
-    kinit_dmsg("\n[INFO] %s exit barrier 7 at cycle %d : DEVFS OK in all clusters\n",
-               __FUNCTION__, (uint32_t)hal_time_stamp());
+    kinit_dmsg("\n[INFO] %s : exit barrier 7 : dev_root = %l in cluster 0 / cycle %d\n",
+    __FUNCTION__, devfs_dev_inode_xp , hal_time_stamp() );
 
     #if CONFIG_KINIT_DEBUG
@@ -1141,6 +1139,6 @@
 
     if( (core_lid ==  0) && (local_cxy == 0) ) 
-    kinit_dmsg("\n[INFO] %s exit barrier 8 at cycle %d : process init created\n", 
-               __FUNCTION__ , (uint32_t)hal_time_stamp() );
+    kinit_dmsg("\n[INFO] %s : exit barrier 8 : process init created / cycle %d\n", 
+    __FUNCTION__ , hal_time_stamp() );
 
     /////////////////////////////////////////////////////////////////////////////////
@@ -1198,8 +1196,4 @@
     dev_pic_enable_timer( CONFIG_SCHED_TICK_PERIOD );
 
-    if( (core_lid ==  0) && (local_cxy == io_cxy) ) 
-    thread_dmsg("\n[INFO] %s complete kernel init in cluster 0 at cycle %d\n"
-                __FUNCTION__ , (uint32_t)hal_time_stamp() )
-
     // each core jump to idle thread
     thread_idle_func();
