Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z
faqs.org - Internet FAQ Archives

comp.unix.aix Frequently Asked Questions (Part 5 of 5)
Section - 8.04: How can I find out the machine type?

( Part1 - Part2 - Part3 - Part4 - Part5 - Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Business Photos and Profiles ]


Top Document: comp.unix.aix Frequently Asked Questions (Part 5 of 5)
Previous Document: 6.11: How can I access the comp.unix.aix newsgroup via email (or Web)?
Next Document: 8.05: Updating to 3.2.5
See reader questions & answers on this topic! - Help others by sharing your knowledge

[ formerly in section 1.126 ]

#!/bin/ksh
# Determine machine type
# Jim O'Quinn  2/28/93
# AIX Software Support
# This does not represent my employer, use at own risk.....
# Changed to report newer machines and unknown ids. /Fred
# More new machines. /David

MachType=`uname -m | cut -c9-10`
case $MachType
in
  02)  nMachType="7015/930";;
  10)  nMachType="7013/530 or 7016/720 or 7016/730";;
  11|14)  nMachType="7013/540";;
  18)  nMachType="7013/53H";;
  1C)  nMachType="7013/550";;
  20)  nMachType="7015/930";;
  2E)  nMachType="7015/950 or 7015/950E";;
  30)  nMachType="7013/520 or 7018/740 or 7018/741";;
  31)  nMachType="7012/320";;
  34)  nMachType="7013/52H";;
  35)  nMachType="7012/32H or 7012/320E";;
  37)  nMachType="7012/340 or 7012/34H";;
  38)  nMachType="7012/350";;
  41)  nMachType="7011/220 or 7011/22W or 7011/22G or 7011/230";;
  42)  nMachType="7006/41T or 7006/41W";;
  43)  nMachType="7008/M20";;
  45)  nMachType="7011/220 or 7011/M20 or 7011/230 or 7011/23W";;
  46)  nMachType="7011/250";;
  47)  nMachType="7011/230";;
  48)  nMachType="7009/C10";;
  49)  nMachType="7011/250";;
  4C)  nMachType="604/43P";;
  4D)  nMachType="601/40P";;
  57)  nMachType="7012/390 or 7012/3BT or 7030/3BT or 7032/3AT or 7011/390";;
  58)  nMachType="7012/380 or 7012/3AT or 7030/3BT";;
  59)  nMachType="3CT or 39H";;
  5C)  nMachType="7013/560";;
  63)  nMachType="7015/970 or 7015/97B";;
  64)  nMachType="7015/980 or 7015/98B";;
  66)  nMachType="7013/580 or 7013/58F or 7015/580";;
  67)  nMachType="7013/570 or 7013/770 or 7013/771 or 7013/R10 or 7015/570";;
  70)  nMachType="7013/590";;
  71)  nMachType="7013/58H";;
  72)  nMachType="7013/59H or 7013/R12 or 7013/58H";;
  75)  nMachType="7012/370 or 7012/375 or 7012/37T";;
  76)  nMachType="7012/360 or 7012/365 or 7012/36T";;
  77)  nMachType="7012/315 or 7012/350 or 7012/355 or 7012/510 or 7012/55H or 7012/55L";;
  78)  nMachType="7012/315 or 7013/510";;
  79)  nMachType="7013/590";;
  80)  nMachType="7015/990";;
  82)  nMachType="7015/R00 or 7015/R24";;
  90)  nMachType="IBM C20";;
  91)  nMachType="604/42T";;
  A0)  nMachType="7013/J30 or 7013/R30";;
  A3)  nMachType="7013/R30";;
  A6)  nMachType="7012/G30";;
  C4)  nMachType="F40";;
  E0)  nMachType="603/MOTOROLA PowerStack";;
  *)  nMachType="Unknown($MachType)"
esac
echo "Machine type: "$nMachType"

From: Jan Just Keijser <KeijserJJ@logica.com> 

I've attached a C program which determines the model and the amount of
memory installed in C code (by querying the ODM directly). It can be
compiled using
  cc -o model model.c -lcfg -lodm

#include <stdio.h>
#include <sys/utsname.h>
#include <unistd.h>

#include <string.h>
#include <cf.h>
#include <sys/cfgodm.h>
#include <sys/cfgdb.h>

