Newsgroups: comp.sys.apollo
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!batcomputer!munnari.oz.au!metro!maths.su.oz.au!szabo_p
From: szabo_p@maths.su.oz.au (Paul Szabo)
Subject: Re: how does "bldt" get its information
Message-ID: <1991Jun26.003807.16681@metro.ucc.su.OZ.AU>
Keywords: bldt apollo undocumented
Sender: news@metro.ucc.su.OZ.AU
Nntp-Posting-Host: adder.maths.su.oz.au
Reply-To: szabo_p@maths.su.oz.au (Paul Szabo)
Organization: Mathematics, University of Sydney
References: <1991Jun25.060026.24045@wam.umd.edu>, <1991Jun25.133754.7667@apollo.hp.com>
Date: Wed, 26 Jun 91 00:38:07 GMT

In article <1991Jun25.133754.7667@apollo.hp.com> ced@apollo.hp.com (Carl
Davidson) writes:
> From article <1991Jun25.060026.24045@wam.umd.edu>, by dododge@wam.umd.edu (David O. Dodge):
> > Exactly how does the bldt program get the information to display the
> > kernal build version/date? 
> This is yet another service of the "asknode" subsystem. The build 
> information is stored in a kernel structure and encoded into a string 
> each time the routine is called.

You might want to look at the osinfo calls. The online documentation is
misleading, 'man osinfo' or 'help calls osinfo' only mention the
osinfo_$get_rev ('man osinfo_get_rev' or 'help calls osinfo_$get_rev') call.
The include file is better... Below is an example of use (at SR10.2).

Paul Szabo - System Manager   //        School of Mathematics and Statistics
szabo_p@maths.su.oz.au        //   University of Sydney, NSW 2006, Australia

---

#include <apollo/base.h>
#include <apollo/osinfo.h>

main ()
{

char      text_str[100];
short     text_len;
short     myvers;
int       osrev_size;
os_rev_$t osrev;
status_$t status;

int       memory;

short     model_len;
char      model_str[100];
int       model_max;
int       num_cpus;


text_str[0] = 0x00;
text_len    = 0;
myvers      = os_rev_$version;
osrev_size  = sizeof(osrev);

model_max   = sizeof(model_str);

/* ----- */

printf ("\nFrom osinfo_$get_rev:\n\n");

osinfo_$get_rev (text_str,text_len,myvers,osrev_size,&osrev,&status);

printf ("Got status = %x\n",status.all);

printf ("Version    = %d\n",osrev.version);
printf ("  Major    = %d\n",osrev.mmajor);
printf ("  Minor    = %d\n",osrev.mminor);
printf ("  Subminor = %d\n",osrev.subminor);
printf ("  Code     = %d\n",osrev.code);

if (osrev.os_len   < os_rev_$strlen) osrev.os_str  [osrev.os_len]   = 0x00;
if (osrev.pvt_len  < os_rev_$strlen) osrev.pvt_str [osrev.pvt_len]  = 0x00;
if (osrev.date_len < os_rev_$strlen) osrev.date_str[osrev.date_len] = 0x00;

printf ("Name       = %.32s\n",osrev.os_str);
printf ("Extension  = %.32s\n",osrev.pvt_str);
printf ("Date       = %.32s\n",osrev.date_str);

/* ----- */

printf ("\nFrom osinfo_$mem_size:\n\n");

osinfo_$mem_size (text_str,text_len,&memory,&status);

printf ("Got status = %x\n",status.all);

printf ("Memory     = %d\n",memory);

/* ----- */

printf ("\nFrom osinfo_$node_type:\n\n");

osinfo_$node_type (text_str,text_len,&model_len,model_str,model_max,&num_cpus,&status);

printf ("Got status = %x\n",status.all);

if (model_len < model_max) model_str[model_len] = 0x00;

printf ("Model      = %.100s\n",model_str);
printf ("No. CPUs   = %d\n",num_cpus);

}
--
         1         2         3         4         5         6         7         8
12345678901234567890123456789012345678901234567890123456789012345678901234567890

szabo_p@maths.su.oz.au  /  Paul Szabo - System Manager  /  Phone +61 2 692 3806
