rtems_task Init(rtems_task_argument argument) { rtems_status_code sc; sc = rtems_shell_init( "SHLL", RTEMS_MINIMUM_STACK_SIZE * 8, 1, /* We want it to work */ "/dev/console", false, false, NULL ); if(sc != RTEMS_SUCCESSFUL) printf("Unable to start shell (error code %d)\n", sc); /* FIXME: * alarm() should work anyway in gethostbyname().(for TIMEOUT in libcurl) * in the meantime we have a workaround, * make sure the gethostbyname() finished in 15 seconds */ _res.retry = 2; /* FIXME: can this be moved into the initialization table? */ memcard_register(); /*start_memcard();*/ mkdir("/ssd", 0777); mount("/dev/flash5", "/ssd", "yaffs", RTEMS_FILESYSTEM_READ_WRITE, ""); /* * Older versions of RTEMS-YAFFS created the file system with the * (persistent) root inode set to 0666. RTEMS didn't check permissions * at that time but does now, causing most operations to fail (EACCES) * on file systems created before the transition. * * The "chmod" below transparently updates the permission of /ssd files * systems. */ chmod("/ssd", YAFFS_ROOT_MODE); init_version(); load_usb_firmware(); init_videoinreconf(); sysconfig_load(); rtems_bsdnet_initialize_network(); rtems_initialize_ftpd(); rtems_telnetd_initialize(); curl_global_init(CURL_GLOBAL_ALL); sc = rtems_task_create(rtems_build_name('G', 'U', 'I', ' '), 9, 1024*1024, RTEMS_PREEMPT | RTEMS_NO_TIMESLICE | RTEMS_NO_ASR, 0, &gui_task_id); assert(sc == RTEMS_SUCCESSFUL); sc = rtems_task_start(gui_task_id, gui_task, 0); assert(sc == RTEMS_SUCCESSFUL); rtems_task_delete(RTEMS_SELF); }
static void test_main(void) { int rv; rtems_status_code sc; rv = rtems_initialize_ftpd(); assert(rv == 0); sc = rtems_shell_init("SHLL", 16 * 1024, 1, CONSOLE_DEVICE_NAME, false, true, NULL); assert(sc == RTEMS_SUCCESSFUL); exit(0); }
static void test(void) { int rv = 0; const char file_a [] = "/FTP/127.0.0.1/a.txt"; const char file_b [] = "/FTP/127.0.0.1/b.txt"; rv = rtems_bsdnet_initialize_network(); rtems_test_assert(rv == 0); rv = rtems_initialize_ftpd(); rtems_test_assert(rv == 0); initialize_ftpfs(); change_self_priority(); create_file(file_a, &content [0], sizeof(content)); copy_file(file_a, file_b); check_file(file_b); check_file_size(file_a, sizeof(content)); check_file_size(file_b, sizeof(content)); }
rtems_task Init( rtems_task_argument argument ) { rtems_status_code status; printf("\n\n*** OSMONWEB TEST ***\n\r" ); printf("GoAhead HTTPD Enabled: %s\n", bool2string(GoAhead_HTTPD_enabled) ); printf("Simple HTTPD Enabled: %s\n", bool2string(Simple_HTTPD_enabled) ); printf("FTPD Enabled: %s\n", bool2string(FTPD_enabled) ); printf("\n"); /* * Load Base Filesystem Image */ printf("Loading filesystem image\n"); status = Untar_FromMemory( (char *)FilesystemImage, FilesystemImage_size ); printf("Initializing Network"); rtems_bsdnet_initialize_network (); #if defined(START_DEBUG_STUB) rtems_gdb_start( 10, NULL ); #endif #if defined(USE_FTPD) printf( "Initializing FTPD\n" ); rtems_initialize_ftpd(); #endif #if defined(USE_GOAHEAD_HTTPD) printf( "Initializing GoAhead HTTPD\n" ); status = rtems_initialize_webserver(); if ( status ) printf( "ERROR -- failed to initialize webserver\n" ); traceSetHandler( quietTraceHandler ); #endif #if defined(USE_SIMPLE_HTTPD) printf( "Initializing Simple HTTPD\n" ); status = rtems_initialize_webserver( 100, /* initial priority */ 48 * 1024, /* stack size */ RTEMS_DEFAULT_MODES, /* initial modes */ RTEMS_DEFAULT_ATTRIBUTES, /* attributes */ NULL, /* init_callback */ my_shttpd_addpages, /* addpages_callback */ "/", /* initial priority */ 80 /* port to listen on */ ); if ( status ) printf( "ERROR -- failed to initialize webserver\n" ); #endif osmonweb_init( "/", 1 ); osmonweb_init( "/", 2 ); status = rtems_task_delete( RTEMS_SELF ); }