Cpu ID under UNIX

Guy Harris guy at sun.uucp
Sat Nov 9 19:14:29 AEST 1985


> The VAX hardware supports the ability of obtaining the CPU id.

I don't remember seeing this in the 750 or 730 CPU descriptions, but it may
be there.

> Under VMS its obtained by the call to LIB$GETSYI. Has anyone done this
> under UNIX.
> ...
> I'd like to see a standard system call in UNIX for doing this (provided
> hardware support, of course).

Sun threw out "sethostid" from 4.2 and changed "gethostid" to return the
host ID from the ID PROM.  The 4.2 manual says that this 32-bit identifier
is "intended to be unique among all UNIX systems in existence."  It also
says that it is normally the Internet address of the machine; this begs the
question of gateway machines which don't have something which can be called
*the* Internet address of the machine.  I don't think any 4.2 code uses this
number as the Internet address (all the code either does a "gethostname" and
a "gethostbyname", or looks at the address the host has *on a particular
interface*).  I suspect the only reason the Internet address is mentioned is
that it will be a 32-bit number which is guaranteed to be unique; of course,
if you're not on the Internet (or, at least, don't have a properly-assigned
Internet address), you're out of luck.

If all VAXes have a (32 bit) serial number register, this register's
contents (or the serial number part; it may contain hardware or microcode
rev levels and the like as well) could serve the same purpose on a VAX; just
rip out "sethostid" and change "gethostid" to get the CPU ID.

Of course, if not all VAX CPUs *have* a machine-readable CPU serial number,
the whole discussion is somewhat moot (I think it just contains rev levels,
plant IDs, and the like on other VAXes).

	Guy Harris



More information about the Comp.unix.wizards mailing list