Пример #1
0
/*
 * DESCRIPTION: Init task for any MicroWindows/RTEMS application.
 */
void *POSIX_Init( void *argument )
{
  size_t st = 0;

#ifdef USE_REMOTE_GDB__
  init_remote_gdb();
/*  BREAKPOINT(); */
#endif

  DPRINTF( "\nStarting RTEMS init task...\n" );

#ifndef NONETWORK
  /* Make all network initialization */
  rtems_bsdnet_initialize_network();
  DPRINTF( "Netowrk Initialization is complete.\n\n" );
#endif

  st = _Thread_Executing->Start.Initial_stack.size;
  DPRINTF( "Init Task Stack Size is: %d\n", st );

  rtems_main( cc_argc, cc_argv );
  DPRINTF( "*** Done ***\n\n\n" );
  pthread_exit( NULL );
  return NULL; /* just so the compiler thinks we returned something */
}
Пример #2
0
/*
 * DESCRIPTION: Init task for any Microwindows/RTEMS application.
 */
void *POSIX_Init( void *argument )
{
  #define ARGV_LIMIT 32
  #define LINE_LIMIT 128
  int     sc;
  int     mainArgc;
  char   *mainArgv[ARGV_LIMIT];
  char    Line[LINE_LIMIT];

  DPRINTF( "\nStarting RTEMS init task...\n" );

  DPRINTF( "" );
  DPRINTF("Loading filesystem image\n");
  (void) Untar_FromMemory( (char *)FilesystemImage, FilesystemImage_size );

  #if !defined(NONETWORK)
    /* Make all network initialization */
    rtems_bsdnet_initialize_network();
    DPRINTF( "Network Initialization is complete.\n\n" );
  #endif

  setenv( "HOME", "/", 1 );
  setenv( "T1LIB_CONFIG", "/fonts/t1lib/t1lib.config", 1 );
  
  /*
   *  Clear argv pointer array
   */
  for ( mainArgc=0 ; mainArgc<ARGV_LIMIT ; mainArgc++ )
    mainArgv[mainArgc] = NULL;

  strcpy( Line, "RTEMS " );

  #if 0 /* defined(WITH_ARGS) */
    DPRINTF("With arguments\n" );
    {
      char   *p;

      DPRINTF("Enter arguments> " );
      p = fgets( &Line[6], LINE_LIMIT - 6, stdin );
      if ( !p ) {
        DPRINTF("error reading arguments\n" );
        exit(0);
      }
    }
  #else
    DPRINTF("Without arguments\n" );
  #endif

  /*
   *  Break into arguments
   */
  sc = rtems_shell_make_args( Line, &mainArgc, mainArgv, ARGV_LIMIT - 1 );
  if ( sc ) {
    DPRINTF("Error parsing arguments\n" );
    exit(0);
  }

  rtems_main( mainArgc, mainArgv );

  DPRINTF( "*** Done ***\n\n\n" );
  pthread_exit( NULL );
  return NULL; /* just so the compiler thinks we returned something */
}