Add a program in the shell command line in RTEMS-libbsd

Christian Mauderer christian.mauderer at embedded-brains.de
Fri Aug 5 05:25:50 UTC 2016


Am 03.08.2016 um 09:51 schrieb Babacar Diop:
> Dear devels,
> 
> 
> I might need your help regarding RTEMS-libbsd. I would like to add a
> program into the RTEMS shell command line in order to run it with some
> parameter.
> 
> In a first step, I created a file rtems-bsd-shell-/myprog./c into the
> rtemsbsd/rtems folder to create the command. I would like to know how to
> link the program to the command.
> 
> Any help could be great !
> 
> Kind Regards
> 
> 
> ------------------------------------------------------------------------------------------------------------------------
> 
> Babacar Diop
> 23 year
> Engineering student in Electronics and Computer Sciences of Embedded
> Systems
> 5th year

Hello Babacar,

basically shell commands can be added by providing a rtems_shell_cmd_t
variable. You have to add the variable to the
CONFIGURE_SHELL_USER_COMMANDS define of your application. You can take a
look at the "testsuite/netshell01/shellconfig.c" for an example for the
configuration.

If you need examples for commands just search for the rtems_shell_cmd_t
in the rtems repository or in the libbsd. I think the commands in rtems
are more useful if you want to write your own command from scratch. Most
commands in libbsd are ports of existing user space code from FreeBSD
and utilize workarounds to handle main(), global variables and resource
management.

If you intend to port a existing application from FreeBSD you should
take a look onto my recent work with pfctl. I also added a short how-to
guide into libbsd.txt. See:
https://git.rtems.org/rtems-libbsd/commit/?id=f71cbd02dc37d49b012a9f272c5a6057ad9bd99d

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 devel mailing list