RTEMS shell and telnetd

Christian Mauderer list+rtems at c-mauderer.de
Thu May 29 18:17:27 UTC 2014


Am 28.05.2014 17:13, schrieb Gedare Bloom:
> On Wed, May 28, 2014 at 11:04 AM, Peter Dufault <dufault at hda.com> wrote:
>> I'm figuring out how we're supposed to hook telnetd and RTEMS shell together in the git head and I don't understand the intent.  I used to do it like this:
>>
>> static void sh_wrap(char *unused_dev, void *arg)
>> {
>>     rtems_shell_env_t my_env = rtems_global_shell_env;
>>     my_env.forever = false;
>>     (void)rtems_shell_main_loop( &my_env );
>> }
>>
>> rtems_telnetd_config_table rtems_telnetd_config = {
>>     sh_wrap,                /* Command */
>>     NULL,                   /* Argument */
>>     0,                      /* Priority */
>>     20 * RTEMS_MINIMUM_STACK_SIZE, /* task stack size */
>>     0,                      /* Login check */
>>     0                       /* Keep stdio of the caller  */
>> };
>>
>> and later call:
>>
>>     rtems_telnetd_initialize();
>>
>> "rtems_global_shell_env" is no longer global.  "rtems_shell_init_env()" which would initialize a rtems_shell_env_t is not global.  "rtems_shell_get_current_env()" won't work outside of a shell context.  Passing 0 to rtems_shell_main_loop(0) will get the default settings for the shell env, so forever will be set true and I won't be able to exit the session.
>>
>> Am I missing something or is the intention I set up a "my_env" myself?  rtems_shell_env_t is still global.
>>
> This appears to be a side-effect of
> http://git.rtems.org/rtems/commit/?id=6cd4a5ca2e2211c4008d99fc272412c9b03c86ce
> 
> I'm not sure about the intent. Perhaps someone at Embedded Brains may comment.
> Gedare
> 

This patch allows the code to be used with SMP.

See http://www.rtems.org/wiki/index.php/SMP#Task_Variables

Kind Regards

Christian Mauderer
-- 
--------------------------------------------
embedded brains GmbH
Christian Mauderer
Dornierstr. 4
D-82178 Puchheim
Germany
email: christian.mauderer at embedded-brains.de
Phone: +49-89-18 94 741 - 18
Fax:   +49-89-18 94 741 - 08
PGP: Public key available on request.

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



More information about the users mailing list