Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!hao!hplabs!pesnta!greipa!decwrl!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: net.unix-wizards Subject: Re: Cpu ID under UNIX Message-ID: <2972@sun.uucp> Date: Sat, 9-Nov-85 04:14:29 EST Article-I.D.: sun.2972 Posted: Sat Nov 9 04:14:29 1985 Date-Received: Tue, 12-Nov-85 05:11:41 EST References: <138@oracle.UUCP> Organization: Sun Microsystems, Inc. Lines: 34 > 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