sparc-rtems-run program args

Chris Johns chrisj at rtems.org
Wed Sep 21 22:51:15 UTC 2016


On 21/09/2016 21:33, Saeed Ehteshamifar wrote:
> Hello,
>
> In the help of sparc-rtems4.1X-run is written:
>
> Usage: sparc-rtems4.12-run [options] program [program args]
>
> program args    Arguments to pass to simulated program.
>                  Note: Very few simulators support this.
>
> I wrote a simple RTEMS program that prints the Init task argument as a
> string:
>
> #include <rtems.h>
> #include <stdio.h>
> rtems_task Init(
>    rtems_task_argument ignored
> )
> {
>    printf ("Salaaaaam!\n");
>    printf ("%s\n", ignored);
>    printf ("Khodafezzz!\n");
>    exit(0);
> }
>
> /* configuration information */
>
> #include <bsp.h>
>
> #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 4
> #define CONFIGURE_MAXIMUM_TASKS 1
> #define CONFIGURE_MINIMUM_TASK_STACK_SIZE (8U * 1024U)
> #define CONFIGURE_EXTRA_TASK_STACKS (8 * 1024)
>
> #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
> #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
> #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
>
> #define CONFIGURE_INIT
> #include <rtems/confdefs.h>
>
> However after running my program with:
> sparc-rtems4.12-run o-optimize/hello.exe "yoohoo"
>
> I see no output for the argument printf.

The sim support in GDB changed to a new frame work a few releases ago 
and things broke. I am not sure the SPARC sim support is fully up to 
date with those changes. I have looked into this problem before and I 
thought it was sorted but I am not sure if the changes are based on our 
local patches or upstream. A gdb version bump may have lost the changes 
if they are local. Joel and I have been working on the SPARC in the back 
ground and it needs some attention.

> Is there any format in passing 'program args' to sparc-rtems-run?

I do not believe there is support in the BSP to handle args being passed 
from the run command. If there was support it would be via a main call 
rather than the Init. I do not know of any Init task arg support exists 
in RTEMS.

Chris


More information about the users mailing list