void main (void)
{
  struct utsname	name;
  int			memsize;

  char         s[3];
  int          model;

  struct CuAt *odm_obj;
  int          how_many;

  uname(&name);

  printf( "sysname  = %s\n", name.sysname );
  printf( "nodename = %s\n", name.nodename );
  printf( "release  = %s\n", name.release );
  printf( "version  = %s\n", name.version );
  printf( "machine  = %s\n", name.machine );

  printf( "model    = " );
   /* On AIX, the model is encoded in the last 2 non-zero digits
      of the model code (uname -m)
   */
   s[0] = name.machine[ strlen( name.machine ) - 4 ];
   s[1] = name.machine[ strlen( name.machine ) - 3 ];
   s[2] = '\0';
   model = strtol(s, NULL, 16);
  
   switch (model)
   {
      case 0x10:  puts ( "Model 530/730" );
                  break;
      case 0x11:
      case 0x14:  puts ( "Model 540" );
                  break;
      case 0x18:  puts ( "Model 530H" );
                  break;
      case 0x1C:  puts ( "Model 550" );
                  break;
      case 0x20:  puts ( "Model 930" );
                  break;
      case 0x2E:  puts ( "Model 950/950E" );
                  break;
      case 0x30:  puts ( "Model 520 or 740/741" );
                  break;
      case 0x31:  puts ( "Model 320" );
                  break;
      case 0x34:  puts ( "Model 520H" );
                  break;
      case 0x35:  puts ( "Model 32H/320E" );
                  break;
      case 0x37:  puts ( "Model 340/34H" );
                  break;
      case 0x38:  puts ( "Model 350" );
                  break;
      case 0x41:  puts ( "Model 220/22W/22G/230" );
                  break;
      case 0x42:  puts ( "Model 41T/41W" );
                  break;
      case 0x43:  puts ( "Model M20" );
                  break;
      case 0x45:  puts ( "Model 220/M20/230/23W" );
                  break;
      case 0x46:
      case 0x49:  puts ( "Model 250" );
                  break;
      case 0x47:  puts ( "Model 230" );
                  break;
      case 0x48:  puts ( "Model C10" );
                  break;
      case 0x4C:  puts ( "PowerPC 603/604 model" );
                  break;
      case 0x4D:  puts ( "Model 40P" );
                  break;
      case 0x57:  puts ( "Model 390/3AT/3BT" );
                  break;
      case 0x58:  puts ( "Model 380/3AT/3BT" );
                  break;
      case 0x59:  puts ( "Model 39H/3CT" );
                  break;
      case 0x5C:  puts ( "Model 560" );
                  break;
      case 0x63:  puts ( "Model 970/97B" );
                  break;
      case 0x64:  puts ( "Model 980/98B" );
                  break;
      case 0x66:  puts ( "Model 580/58F" );
                  break;
      case 0x67:  puts ( "Model 570/770/R10" );
                  break;
      case 0x70:  puts ( "Model 590" );
                  break;
      case 0x71:  puts ( "Model 58H" );
                  break;
      case 0x72:  puts ( "Model 59H/58H/R12/R20" );
                  break;
      case 0x75:  puts ( "Model 370/375/37T" );
                  break;
      case 0x76:  puts ( "Model 360/365/36T" );
                  break;
      case 0x77:  puts ( "Model 315/350/355/510/550H/550L" );
                  break;
      case 0x79:  puts ( "Model 591" );
                  break;
      case 0x80:  puts ( "Model 990" );
                  break;
      case 0x81:  puts ( "Model R24" );
                  break;
      case 0x82:  puts ( "Model R00/R24" );
                  break;
      case 0x89:  puts ( "Model 595" );
                  break;
      case 0x90:  puts ( "Model C20" );
                  break;
      case 0x91:  puts ( "Model 42T" );
                  break;
      case 0x94:  puts ( "Model 397" );
                  break;
      case 0xA0:  puts ( "Model J30" );
                  break;
      case 0xA1:  puts ( "Model J40" );
                  break;
      case 0xA3:  puts ( "Model R30" );
                  break;
      case 0xA4:  puts ( "Model R40" );
                  break;
      case 0xA6:  puts ( "Model G30" );
                  break;
      case 0xA7:  puts ( "Model G40" );
                  break;
      case 0xC4:  puts ( "Model F30" );
                  break;
      default:    printf( "Model code: %s\n", s );
                  break;
   }

/* Get the amount of installed memory */
  odm_set_path("/etc/objrepos");
  /* Get a single ODM object */
  odm_obj = getattr("sys0", "realmem", 0, &how_many);
  memsize = atoi(odm_obj->value) / 1024;
  odm_terminate();
  printf( "Memory   = %d MB\n", memsize );

/* Print the number of processors */
  printf("#processor configured = %d\n", sysconf(_SC_NPROCESSORS_CONF));
  printf("#processor online     = %d\n", sysconf(_SC_NPROCESSORS_ONLN));

}

User Contributions:

Comment about this article, ask questions, or add new information about this topic:

CAPTCHA




Top Document: comp.unix.aix Frequently Asked Questions (Part 5 of 5)
Previous Document: 6.11: How can I access the comp.unix.aix newsgroup via email (or Web)?
Next Document: 8.05: Updating to 3.2.5

Part1 - Part2 - Part3 - Part4 - Part5 - Single Page

[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:
bofh@mail.teleweb.pt (Jose Pina Coelho)





Last Update March 27 2014 @ 02:11 PM