Index: trunk/kernel/devices/dev_txt.c
===================================================================
--- trunk/kernel/devices/dev_txt.c	(revision 101)
+++ trunk/kernel/devices/dev_txt.c	(revision 188)
@@ -38,27 +38,27 @@
 extern chdev_directory_t  chdev_dir;         // allocated in kernel_init.c
 
-extern chdev_pic_input_t  chdev_pic_input;   // allocated in kernel_init.c
+//////////////////////////////////
+void dev_txt_init( chdev_t * txt )
+{
+    // For all TXT channels other than the TXT0 (kernel terminal), 
+    // the PIC chdev must be initialized before the TXT chdev, because
+    // the TXT chdev initialization requires the routing of an external IRQ
 
-////////////////////////////////////
-void dev_txt_init( chdev_t * chdev )
-{
-    // the local ICU chdev must be initialized before the TXT chdev, because
-    // the TXT chdev initialization requires allocation of a WTI from local ICU
-    xptr_t  icu_xp  = chdev_dir.icu[local_cxy];
-    assert( (icu_xp != XPTR_NULL) , __FUNCTION__ , "ICU not initialised before TXT" );
+    xptr_t    pic_xp  = chdev_dir.pic;
+    uint32_t  channel = txt->channel;
+    uint32_t  impl    = txt->impl;
 
-    // get implementation and channel index
-    uint32_t  impl    = chdev->impl;
-    uint32_t  channel = chdev->channel;
+    assert( (pic_xp != XPTR_NULL) || (channel == 0) , __FUNCTION__ , 
+            "PIC not initialised before TXT" );
 
     // set chdev name
-    snprintf( chdev->name , 16 , "txt_%d" , chdev->channel );
+    snprintf( txt->name , 16 , "txt_%d" , channel );
 
     // set fields "cmd", "isr", and call driver init function
     if( impl == IMPL_TXT_TTY )
     {
-        chdev->cmd = &soclib_tty_cmd;
-        chdev->isr = &soclib_tty_isr;
-        soclib_tty_init( chdev );
+        txt->cmd = &soclib_tty_cmd;
+        txt->isr = &soclib_tty_isr;
+        soclib_tty_init( txt );
     }
     else
@@ -67,35 +67,34 @@
     }
 
-    // get a WTI mailbox from local ICU
-    uint32_t wti_id = dev_icu_wti_alloc();
+    // no server thread and no IRQ routing for TXT0
+    if( channel != 0 )
+    {
+        // select a core to execute the TXT server thread
+        lid_t lid = cluster_select_local_core();
 
-    assert( (wti_id != -1) , __FUNCTION__ , "cannot allocate WTI mailbox" );
+        // bind TXT IRQ to the selected core
+        dev_pic_bind_irq( lid , txt );
 
-    // select a core
-    lid_t lid = cluster_select_local_core();
+        // enable TXT IRQ
+        dev_pic_enable_irq( lid , txt );
 
-    // enable WTI IRQ and update WTI interrupt vector
-    dev_icu_enable_irq( lid , WTI_TYPE , wti_id , chdev );
+        // create server thread
+        thread_t * new_thread;
+        error_t    error;
 
-    // link IOC IRQ to WTI mailbox in PIC component
-    uint32_t irq_id = chdev_pic_input.txt[channel];
-    dev_pic_bind_irq( irq_id , local_cxy , wti_id );
+        error = thread_kernel_create( &new_thread,
+                                      THREAD_DEV,
+                                      &chdev_sequencial_server,
+                                      txt,
+                                      lid );
 
-    // create server thread
-    thread_t * new_thread;
-    error_t    error;
+        assert( (error == 0) , __FUNCTION__ , "cannot create server thread" );
 
-    error = thread_kernel_create( &new_thread,
-                                  THREAD_DEV,
-                                  &chdev_sequencial_server,
-                                  chdev,
-                                  lid );
-    assert( (error == 0) , __FUNCTION__ , "cannot create server thread" );
+        // set "server" field in chdev descriptor
+        txt->server = new_thread;
 
-    // set "server" field in chdev descriptor
-    chdev->server = new_thread;
-
-    // start server thread
-    thread_unblock( XPTR( local_cxy , new_thread ) , THREAD_BLOCKED_GLOBAL );
+        // start server thread
+        thread_unblock( XPTR( local_cxy , new_thread ) , THREAD_BLOCKED_GLOBAL );
+    }
 }
 
