termios problem

Andrew Maximov amaximus at mail.ru
Tue May 22 07:08:22 UTC 2001


There is some problems with termios. System hangs after I try
to output to console more than 64 characters. My configuration:
HARDWARE: MC68MH360
RTEMS: RTEMS-4.5.0
BSP: m68k
I wrote a simple test to demonstrate this problem.
Here is a output screen:
TERMIOS TEST STARTED.
hung after 5 seconds
hung after 4 seconds
hung after 3 seconds
hung after 2 seconds
hung after 1 seconds
t

and C source:

#define CONFIGURE_INIT
#include <rtems.h>
#include <stdio.h>
#include <bsp.h>

static
void (*test_func_ptr)();

static
void test_3()
{
 printf("you should not see this.\n");
}

static
void test_2()
{
 printf("this is first loooong string !!!!!!!!!!!!!!!\n");
 printf("this is second loooong string !!!!!!!!!!!!!!!!!!!\n");
 test_func_ptr = test_3;
}

static
void test_1()
{
 static int live_period = 5;
 printf("hung after %d seconds\n",live_period--);
 if ( live_period == 0 ) test_func_ptr = test_2;
}

rtems_timer_service_routine
test_timer_proc( rtems_id timer_id, void *unused )
{
 test_func_ptr();
 rtems_timer_reset( timer_id );
}


rtems_task Init(
 rtems_task_argument argument
)
{
 rtems_status_code status;
 rtems_name name;
 rtems_interval ticks_per_second;
 rtems_id test_timer;

 printf("\nTERMIOS TEST STARTED.\n");

 rtems_clock_get( RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticks_per_second );

 name = rtems_build_name( 'T', 'E', 'S', 'T' );
 status = rtems_timer_create( name, &test_timer );
 if ( status != RTEMS_SUCCESSFUL ) rtems_fatal_error_occurred( status );
 test_func_ptr = test_1;
 status = rtems_timer_fire_after( test_timer,
          ticks_per_second,
          test_timer_proc,
          NULL);

 rtems_task_suspend( RTEMS_SELF );
 exit(0);
}

/* configuration information */

#define CONFIGURE_MAXIMUM_TASKS               32
#define CONFIGURE_MAXIMUM_PERIODS             1
#define CONFIGURE_MAXIMUM_SEMAPHORES       32
#define CONFIGURE_MAXIMUM_TIMERS     32

#define CONFIGURE_INIT_TASK_PRIORITY          1
#define CONFIGURE_INIT_TASK_INITIAL_MODES     ( RTEMS_PREEMPT |
RTEMS_TIMESLICE | RTEMS_ASR | RTEMS_INTERRUPT_LEVEL(0) )
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE

#define STACK_CHECKER_ON

#define CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER

rtems_driver_address_table Device_drivers[] = {
#ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
  CONSOLE_DRIVER_TABLE_ENTRY,
#endif
#ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
  CLOCK_DRIVER_TABLE_ENTRY,
#endif
#ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER
  STUB_DRIVER_TABLE_ENTRY,
#endif
  {NULL, NULL, NULL, NULL, NULL, NULL}
};


#include <confdefs.h>






More information about the users mailing list