Technical data
SunOS 5.5 Devices openprom(7D)
NAME openprom − PROM monitor configuration interface
SYNOPSIS #include <sys/fcntl.h>
#include <sys/types.h>
#include <sys/openpromio.h>
open("/dev/openprom", mode);
DESCRIPTION The internal encoding of the configuration information stored in EEPROM or NVRAM
varies from model to model, and on some systems the encoding is “hidden” by the
firmware. The openprom driver provides a consistent interface that allows a user or pro-
gram to inspect and modify that configuration, usingioctl(2) requests. These requests
are defined in <sys/openpromio.h>:
struct openpromio {
u_int oprom_size; /∗ real size of following array ∗/
char oprom_array[1]; /∗ For property names and values ∗/
/∗ NB: Adjacent, Null terminated ∗/
};
#define OPROMMAXPARAM 32768 /∗ max size of array ∗/
For all ioctl(2) requests, the third parameter is a pointer to a ’struct openpromio’. All
property names and values are null-terminatedstrings; the value of a numeric option is
its ASCII representation.
IOCTLS OPROMGETOPT This ioctl takes the null-terminated name of a property in the
oprom_array and returns its null-terminated value (overlay-
ing its name). oprom_size should be set to the size of
oprom_array; on return it will contain the size of the returned
value. If the named property does not exist, or if there is not
enough space to hold its value, then oprom_size will be set to
zero. See BUGS below.
OPROMSETOPT This ioctl takes two adjacent strings in oprom_array; the null-
terminated property name followed by the null-terminated
value.
OPROMSETOPT2 This ioctl is similar to OPROMSETOPT, except that it uses the
difference between the actual user array size and the length
of the property name plus its null terminator.
OPROMNXTOPT This ioctl is used to retrieve properties sequentially. The
null-terminated name of a property is placed into
oprom_array and on return it is replaced with the null-
terminated name of the next property in the sequence, with
oprom_size set to its length. A null string on input means
return the name of the first property; an oprom_size of zero on
output means there are no more properties.
modified 18 Aug 1995 7D-235










