NAME | API RESTRICTIONS | DESCRIPTION | ATTRIBUTES | SEE ALSO
The function or functions documented here may not be used safely in all application contexts with all APIs provided in the ChorusOS 5.0 product.
See API(5FEA) for details.
The /dev/knvram and /dev/nvramX devices are available from the POSIX layer of ChorusOS. They may be read to and written from using a character device interface. A generic driver managing these devices is enabled when the NVRAM feature is set to true. The devices may be read, written and sought. In addition, an ioctl() is available to obtain the usable size of the nvram.
The /dev/knvram device is built using the mknod utility:
mknod /dev/knvram c 24 0 (kernel NVRAM)
Other devices can be built using the mknod utility (Y must be between 1 and 254, 255 is reserved for the system) :
mknod /dev/nvramX c 24 Y
/dev/knvram can be used to access the area of non-volatile memory used by the hardware to store the hardware boot configuration. All /dev/nvramX can be used to access and partition the area of non-volatile memory unused by the hardware. This memory region can be freely used by user applications. /dev/nvram0 can provide access to the total NVRAM free space.
The ioctl() function on /dev/nvram_bot or /dev/nvram_user obtains the size of non-volatile memory on the device:
#include <sys/ioctl.h> #include <cx/nvramio.h> typedef uint32_f NvramSize; int ioctl(int fildes, int request, NvramSize* ioctl_args);
fildes is a file descriptor.
request is the request NVRAM_GET_SIZE
ioctl_args is a pointer to a NvramSize
type.
ioctl() returns 0 when no error has occurred. Please refer to the ioctl man page, ioctl(2POSIX), if an error occurs.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
NAME | API RESTRICTIONS | DESCRIPTION | ATTRIBUTES | SEE ALSO