Oberon || Library || Module Index || Search Engine || Definition || Module


Ulm's Oberon Library:
Architectures


NAME

Architectures - classification of hardware architectures and operating systems

SYNOPSIS

TYPE Architecture = POINTER TO ArchitectureRec;
TYPE ArchitectureRec =
   RECORD
      (PersistentDisciplines.ObjectRec)
      class: ConstStrings.String;
      variant: ConstStrings.String;
      vendor: ConstStrings.String;
      model: ConstStrings.String;
      os, osrelease: ConstStrings.String;
   END;


VAR system: Architecture;

PROCEDURE Create(VAR arch: Architecture; class: ARRAY OF CHAR); PROCEDURE CreateCopy(VAR arch: Architecture; orig: Architecture); PROCEDURE Compatible(arch1, arch2: Architecture; VAR combined: Architecture) : BOOLEAN; PROCEDURE Identical(arch1, arch2: Architecture) : BOOLEAN; PROCEDURE GetString(arch: Architecture; VAR string: ConstStrings.String); PROCEDURE GetArch(string: ConstStrings.String; VAR arch: Architecture);

DESCRIPTION

Architectures supports the specification of sets of environments that are characterized by their machine processor and, optionally, their operating system. Objects of type Architectures.Architecture contain a large set of attributes that might be helpful in distinguishing different variants. But specifications should specify as less as possible: The less specified the more powerful the set of architectures covered. Following components contribute to the specification of an architecture:

class
characterizes a hardware family (e.g. i386, m68k, or sparc) that provides some sort of compatibility. This is the only mandatory component of an architecture. All others may be NIL. Class names should, if possible, conform to those returned by ``uname -p''.
variant
specifies a minor variant of the hardware architecture (e.g. 586 for i386, 68030 of m68k, or v8 of sparc). Most families are organized in a hierarchy of variants where all new variants are compatibility preserving extensions of older variants.
vendor
names the vendor who designed the hardware architecture. This component should only be given in case of multiple vendors with different user-visible extensions and/or restrictions.
model
is a name of a set of conventions that specify the size of the address space and long integers.
os
specifies the operating system if dependencies to it are of concern. The names used should conform to those returned by ``uname -s''.
osrelease
restricts an architecture to a specific release of an operating system. Release numbers should conform to those returned by ``uname -r''. Note that the specification of osrelease requires os to be non-NIL.

Note that objects of type Architectures.Architecture are persistent and may have persistent disciplines attached to it.

Create creates an architecture specification of the given class. Further components that need to be specified should initialized shortly thereafter preferably by using ConstStrings.Create. Note, however, that thereafter architectures should be treated as constants, i.e. they must not be modified. Instead CreateCopy allows to create a copy of an architecture that may be changed shortly thereafter.

Compatible returns TRUE if arch1 and arch2 are compatible to each other that means that either the set of architectures defined by arch1 includes those of arch2 or vice versa. Compatible sets on success combined to the intersection of both architecture sets. Identical returns TRUE if arch1 and arch2 are identical.

Architectures may be converted from oder to strings using following EBNF grammar:

ArchString =   Hardware [ ";" Model ] [ "-" Software ] .
Hardware =     Class [ ":" [ Variant ] [ ":" Vendor ] ] .
Model =        AlphaNum .
Software =     OS [ ":" Release ] .
Class =        AlphaNum .
Variant =      AlphaNum .
Vendor =       AlphaNum .
OS =           AlphaNum .
Release =      AlphaNum .
GetString creates a constant string representing arch. GetArch reconstructs an architecture object from string which is set to NIL in case of syntax errors.

The architectural information of the current system can be made available through system if a module that is familiar with the current architecture was loaded to retrieve these informations.

SEE ALSO

uname(1)
prints parameters of current system
ConstStrings
constant strings of arbitrary length
PersistentDisciplines
persistent disciplines
PersistentObjects
operations for persistent objects
SPARCSolarisArchitecture
initializes system on SPARC/Solaris platforms, if loaded
SysSolarisInfo
extracts various credentials on Solaris systems
SysUname
credentials of the current operating system

Edited by: borchert, last change: 2004/03/10, revision: 1.2, converted to HTML: 2004/03/10

Oberon || Library || Module Index || Search Engine || Definition || Module