The
cmos pseudo-device can be used to read the real-time clock and ISA configuration data from an ISA-compatible CMOS RAM, and to write the ISA configuration data.
A program reads between 0 and 48 bytes from the CMOS RAM, starting at byte 0 of the RAM, using a single call to
read(2). Likewise, a program writes between 0 and 48 bytes to the CMOS RAM, starting at byte 0 of the RAM, using a single call to
write(2).
cmos does not allow programs to overwrite the real-time clock data (bytes 0 through 9), the status registers (10 through 13), the diagnostic status or CMOS shutdown status (bytes 14 and 15), or the CMOS checksum (bytes 46 and 47). Writes to those bytes are ignored.
On writes,
cmos recomputes the CMOS checksum and writes it to the CMOS RAM.