Exemplo n.º 1
0
int main( void )
{
  FILE* fp;

  // Initialize platform first
  if( platform_init() != PLATFORM_OK )
  {
    // This should never happen
    while( 1 );
  }

  // Initialize device manager
  dm_init();

  // Register the ROM filesystem
  dm_register( romfs_init() );

  // Register the MMC filesystem
  dm_register( mmcfs_init() );

  // Register the remote filesystem
  dm_register( remotefs_init() );

  // Autorun: if "autorun.lua" is found in the file system, run it first
  if( ( fp = fopen( FS_AUTORUN, "r" ) ) != NULL )
  {
    fclose( fp );
    char* lua_argv[] = { "lua", FS_AUTORUN, NULL };
    lua_main( 2, lua_argv );
  }
  
#ifdef ELUA_BOOT_RPC
  boot_rpc();
#else
  
  // Run the shell
  if( shell_init() == 0 )
  {
    printf( "Unable to initialize the eLua shell!\n" );
    // Start Lua directly
    char* lua_argv[] = { "lua", NULL };
    lua_main( 1, lua_argv );
  }
  else
    shell_start();
#endif // #ifdef ELUA_BOOT_RPC

#ifdef ELUA_SIMULATOR
  hostif_exit(0);
  return 0;
#else
  while( 1 );
#endif
}
Exemplo n.º 2
0
Arquivo: main.c Projeto: fjrti/remix
int main( void )
{
    int i;
    FILE* fp;

    // Initialize platform first
    if( platform_init() != PLATFORM_OK )
    {
        // This should never happen
        while( 1 );
    }

    // Initialize device manager
    dm_init();

    // Register the ROM filesystem
    dm_register( romfs_init() );

    // Register the MMC filesystem
    dm_register( mmcfs_init() );

    // Register the Semihosting filesystem
    dm_register( semifs_init() );

    // Search for autorun files in the defined order and execute the 1st if found
    for( i = 0; i < sizeof( boot_order ) / sizeof( *boot_order ); i++ )
    {
        if( ( fp = fopen( boot_order[ i ], "r" ) ) != NULL )
        {
            fclose( fp );
            char* picoc_argv[] = { "picoc", boot_order[i], NULL };
            picoc_main( 2, picoc_argv );
            break; // autoruns only the first found
        }
    }

    // Run the shell
    if( shell_init() == 0 )
    {
        // Start picoc directly
        char* picoc_argv[] = { "picoc", NULL };
        picoc_main( 1, picoc_argv );
    }
    else
        shell_start();

    while( 1 );
}
Exemplo n.º 3
0
int main( void )
{
  int i;
  FILE* fp;

  // Initialize platform first
  if( platform_init() != PLATFORM_OK )
  {
    // This should never happen
    while( 1 );
  }

  // Initialize device manager
  dm_init();

  // Register the ROM filesystem
  romfs_init();

  // Register the MMC filesystem
  mmcfs_init();

  // Search for autorun files in the defined order and execute the 1st if found
  for( i = 0; i < sizeof( boot_order ) / sizeof( *boot_order ); i++ )
  {
    if( ( fp = fopen( boot_order[ i ], "r" ) ) != NULL )
    {
      fclose( fp );
      // The entry point for PicoLisp.
      char* picolisp_argv[] = { "picolisp", boot_order[i], NULL };

      picolisp_main( 2, picolisp_argv );
      break; // autoruns only the first found
    }
  }
  
  // Run the shell
  if( shell_init() == 0 )
  {
    char* picolisp_argv[] = { "picolisp", NULL };
    picolisp_main( 1, picolisp_argv );
  }
  else
  {
    shell_start();
  }

  while( 1 );
}
Exemplo n.º 4
0
int main( void )
{
  int i;
  FILE* fp;

  // Initialize platform first
  if( platform_init() != PLATFORM_OK )
  {
    // This should never happen
    while( 1 );
  }

  // Initialize device manager
  dm_init();

  // Register the ROM filesystem
  romfs_init();

  // Register the MMC filesystem
  mmcfs_init();

  // Register the Semihosting filesystem
  semifs_init();

  // Register the remote filesystem
  remotefs_init();

  // Register NIFFS
  nffs_init();

  // Search for autorun files in the defined order and execute the 1st if found
  for( i = 0; i < sizeof( boot_order ) / sizeof( *boot_order ); i++ )
  {
    if( ( fp = fopen( boot_order[ i ], "r" ) ) != NULL )
    {
      fclose( fp );
      char* lua_argv[] = { (char *)"lua", (char *)boot_order[i], NULL };
      lua_main( 2, lua_argv );
      break; // autoruns only the first found
    }
  }

#ifdef ELUA_BOOT_RPC
  boot_rpc();
#else
  
  // Run the shell
  if( shell_init() == 0 )
  {
    // Start Lua directly
    char* lua_argv[] = { (char *)"lua", NULL };
    lua_main( 1, lua_argv );
  }
  else
    shell_start();
#endif // #ifdef ELUA_BOOT_RPC

#ifdef ELUA_SIMULATOR
  hostif_exit(0);
  return 0;
#else
  while( 1 );
#endif
}