real-time books (was: Getting started)

Rosimildo da Silva rdasilva at connecttel.com
Thu Aug 10 00:20:18 UTC 2000


Efren Serra wrote:
> 
> Hello folks,
> 
> Simple question:
> 
> How do I test an RTEMS application that is suppose to take command-line
> arguments?  This is my caviat:
> I got the Java 2 Platform, Micro Edition (J2ME) VM compiled and linked on RTEMS.
> Now, the VM (cvm)
> is supposed to be called with command-line arguments.  See?
> 


I do not think that there is a standard way. I use a static array in the 
module along with the Init task and the RTEMS configuration. 

Something like this:

<snip from omniORB initialization under RTEMS>

/* this is the command line options to be passed to the ORB */
char *cc_argv[] = 
{
	"cc_main",                  /* always the name of the program */
	"-ORBInitialHost",
	HOST_OMNINAMES_HOST_NAME,   /* machine running omniNames */

	"-ORBInitialPort",
        HOST_OMNINAMES_PORT_NUMBER, /* port number that omniNames uses
*/
};
int cc_argc = sizeof( cc_argv ) / sizeof( cc_argv[ 0 ]  );


//
// this is the user's entry point. It should match the "main()"
// function in a regular C/C++ prgram.
//

//
// USE THIS FOR C PROGRAMS
// extern "C" int cc_main(int argc, char **argv);  
//
extern int cc_main(int argc, char **argv);

/////////////////////////////////////////////////////////////////////////////
// DESCRIPTION: Init task for any omniORB/RTEMS application.
/////////////////////////////////////////////////////////////////////////////
void *POSIX_Init( void *argument )
{
  // Call omniORB example
  cc_main( cc_argc, cc_argv );
  printf( "*** Done ***\n\n\n" );
  pthread_exit( NULL );
  return NULL; /* just so the compiler thinks we returned something */
}


-- 
Rosimildo da Silva            rdasilva at connectel.com 
ConnectTel, Inc.              Austin, TX -- USA      
Phone : 512-338-1111          Fax : 512-918-0449     
Mobile: 512-632-7579                                 
Company Page: http://www.connecttel.com              
Home Page: http://members.xoom.com/rosimildo/



More information about the users mailing list