Index: /soft/giet_vm/giet_common/kernel_malloc.h
===================================================================
--- /soft/giet_vm/giet_common/kernel_malloc.h	(revision 753)
+++ /soft/giet_vm/giet_common/kernel_malloc.h	(revision 754)
@@ -53,4 +53,9 @@
 extern void _heap_init();
 
+extern unsigned int _get_heap_info( unsigned int* heap_base,
+                             unsigned int* heap_size,
+                             unsigned int  x,
+                             unsigned int  y );
+
 
 #endif
Index: /soft/giet_vm/giet_drivers/mmc_driver.c
===================================================================
--- /soft/giet_vm/giet_drivers/mmc_driver.c	(revision 753)
+++ /soft/giet_vm/giet_drivers/mmc_driver.c	(revision 754)
@@ -10,4 +10,5 @@
 #include <tty0.h>
 #include <kernel_locks.h>
+#include <kernel_malloc.h>
 #include <utils.h>
 
@@ -80,4 +81,9 @@
             else
             {
+                // get heap_base & heap size
+                unsigned int heap_base;
+                unsigned int heap_size;
+                if ( _get_heap_info( &heap_base, &heap_size, x, y ) ) continue;
+
                 _mmc_distributed_lock[x][y] = _remote_malloc( sizeof(spin_lock_t), x, y );
                 _spin_lock_init( _mmc_distributed_lock[x][y] );
Index: /soft/giet_vm/giet_drivers/rdk_driver.c
===================================================================
--- /soft/giet_vm/giet_drivers/rdk_driver.c	(revision 753)
+++ /soft/giet_vm/giet_drivers/rdk_driver.c	(revision 754)
@@ -26,5 +26,5 @@
 #if USE_IOC_RDK
 
-#if GIET_DEBUG_IOC_DRIVER
+#if GIET_DEBUG_IOC
 unsigned int procid  = _get_procid();
 unsigned int x       = procid >> (Y_WIDTH + P_WIDTH);
@@ -37,5 +37,5 @@
 
     char* rdk = (char*)SEG_RDK_BASE + (512*lba);
-    char* buf = (char*)buf_paddr;
+    char* buf = (char*)buf_vaddr;
 
     if ( to_mem ) memcpy( buf, rdk, count*512 );
Index: /soft/giet_vm/giet_kernel/sys_handler.c
===================================================================
--- /soft/giet_vm/giet_kernel/sys_handler.c	(revision 753)
+++ /soft/giet_vm/giet_kernel/sys_handler.c	(revision 754)
@@ -194,4 +194,6 @@
     &_sys_fbf_size,                  /* 0x08 */
     &_sys_fbf_alloc,                 /* 0x09 */ 
+
+#if NB_CMA_CHANNELS
     &_sys_fbf_cma_alloc,             /* 0x0A */
     &_sys_fbf_cma_init_buf,          /* 0x0B */
@@ -200,4 +202,12 @@
     &_sys_fbf_cma_stop,              /* 0x0E */
     &_sys_fbf_cma_check,             /* 0x0F */
+#else
+    &_sys_ukn,                       /* 0x0A */
+    &_sys_ukn,                       /* 0x0B */
+    &_sys_ukn,                       /* 0x0C */
+    &_sys_ukn,                       /* 0x0D */
+    &_sys_ukn,                       /* 0x0E */
+    &_sys_ukn,                       /* 0x0F */
+#endif
 
     &_sys_applications_status,       /* 0x10 */
@@ -235,4 +245,5 @@
     &_sys_ukn,                       /* 0x2F */
 
+#if NB_NIC_CHANNELS
     &_sys_nic_alloc,                 /* 0x30 */
     &_sys_nic_start,                 /* 0x31 */
@@ -241,4 +252,13 @@
     &_sys_nic_stats,                 /* 0x34 */
     &_sys_nic_clear,                 /* 0x35 */ 
+#else
+    &_sys_ukn,                       /* 0x30 */
+    &_sys_ukn,                       /* 0x31 */
+    &_sys_ukn,                       /* 0x32 */
+    &_sys_ukn,                       /* 0x33 */
+    &_sys_ukn,                       /* 0x34 */
+    &_sys_ukn,                       /* 0x35 */
+#endif
+
     &_sys_tty_write,                 /* 0x36 */
     &_sys_tty_read,                  /* 0x37 */
@@ -1540,9 +1560,8 @@
 int _sys_tty_alloc( unsigned int shared )
 {
-    unsigned int channel;    // allocated TTY channel
-
-    // get trdid and vsid for the calling thread
+    unsigned int channel = 0;    // allocated TTY channel
+
+    // get vsid for the calling thread
     unsigned int vsid  = _get_context_slot( CTX_VSID_ID );
-    unsigned int trdid = _get_thread_trdid();
 
     mapping_header_t  *header   = (mapping_header_t *)SEG_BOOT_MAPPING_BASE;
@@ -1555,4 +1574,8 @@
     else           users = 1;
 
+#if NB_TTY_CHANNELS > 1
+    // get trdid for the calling thread
+    unsigned int trdid = _get_thread_trdid();
+
     // get a TTY channel 
     for ( channel = 0 ; channel < NB_TTY_CHANNELS ; channel++ )
@@ -1562,5 +1585,5 @@
         if ( _atomic_test_and_set( palloc , users ) == 0 ) break;
     }
-    if ( channel >= NB_TTY_CHANNELS )
+    if ( ( channel >= NB_TTY_CHANNELS ) )
     {
         _printf("\n[GIET_ERROR] in _sys_tty_alloc() : "
@@ -1582,4 +1605,11 @@
     unsigned int p      = procid & ((1<<P_WIDTH)-1);
     _tty_channel_wti[channel] = x<<24 | y<<16 | p<<8 | wti_id;
+
+#else
+
+    unsigned int* palloc  = &_tty_channel_alloc[0];
+    _atomic_increment( palloc, users );
+
+#endif
    
     // update CTX_TTY_ID 
@@ -1905,5 +1935,5 @@
 #define NIC_CONTAINER_SIZE 4096
 
-#if NB_NIC_CHANNELS
+#if NB_NIC_CHANNELS && NB_CMA_CHANNELS
 
 ////////////////////////////////////////
@@ -2684,5 +2714,5 @@
 }  // end _sys_nic_stats()
 
-#endif
+#endif // if NB_NIC_CHANNELS && NB_CMA_CHANNELS
 
 /////////////////////////////////////////////////////////////////////////////////////////
@@ -2817,4 +2847,6 @@
 }
 
+#if NB_CMA_CHANNELS
+
 ////////////////////////////////////////////
 int _sys_fbf_cma_alloc( unsigned int nbufs )
@@ -3294,4 +3326,6 @@
 
 } // end _sys_fbf_cma_stop()
+
+#endif // if NB_CMA_CHANNELS
 
 
