Index: trunk/libs/libalmosmkh/almosmkh.c
===================================================================
--- trunk/libs/libalmosmkh/almosmkh.c	(revision 623)
+++ trunk/libs/libalmosmkh/almosmkh.c	(revision 626)
@@ -199,4 +199,55 @@
 }  // end get_uint32()
 
+//////////////////////////////
+int get_string( char * string,
+                int    maxlen )
+{
+    int c;
+    int done   = 0;
+    int length = 0;
+
+    while( done == 0 )
+    {
+        // check buffer overflow
+        if( length >= maxlen-1 )
+        {
+            return -1;                      // return failure   
+        }
+
+        // read one character
+        c = getchar();
+
+        // analyse this character
+        if ( (c >= 0x20) && (c < 0x7F) )    // printable character
+        {
+            putchar( c );                   // echo
+            string[length] = (char)c;       // register character in string
+            length++;                       // update length
+        }
+        else if (c == 0x0A)                 // LF character marks end of string
+        {
+            done = 1;
+        }
+        else if ( (c == 0x7F) ||            // DEL character
+                  (c == 0x08) )             // BS  character 
+        {
+            if ( length > 0 ) 
+            {
+                length--;          
+                printf("\b \b");            // BS /  / BS 
+            }
+        }
+        else if ( c == 0 )                  // EOF character
+        {
+            return -1;                      // return failure
+        }
+    }
+
+    // set NUL character in string and return success
+    string[length] = 0;
+    return 0;
+
+}  // end get_string()
+
 
 ///////////////    non standard debug functions    //////////////////////////
@@ -298,4 +349,14 @@
 } 
 
