Index: /soft/giet_vm/applications/mjpeg/mjpeg.c
===================================================================
--- /soft/giet_vm/applications/mjpeg/mjpeg.c	(revision 781)
+++ /soft/giet_vm/applications/mjpeg/mjpeg.c	(revision 782)
@@ -26,4 +26,5 @@
 #include <malloc.h>
 #include <stdlib.h>
+#include <string.h>
 #include "mjpeg.h"
 #include <mapping_info.h>     // for coprocessor types and modes
Index: /soft/giet_vm/applications/shell/shell.c
===================================================================
--- /soft/giet_vm/applications/shell/shell.c	(revision 781)
+++ /soft/giet_vm/applications/shell/shell.c	(revision 782)
@@ -1,8 +1,8 @@
 ///////////////////////////////////////////////////////////////////////////////////////
-// File   : shell.c   
-// Date   : july 2015
-// author : ClÃ©ment GuÃ©rin
+// File    : shell.c   
+// Date    : july 2015
+// authors : ClÃ©ment GuÃ©rin and Alain Greiner
 ///////////////////////////////////////////////////////////////////////////////////////
-// Simple shell for GIET_VM.
+// Simple shell for the GIET_VM.
 ///////////////////////////////////////////////////////////////////////////////////////
 
@@ -10,7 +10,9 @@
 #include "stdlib.h"
 #include "malloc.h"
+#include "string.h"
 
 #define BUF_SIZE    (256)        // buffer for one command
 #define MAX_ARGS    (32)         // max number of arguments in a command
+#define FIFO_SIZE   (1024)       // FIFO depth for recursive ls
 
 
@@ -47,24 +49,39 @@
 }
 
+
 /////////////////////////////////////////
 static void cmd_ls(int argc, char** argv)
 {
-    int            fd;
-    int            rec;
-    char*          pathname;
-    fat_dirent_t   entry;
-
+    fat_dirent_t    entry;
+    unsigned int    recursive;
+    char*           paths[FIFO_SIZE];
+    unsigned int    ptr = 0;
+    unsigned int    ptw = 0;
+
+    // analyse arguments
     if (argc == 2)
     {
-        rec = 0;
-        pathname = argv[1];
+        // allocate a buffer for root directory
+        // pathname, and push it in FIFO
+        paths[ptw] = malloc( strlen(argv[1]) );
+        strcpy( paths[ptw] , argv[1] );
+
+giet_tty_printf("\n@@@ arg = %s / path = %s\n", argv[1] , paths[ptw] );
+
+        ptw = (ptw + 1) % FIFO_SIZE;
+
+        // not recursive 
+        recursive = 0;
     }
     else if ( (argc == 3) && (strcmp( argv[1] , "-r" ) == 0) )
     {
-        rec = 1;
-        pathname = argv[2];
-
-        giet_tty_printf("  error : recursive mode not supported yet\n");
-        return;
+        // allocate a buffer for root directory
+        // pathname, and push it in FIFO
+        paths[ptw] = malloc( strlen(argv[2]) );
+        strcpy( paths[ptw] , argv[2] );
+        ptw = (ptw + 1) % FIFO_SIZE;
+
+        // recursive 
+        recursive = 1;
     }
     else
@@ -74,23 +91,65 @@
     }
 
