Index: soft/giet_vm/giet_boot/boot.c
===================================================================
--- soft/giet_vm/giet_boot/boot.c	(revision 435)
+++ soft/giet_vm/giet_boot/boot.c	(revision 436)
@@ -63,4 +63,5 @@
 
 #include <giet_config.h>
+#include <mapping_info.h>
 #include <mwmr_channel.h>
 #include <barrier.h>
@@ -668,5 +669,5 @@
 // For the vseg defined by the vseg pointer, this function register all PTEs
 // in one or several page tables.
-// It is a global vseg (system vseg) if (vspace_id == 0xFFFFFFFF).
+// It is a global vseg (kernel vseg) if (vspace_id == 0xFFFFFFFF).
 // The number of involved PTABs depends on the "local" and "global" attributes:
 //  - PTEs are replicated in all vspaces for a global vseg.
@@ -848,11 +849,10 @@
 //
 // For each vseg, the mapping is done in two steps:
-//
-// A) mapping : the boot_vseg_map() function allocates contiguous BPPs 
+// 1) mapping : the boot_vseg_map() function allocates contiguous BPPs 
 //    or SPPs (if the vseg is not associated to a peripheral), and register
 //    the physical base address in the vseg pbase field. It initialises the
 //    _ptabs_vaddr and _ptabs_paddr arrays if the vseg is a PTAB.
 //
-// B) page table initialisation : the boot_vseg_pte() function initialise 
+// 2) page table initialisation : the boot_vseg_pte() function initialise 
 //    the PTEs (both PTE1 and PTE2) in one or several page tables:
 //    - PTEs are replicated in all vspaces for a global vseg.
@@ -865,5 +865,5 @@
 //   4) all private vsegs in user space.
 ///////////////////////////////////////////////////////////////////////////////