+///////////////////////////////////////
+int display_fat( unsigned int  page_id,
+                 unsigned int  nb_entries )
+{
+    return hal_user_syscall( SYS_DISPLAY,
+                             DISPLAY_FAT,
+                             (reg_t)page_id,
+                             (reg_t)nb_entries, 0 );
+} 
+
 ///////////////////////////////
 int trace( unsigned int active,
@@ -313,58 +374,75 @@
 {
    char          cmd;
-   unsigned int  cxy;
-   unsigned int  lid;
-   unsigned int  txt;
-   unsigned int  pid;
-   unsigned int  trdid;
-   unsigned int  active;
 
    while( 1 )
    {
+        // display prompt
         printf("\n[idbg] cmd = ");
+
+        // get a one character command
         cmd = (char)getchar();
 
-        if( cmd == 'h' )
-        {
-            printf("h\n"
-                   "p : display on TXT0 process descriptors in cluster[cxy]\n"
-                   "s : display on TXT0 scheduler state for core[cxy,lid]\n"
-                   "v : display on TXT0 VMM state for process[cxy,pid]\n"
-                   "t : display on TXT0 process decriptors attached to TXT[tid]\n"
-                   "b : display on TXT0 busylocks taken by thread[pid,trdid]\n"
-                   "q : display on TXT0 DQDT state\n"
-                   "y : activate/desactivate trace for core[cxy,lid]\n"
-                   "x : force calling process to exit\n"
-                   "c : resume calling process execution\n"
-                   "h : list supported commands\n");
-        }
+        // display all busylocks owned by thread(pid,trdid)
+        if( cmd == 'b' )
+        {
+            printf("b / pid = ");
+            unsigned int pid = get_uint32();
+            printf(" / trdid = ");
+            unsigned int trdid = get_uint32();
+            display_busylocks( pid , trdid );
+        }
+        // return to calling process
+        else if( cmd == 'c' )
+        {
+            printf("c\n");
+            break;
+        }
+        // display FAT mapper(page,entries)
+        else if( cmd == 'f' )
+        {
+            printf("f / page = ");
+            unsigned int page = get_uint32();
+            printf(" / entries = ");
+            unsigned int entries = get_uint32();
+            display_fat( page , entries );
+        }
+        // list all supported commands
+        else if( cmd == 'h' )
+        {
+            printf("h\n" 
+                   "- b : display on TXT0 busylocks taken by thread[pid,trdid]\n"
+                   "- c : resume calling process execution\n"
+                   "- f : display on TXT0 FAT mapper[page,entries]\n"
+                   "- h : list of supported commands\n"
+                   "- m : display on TXT0 mapper[path,page,nbytes]\n"
+                   "- p : display on TXT0 process descriptors in cluster[cxy]\n"
+                   "- q : display on TXT0 DQDT state\n"
+                   "- s : display on TXT0 scheduler state for core[cxy,lid]\n"
+                   "- t : display on TXT0 process decriptors attached to TXT[tid]\n"
+                   "- v : display on TXT0 VMM state for process[cxy,pid]\n"
+                   "- x : force calling process to exit\n"
+                   "- y : activate/desactivate trace for core[cxy,lid]\n"
+                   );
+        }
+        // display MAPPER(path,page,nbytes)
+        else if( cmd == 'm' )
+        {
+            char  path[128];
+            printf("m / path = ");
+            int error = get_string( path , 128 );
+            printf(" / page = ");
+            unsigned int page = get_uint32();
+            printf(" / nbytes = ");
+            unsigned int nbytes = get_uint32();
+            if( error == 0 ) display_mapper( path , page , nbytes );
+        }
+        // display all processes in cluster(cxy)
         else if( cmd == 'p' )
         {
             printf("p / cxy = ");
-            cxy = get_uint32();
+            unsigned int cxy = get_uint32();
             display_cluster_processes( cxy , 0 );
         }
-        else if( cmd == 's' )
-        {
-            printf("s / cxy = ");
-            cxy = get_uint32();
-            printf(" / lid = ");
-            lid = get_uint32();
-            display_sched( cxy , lid );
-        }
-        else if( cmd == 'v' )
-        {
-            printf("v / cxy = ");
-            cxy = get_uint32();
-            printf(" / pid = ");
-            pid = get_uint32();
-            display_vmm( cxy , pid );
-        }
-        else if( cmd == 't' )
-        {
-            printf("t / txt_id = ");
-            txt = get_uint32();
-            display_txt_processes( txt );
-        }
+        // display DQDT
         else if( cmd == 'q' )
         {
@@ -372,22 +450,30 @@
             display_dqdt();
         }
-        else if( cmd == 'y' )
-        {
-            printf("y / active = ");
-            active = get_uint32();
-            printf(" / cxy = ");
-            cxy    = get_uint32();
+        // display scheduler state for core(cxy,lid)
+        else if( cmd == 's' )
+        {
+            printf("s / cxy = ");
+            unsigned int cxy = get_uint32();
             printf(" / lid = ");
-            lid    = get_uint32();
-            trace( active , cxy , lid );
-        }
-        else if( cmd == 'b' )
-        {
-            printf("b / pid = ");
-            pid = get_uint32();
-            printf(" / trdid = ");
-            trdid = get_uint32();
-            display_busylocks( pid , trdid );
-        }
+            unsigned int lid = get_uint32();
+            display_sched( cxy , lid );
+        }
+        // display all processes attached to TXT(txt_id)
+        else if( cmd == 't' )
+        {
+            printf("t / txt_id = ");
+            unsigned int txt_id = get_uint32();
+            display_txt_processes( txt_id );
+        }
+        // display vmm state for process(cxy, pid)
+        else if( cmd == 'v' )
+        {
+            printf("v / cxy = ");
+            unsigned int cxy = get_uint32();
+            printf(" / pid = ");
+            unsigned int pid = get_uint32();
+            display_vmm( cxy , pid );
+        }
+        // force the calling process to exit
         else if( cmd == 'x' )
         {
@@ -395,10 +481,16 @@
             exit( 0 );
         }
-        else if( cmd == 'c' )
-        {
-            printf("c\n");
-            break;
-        }
-    }
+        // activate scheduler trace for core(cxy,lid)
+        else if( cmd == 'y' )
+        {
+            printf("y / active = ");
+            unsigned int active = get_uint32();
+            printf(" / cxy = ");
+            unsigned int cxy    = get_uint32();
+            printf(" / lid = ");
+            unsigned int lid    = get_uint32();
+            trace( active , cxy , lid );
+        }
+    }  // en while
 }  // end idbg()
 