-    fd  = giet_fat_opendir( pathname );
-
-    if (fd < 0)
-    {
-        giet_tty_printf("  error : cannot open %s / err = %d)\n", argv[1], fd);
-        return;
-    }
-
-    while (giet_fat_readdir(fd, &entry) == 0)
-    {
-        if (entry.is_dir) giet_tty_printf("dir ");
-        else              giet_tty_printf("file");
-
-        giet_tty_printf(" | size = %d \t| cluster = %x \t| %s\n",
-                        entry.size, entry.cluster, entry.name );
-    }
-
-    giet_fat_closedir(fd);
-}
+    // loop on registered directories 
+    do
+    {
+        // open directory
+        int fd  = giet_fat_opendir( paths[ptr] );
+        if (fd < 0)
+        {
+            giet_tty_printf("  error : cannot open %s\n", paths[ptr] );
+            return;
+        }
+
+        // display directory pathname
+        giet_tty_printf("*** %s ***\n", paths[ptr] );
+
+        // loop on directory entries
+        while (giet_fat_readdir(fd, &entry) == 0)
+        {
+            // display entry
+            if ( entry.is_dir ) giet_tty_printf("dir ");
+            else                giet_tty_printf("file");
+            giet_tty_printf(" | size = %d \t| cluster = %x \t| %s\n",
+                            entry.size, entry.cluster, entry.name );
+
+            // allocate a buffer for subdirectory pathname
+            // and push it in FIFO if required
+            if ( entry.is_dir && recursive && 
+                 ( strcmp( entry.name , "." ) != 0 ) && 
+                 ( strcmp( entry.name , ".." ) != 0 ) )
+            {
+                // check FIFO full
+                if ( ((ptr - ptw) % FIFO_SIZE) == 1 )
+                {
+                    giet_tty_printf("   sorry, not enough memory for recursive ls\n");
+                    return;
+                }
+
+                unsigned int length = strlen(paths[ptr]) + strlen(entry.name) + 2;
+                paths[ptw] = malloc( length );
+                if ( strcmp( paths[ptr] , "/" ) == 0 )
+                {
+                    snprintf( paths[ptw] , length , "/%s" , entry.name );
+                }
+                else
+                {
+                    snprintf( paths[ptw] , length , "%s/%s" , paths[ptr] , entry.name );
+                }
+                ptw = (ptw + 1) % FIFO_SIZE;   
+            }
+        }  // end loop on entries
+
+        // close directory
+        giet_fat_closedir(fd);
+
+        // release the directory pathname buffer
+        // and pop it from FIFO
+        free( paths[ptr] );
+        ptr = (ptr + 1) % FIFO_SIZE;
+
+    } while ( ptr != ptw );
+
+}  // end cmd_ls()
 
 ////////////////////////////////////////////
@@ -504,4 +563,11 @@
     giet_tty_alloc( 0 );
     giet_tty_printf( "~~~ shell ~~~\n\n" );
+
+    // heap initialisation
+    unsigned int x_id;                          // x cluster coordinate
+    unsigned int y_id;                          // y cluster coordinate
+    unsigned int p_id;                          // local processor index
+    giet_proc_xyp( &x_id , &y_id , &p_id );
+    heap_init( x_id , y_id );
 
     // display first prompt
Index: /soft/giet_vm/applications/shell/shell.py
===================================================================
--- /soft/giet_vm/applications/shell/shell.py	(revision 781)
+++ /soft/giet_vm/applications/shell/shell.py	(revision 782)
@@ -32,5 +32,5 @@
 
     heap_base  = 0x60000000 
-    heap_size  = 0x00001000     # 4 Kbytes 
+    heap_size  = 0x00040000     # 256 Kbytes 
 
     mmap_base  = 0x70000000
@@ -57,5 +57,5 @@
                      local = False, big = True )
 
-    # heap vseg (unused)            
+    # heap vseg             
     mapping.addVseg( vspace, 'shell_heap', heap_base, heap_size,
                      'C_WU', vtype = 'BUFFER', x = xmap , y = ymap , pseg = 'RAM',
Index: /soft/giet_vm/applications/transpose/transpose.c
===================================================================
--- /soft/giet_vm/applications/transpose/transpose.c	(revision 781)
+++ /soft/giet_vm/applications/transpose/transpose.c	(revision 782)
@@ -39,4 +39,5 @@
 #include "stdio.h"
 #include "stdlib.h"
+#include "string.h"
 #include "user_barrier.h"
 #include "malloc.h"
