machine label.

Joel Sherrill joel.sherrill at OARcorp.com
Tue Nov 19 17:41:10 UTC 2002



Chris Johns wrote:
> 
> Ralf Corsepius wrote:
> 
> > Am Die, 2002-11-19 um 04.21 schrieb Chris Johns:
> >
> > >Does a define exist that describes the "machine" ?
> >
> > What do you mean by "machine", here?
> 
> I suppose it is the label returned by "uname -m" on FreeBSD or which
> ever Unix.

Look up uname().  It fills in a struct utsname * and reports the
information you want.  cpukit/libcsupport/src/uname.c ...

  strcpy( name->sysname, "RTEMS" );
  sprintf( name->nodename, "Node %d", _Objects_Local_node );
  strcpy( name->release, RTEMS_VERSION );
  strcpy( name->version, "" );
  sprintf( name->machine, "%s/%s", CPU_NAME, CPU_MODEL_NAME );


> > architecture/cpu?
> > cpu-variant?
> > OS?
> > uname?
> >
> > There exist several defines and variables in RTEMS which could be used
> > for such purposes.
> 
> This is what I was wondering. If it existed I would use it.
> 
> > >This is for the global "extern char machine[];" that is found on
> > FreeBSD boxes.
> >
> > This doesn't exist in RTEMS ;)
> 
> Does in my code. I am porting the FreeBSD sysctl call :-)
> 
> If you look in the sys/sysctl.h file you will see a few externs. The
> FreeBSD kernel file kern/kern_mib.c references these variables as they
> are exported via the sysctl call. If there was something around I would
> define them and have provide sysctl provide them.
> 
> > > I
> > >have found PACKAGE_VERSION" for the version,
> >
> > Don't use this one - It is autoconf adding it per configure script (In
> > autoconf terms each configure script sets up a "PACKAGE")
> 
> Sure, and it appears in a header file that included. Is this a problem ?
> 
> > > and ostype is set to "RTEMS".
> >
> > Do you want to destinguish RTEMS from other OSes?
> > Then you could use __rtems__ (defined by gcc).
> 
> You may remotely via a protocol such as SNMP.
> 
> It was a case of looking at what it takes to include these variables. If
> it is not worth including that is fine.
> 
> --
>   Chris Johns, cjohns at cybertec.com.au

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985



More information about the users mailing list