RTEMS shell, classic API required?

Hoefle Marco Marco.Hoefle at nanotronic.ch
Thu Oct 2 08:05:56 UTC 2014


Hello,

to debug the thread
http://lists.rtems.org/pipermail/users/2014-October/028232.html

I wanted to turn on the RTEMS shell to use cd, ls and pwd commands from
the shell to navigate through the filesystems.

We try now the mainline RTEMS4.11 Kernel on the latest commit.

BSP is Sparc, CPU is the GR712RC from Gaisler

The root filesystem is IMFS with two fatdisks mounted. The fatsdisks
cause then the problems as mentioned by Thomas.

 

So now to the RTEMs shell:

This code snippset is used to initialize and start the shell:

 

void start_shell(void)

{

      rtems_status_code sc = RTEMS_SUCCESSFUL;

      printf(" =========================\n");

      printf(" starting shell\n");

      printf(" =========================\n");

 

 

      sc = rtems_shell_init(

            "SHLL", /* task name */

            0, /* task stack size */

            100, /* task priority */

            "/dev/console", /* device name */

            true, /* run forever */

            true, /* wait for shell to terminate */

            NULL /* login check function,

            use NULL to disable a login check */

      );

 

      printf("sc: %d, errno: %s\n", sc, strerror(errno));

}

 

On the console we see:

=========================

 starting shell

 =========================

pthread_setspecific(shell_current_env_key)

sc: 0, errno: Success

 

 

Afterwards no prompt is displayed as in the Shell guide from here:

http://rtems.org/onlinedocs/doc-current/share/rtems/html/shell/Configura
tion-and-Initialization-rtems_005fshell_005finit-_002d-initialize-the-sh
ell.html#Configuration-and-Initialization-rtems_005fshell_005finit-_002d
-initialize-the-shell

 

The system is up and running. This is verified by a periodic task
printing messages on the console.

Does the rtems_shell_init function rely on the classic RTEMS API as we
use POSIX only?

This is the config:

 

#include <bsp.h>

 

 

/* RTEMS configuration */

#define CONFIGURE_INIT

#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER

#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER

//#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER

 

/**

 * Configure file system and libblock.

 */

#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM

#define CONFIGURE_APPLICATION_NEEDS_LIBBLOCK

#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS    32

#define CONFIGURE_FILESYSTEM_DOSFS

 

 

#define CONFIGURE_MAXIMUM_TASKS                             2

#define CONFIGURE_DISABLE_CLASSIS_API_NOTEPADS

#define CONFIGURE_EXTRA_TASK_STACKS                   (4 *
RTEMS_MINIMUM_STACK_SIZE)

 

void *POSIX_Init( void *argument );

#define CONFIGURE_POSIX_INIT_THREAD_TABLE

#define CONFIGURE_MAXIMUM_POSIX_THREADS                     8

 

#define CONFIGURE_MAXIMUM_DRIVERS                           8

#define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES                  10

#define CONFIGURE_MAXIMUM_POSIX_MUTEXES                     15

#define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES        10

 

#include <rtems/confdefs.h>

 

 

#define CONFIGURE_SHELL_COMMANDS_INIT

#define CONFIGURE_SHELL_COMMANDS_ALL

#include <rtems/shellconfig.h>

 

 

Thanks

Marco

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20141002/b8b634cd/attachment-0001.html>


More information about the users mailing list