Discussion:
RTEMS shell, classic API required?
Hoefle Marco
2014-10-02 08:05:56 UTC
Permalink
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
Sebastian Huber
2014-10-02 08:09:34 UTC
Permalink
Post by Hoefle Marco
=========================
starting shell
=========================
pthread_setspecific(shell_current_env_key)
sc: 0, errno: Success
You should read the release notes. A lot changed between the RTEMS 4.10
release and the current Git master.

For the RTEMS shell you have to configure some POSIX keys. For an easy start use:

#define CONFIGURE_UNIFIED_WORK_AREAS
#define CONFIGURE_UNLIMITED_OBJECTS
--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail : sebastian.huber-L1vi/***@public.gmane.org
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Hoefle Marco
2014-10-02 08:44:00 UTC
Permalink
Hello Sebastian,
that did the trick, thanks. RTEMS shell is now working.
Getcwd seems also not to work there. We investigate this further.
Marco


-----Original Message-----
From: Sebastian Huber [mailto:sebastian.huber-L1vi/***@public.gmane.org]
Sent: Donnerstag, 2. Oktober 2014 10:10
To: Hoefle Marco; rtems-users-***@public.gmane.org
Subject: Re: RTEMS shell, classic API required?
Post by Hoefle Marco
=========================
starting shell
=========================
pthread_setspecific(shell_current_env_key)
sc: 0, errno: Success
You should read the release notes. A lot changed between the RTEMS 4.10
release and the current Git master.

For the RTEMS shell you have to configure some POSIX keys. For an easy start use:

#define CONFIGURE_UNIFIED_WORK_AREAS
#define CONFIGURE_UNLIMITED_OBJECTS
--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail : sebastian.huber-L1vi/***@public.gmane.org
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Loading...