Index: /soft/giet_vm/applications/shell/shell.c
===================================================================
--- /soft/giet_vm/applications/shell/shell.c	(revision 746)
+++ /soft/giet_vm/applications/shell/shell.c	(revision 747)
@@ -11,6 +11,6 @@
 #include "malloc.h"
 
-#define BUF_SIZE    (256)
-#define MAX_ARGS    (32)
+#define BUF_SIZE    (256)        // buffer for one command
+#define MAX_ARGS    (32)         // max number of arguments in a command
 
 
@@ -69,10 +69,8 @@
     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",
+        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 );
     }
@@ -307,22 +305,84 @@
 }
 
+/////////////////////////////////////////////
+static void cmd_cat(int argc, char** argv)
+{
+    if (argc < 2)
+    {
+        giet_tty_printf("  usage : %s <path_name> \n", argv[0] );
+        return;
+    }
+
+    unsigned int     x,y,p;   // processor coordinates
+    unsigned int     fd;             // file descriptor
+    fat_file_info_t  info;           // file info
+    unsigned int     size;           // buffer size (file_size + 1)
+    unsigned int     len;            // number of read bytes from file
+    char*            buf;            // temporary buffer
+
+    // get processor coordinates 
+    giet_proc_xyp( &x , &y , &p );
+    
+    // open the file to display   
+    fd = giet_fat_open( argv[1] , O_RDONLY );
+    if (fd < 0)
+    {
+        giet_tty_printf("  error : cannot open %s\n", argv[1]);
+        goto exit;
+    }
+
+    // get file size
+    giet_fat_file_info( fd, &info );
+    if ( info.is_dir )
+    {
+        giet_tty_printf("  error : %s is a directory\n", argv[1] );
+        goto exit;
+    }
+    size = info.size;  
+
+    // allocate a temporary buffer for the file
+    heap_init( x , y );
+    buf = (char*)malloc( size );  
+    if( buf == NULL )
+    {
+        giet_tty_printf("  error : cannot allocate buffer with size = %d\n", size );
+        goto exit;
+    }
+    // load the file and set terminating '0' 
+    len = giet_fat_read( fd , buf , size );
+    if ( len != size )
+    {
+        giet_tty_printf("  error : cannot load file %s / size = %d / len = %d\n",
+                        argv[1] , size , len );
+        goto exit;
+    }
+    buf[size] = 0;
+
+    // display the file content
+    giet_tty_printf("\n%s", buf );
+
+exit:
+    if ( fd >= 0 )     giet_fat_close( fd );
+    if ( buf != NULL ) free( buf );
+}
 
 ////////////////////////////////////////////////////////////////////
 struct command_t cmd[] =
 {
+    { "cat",        "display file content",                 cmd_cat },
+    { "context",    "display a thread context",             cmd_context },
+    { "cp",         "replicate a file in file system",      cmd_cp },
+    { "exec",       "start an application",                 cmd_exec },
     { "help",       "list available commands",              cmd_help },
-    { "time",       "return current date",                  cmd_time },
+    { "kill",       "kill an application (all threads)",    cmd_kill },
     { "ls",         "list content of a directory",          cmd_ls },
     { "mkdir",      "create a new directory",               cmd_mkdir },
-    { "cp",         "replicate a file in file system",      cmd_cp },
+    { "mv",         "move a file in file system",           cmd_mv },
+    { "pause",      "pause a thread",                       cmd_pause },
+    { "ps",         "list all mapped applications status",  cmd_ps },
+    { "resume",     "resume a thread",                      cmd_resume },
     { "rm",         "remove a file from file system",       cmd_rm },
     { "rmdir",      "remove a directory from file system",  cmd_rmdir },
-    { "mv",         "move a file in file system",           cmd_mv },
-    { "exec",       "start an application",                 cmd_exec },
-    { "kill",       "kill an application (all threads)",    cmd_kill },
-    { "ps",         "list all mapped applications status",  cmd_ps },
-    { "pause",      "pause a thread",                       cmd_pause },
-    { "resume",     "resume a thread",                      cmd_resume },
-    { "context",    "display a thread context",             cmd_context },
+    { "time",       "return current date",                  cmd_time },
     { NULL,         NULL,                                   NULL }
 };
@@ -330,5 +390,7 @@
 // shell
 
-////////////////////////////
+///////////////////////////////////////////////////////////////////
+// This function analyses one command (with arguments)
+///////////////////////////////////////////////////////////////////
 static void parse(char *buf)
 {
@@ -405,5 +467,5 @@
         switch (c)
         {
-        case '\b':      // backspace
+        case '\b':                       // backspace
             if (count > 0)
             {
@@ -412,5 +474,5 @@
             }
             break;
-        case '\n':      // new line
+        case '\n':                       // new line
             giet_tty_printf("\n");
             if (count > 0)
@@ -422,13 +484,13 @@
             count = 0;
             break;
-        case '\t':      // tabulation
+        case '\t':                       // tabulation
             // do nothing
             break;
-        case '\03':     // ^C
+        case '\03':                      // ^C
             giet_tty_printf("^C\n");
             prompt();
             count = 0;
             break;
-        default:        // regular character
+        default:                         // regular character
             if (count < sizeof(buf) - 1)
             {