-void _ptabs_init() 
+void boot_ptabs_init() 
 {
     mapping_header_t*   header = (mapping_header_t *)SEG_BOOT_MAPPING_BASE;
@@ -877,5 +877,5 @@
     if (header->vspaces == 0 )
     {
-        _puts("\n[BOOT ERROR] in _ptabs_init() : mapping ");
+        _puts("\n[BOOT ERROR] in boot_ptabs_init() : mapping ");
         _puts( header->name );
         _puts(" contains no vspace\n");
@@ -1278,16 +1278,6 @@
     unsigned int lpid;          // local processor index (for several loops)
 
-    // TTY, NIC, CMA, HBA, user timer, and WTI channel allocators to user tasks:
-    // - TTY[0] is reserved for the kernel
-    // - In all clusters the first NB_PROCS_MAX timers 
-    //   are reserved for the kernel (context switch)
-    unsigned int alloc_tty_channel = 1;              // global
-    unsigned int alloc_nic_channel = 0;              // global
-    unsigned int alloc_cma_channel = 0;              // global
-    unsigned int alloc_hba_channel = 0;              // global
-    unsigned int alloc_tim_channel[X_SIZE*Y_SIZE];   // one per cluster 
-
-    // WTI allocators to processors 
-    // In all clusters, first NB_PROCS_MAX WTIs are for WAKUP
+    // WTI allocators to processors (for HWIs translated to WTIs)  
+    // In all clusters the first NB_PROCS_MAX WTIs are reserved for WAKUP
     unsigned int alloc_wti_channel[X_SIZE*Y_SIZE];   // one per cluster
 
@@ -1320,5 +1310,4 @@
 _puts("]\n");
 #endif
-        alloc_tim_channel[cluster_id] = NB_PROCS_MAX;
         alloc_wti_channel[cluster_id] = NB_PROCS_MAX;
 
@@ -1350,5 +1339,5 @@
             }
 
-            // scan peripherals to find the ICU/XCU and the PIC component
+            // scan peripherals to find the XCU and the PIC component
 
             xcu = NULL;  
@@ -1357,6 +1346,5 @@
                   periph_id++ )
             {
-                if( (periph[periph_id].type == PERIPH_TYPE_XCU) || 
-                    (periph[periph_id].type == PERIPH_TYPE_ICU) )
+                if( periph[periph_id].type == PERIPH_TYPE_XCU ) 
                 {
                     xcu = &periph[periph_id];
@@ -1379,5 +1367,5 @@
             if ( xcu == NULL )
             {         
-                _puts("\n[BOOT ERROR] No ICU / XCU component in cluster[");
+                _puts("\n[BOOT ERROR] No XCU component in cluster[");
                 _putd( x );
                 _puts(",");
@@ -1650,98 +1638,4 @@
             unsigned int ctx_ptab = _ptabs_vaddr[vspace_id][x][y];
 
-            // ctx_tty : TTY terminal global index provided by the global allocator
-            //           Each user terminal is a private ressource: the number of
-            //           requested terminal cannot be larger than NB_TTY_CHANNELS.             
-            unsigned int ctx_tty = 0xFFFFFFFF;
-            if (task[task_id].use_tty) 
-            {
-                if (alloc_tty_channel >= NB_TTY_CHANNELS) 
-                {
-                    _puts("\n[BOOT ERROR] TTY channel index too large for task ");
-                    _puts(task[task_id].name);
-                    _puts(" in vspace ");
-                    _puts(vspace[vspace_id].name);
-                    _puts("\n");
-                    _exit();
-                }
-                ctx_tty = alloc_tty_channel;
-                alloc_tty_channel++;
-             }
-
-            // ctx_nic : NIC channel global index provided by the global allocator
-            //           Each channel is a private ressource: the number of
-            //           requested channels cannot be larger than NB_NIC_CHANNELS.
-            unsigned int ctx_nic = 0xFFFFFFFF;
-            if (task[task_id].use_nic) 
-            {
-                if (alloc_nic_channel >= NB_NIC_CHANNELS) 
-                {
-                    _puts("\n[BOOT ERROR] NIC channel index too large for task ");
-                    _puts(task[task_id].name);
-                    _puts(" in vspace ");
-                    _puts(vspace[vspace_id].name);
-                    _puts("\n");
-                    _exit();
-                }
-                ctx_nic = alloc_nic_channel;
-                alloc_nic_channel++;
-            }
-
-            // ctx_cma : CMA channel global index provided by the global allocator
-            //           Each channel is a private ressource: the number of
-            //           requested channels cannot be larger than NB_NIC_CHANNELS.
-            unsigned int ctx_cma = 0xFFFFFFFF;
-            if (task[task_id].use_cma) 
-            {
-                if (alloc_cma_channel >= NB_CMA_CHANNELS) 
-                {
-                    _puts("\n[BOOT ERROR] CMA channel index too large for task ");
-                    _puts(task[task_id].name);
-                    _puts(" in vspace ");
-                    _puts(vspace[vspace_id].name);
-                    _puts("\n");
-                    _exit();
-                }
-                ctx_cma = alloc_cma_channel;
-                alloc_cma_channel++;
-            }
-
-            // ctx_hba : HBA channel global index provided by the global allocator
-            //           Each channel is a private ressource: the number of
-            //           requested channels cannot be larger than NB_NIC_CHANNELS.
-            unsigned int ctx_hba = 0xFFFFFFFF;
-            if (task[task_id].use_hba) 
-            {
-                if (alloc_hba_channel >= NB_IOC_CHANNELS) 
-                {
-                    _puts("\n[BOOT ERROR] IOC channel index too large for task ");
-                    _puts(task[task_id].name);
-                    _puts(" in vspace ");
-                    _puts(vspace[vspace_id].name);
-                    _puts("\n");
-                    _exit();
-                }
-                ctx_hba = alloc_hba_channel;
-                alloc_hba_channel++;
-            }
-            // ctx_tim : TIMER local channel index provided by the cluster allocator 
-            //           Each timer is a private ressource
-            unsigned int ctx_tim = 0xFFFFFFFF;
-            if (task[task_id].use_tim) 
-            {
-                unsigned int cluster_id = task[task_id].clusterid;
-
-                if ( alloc_tim_channel[cluster_id] >= NB_TIM_CHANNELS ) 
-                {
-                    _puts("\n[BOOT ERROR] local TIMER index too large for task ");
-                    _puts(task[task_id].name);
-                    _puts(" in vspace ");
-                    _puts(vspace[vspace_id].name);
-                    _puts("\n");
-                    _exit();
-                }
-                ctx_tim =  alloc_tim_channel[cluster_id];
-                alloc_tim_channel[cluster_id]++;
-            }
             // ctx_epc : Get the virtual address of the memory location containing
             // the task entry point : the start_vector is stored by GCC in the seg_data 
@@ -1778,5 +1672,5 @@
             psched->current = 0;
 
-            // initializes the task context in scheduler
+            // initializes the task context 
             psched->context[ltid][CTX_CR_ID]    = 0;
             psched->context[ltid][CTX_SR_ID]    = ctx_sr;
@@ -1784,9 +1678,4 @@
             psched->context[ltid][CTX_EPC_ID]   = ctx_epc;
             psched->context[ltid][CTX_PTPR_ID]  = ctx_ptpr;
-            psched->context[ltid][CTX_TTY_ID]   = ctx_tty;
-            psched->context[ltid][CTX_CMA_ID]   = ctx_cma;
-            psched->context[ltid][CTX_HBA_ID]   = ctx_hba;
-            psched->context[ltid][CTX_NIC_ID]   = ctx_nic;
-            psched->context[ltid][CTX_TIM_ID]   = ctx_tim;
             psched->context[ltid][CTX_PTAB_ID]  = ctx_ptab;
             psched->context[ltid][CTX_LTID_ID]  = ltid;
@@ -1795,4 +1684,12 @@
             psched->context[ltid][CTX_VSID_ID]  = vspace_id;
             psched->context[ltid][CTX_RUN_ID]   = 1;
+
+            psched->context[ltid][CTX_TTY_ID]   = 0xFFFFFFFF;
+            psched->context[ltid][CTX_FBCMA_ID] = 0xFFFFFFFF;
+            psched->context[ltid][CTX_RXCMA_ID] = 0xFFFFFFFF;
+            psched->context[ltid][CTX_TXCMA_ID] = 0xFFFFFFFF;
+            psched->context[ltid][CTX_NIC_ID]   = 0xFFFFFFFF;
+            psched->context[ltid][CTX_HBA_ID]   = 0xFFFFFFFF;
+            psched->context[ltid][CTX_TIM_ID]   = 0xFFFFFFFF;
 
 #if BOOT_DEBUG_SCHED
@@ -1815,14 +1712,4 @@
 _puts("\n  - ctx[PTPR]   = ");
 _putx( psched->context[ltid][CTX_PTPR_ID] );
-_puts("\n  - ctx[TTY]    = ");
-_putx( psched->context[ltid][CTX_TTY_ID] );
-_puts("\n  - ctx[NIC]    = ");
-_putx( psched->context[ltid][CTX_NIC_ID] );
-_puts("\n  - ctx[CMA]    = ");
-_putx( psched->context[ltid][CTX_CMA_ID] );
-_puts("\n  - ctx[IOC]    = ");
-_putx( psched->context[ltid][CTX_HBA_ID] );
-_puts("\n  - ctx[TIM]    = ");
-_putx( psched->context[ltid][CTX_TIM_ID] );
 _puts("\n  - ctx[PTAB]   = ");
 _putx( psched->context[ltid][CTX_PTAB_ID] );
@@ -2120,5 +2007,6 @@
                 _puts(" in file ");
                 _puts( pathname );
-                _puts(" not found \n");   
+                _puts(" not found: \n");   
+                _puts(" check consistency between the .py and .ld files...\n");
                 _exit();
             }
@@ -2515,5 +2403,5 @@
 
         // Build page tables
-        _ptabs_init();
+        boot_ptabs_init();
 
         _puts("\n[BOOT] Page tables initialised at cycle ");
