Fw: rtems_task_create segmentation fault unix bsp

Pablo Casado pcasado at absamail.co.za
Sat Jul 31 16:19:46 UTC 2004


Hi,

Newbie question. This is a basic question but I could not find any help in
the FAQ, archives or docs.

I'm trying to create a task but getting a segmentation fault when calling
rtems_task_create function using the unix(posix) bsp. I'm sure I'm missing
the plot completely. Any hints to point me in the right direction would be
appreciated. Here's my dev environment followed by the source.

gcc 3.3.1
rtems 4.6.1
cygwin 1.5.9.1

Thanks
Pablo.

/*
 *  Simple test program -- simplified version of sample test hello.
 */

#include <bsp.h>
#include <stdio.h>

rtems_task Init( rtems_task_argument ignored)
{
  rtems_name        task_name;
  rtems_id          tid;
  rtems_status_code status;

  /* this function works fine */
  task_name = rtems_build_name( 'T', 'A', '1', ' ' );
  /* this one seg faults */
  status = rtems_task_create(
            task_name,
            1,
            RTEMS_MINIMUM_STACK_SIZE,
            RTEMS_INTERRUPT_LEVEL(0),
            RTEMS_DEFAULT_ATTRIBUTES,
            &tid );
  if (status != RTEMS_SUCCESSFUL)
  {
    printf("\nFailed to create task 1, error code: %d",status);
  }
  else
  {
   printf("\nSuccessfully created task 1, task id is: %d",tid);
  }
}

int main( int argc, char** argv )
{
  /* I have absolutely no idea if I should be calling the Init function here
   * or configuring it somewhere
   */
  Init(0);
  return 0;
}

/* configuration information */

//#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_TERMIOS_DISABLED
#define CONFIGURE_HAS_OWN_MOUNT_TABLE
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE

#define CONFIGURE_MAXIMUM_TASKS 2

//#define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE)

#define CONFIGURE_INIT

#include <confdefs.h>

rtems_filesystem_mount_table_t configuration_mount_table = {
  NULL,
  RTEMS_FILESYSTEM_BAD_OPTIONS,
  NULL,
  NULL
};

rtems_filesystem_mount_table_t *rtems_filesystem_mount_table =
&configuration_mount_table;
int rtems_filesystem_mount_table_size = 1;

/* end of file */





More information about the users mailing list