1 .\" $NetBSD: cmos.4,v 1.5 2009/03/23 16:04:25 joerg Exp $
3 .\" Copyright (c) 2007 David Young. All rights reserved.
5 .\" This manual page was written by David Young.
7 .\" Redistribution and use in source and binary forms, with or
8 .\" without modification, are permitted provided that the following
9 .\" conditions are met:
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above
13 .\" copyright notice, this list of conditions and the following
14 .\" disclaimer in the documentation and/or other materials
15 .\" provided with the distribution.
17 .\" THIS SOFTWARE IS PROVIDED BY DAVID YOUNG ``AS IS'' AND ANY
18 .\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
19 .\" THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
20 .\" PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DAVID
21 .\" YOUNG BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22 .\" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
23 .\" TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25 .\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGE.
35 .Nd Read/write access to IBM PC/AT CMOS RAM
37 .Cd pseudo-device cmos
41 to read the real-time clock and ISA configuration data from an
42 ISA-compatible CMOS RAM, and to write the ISA configuration data.
44 A program reads between 0 and 48 bytes from the CMOS RAM, starting at
45 byte 0 of the RAM, using a single call to
47 Likewise, a program writes between 0 and 48 bytes to the CMOS RAM,
48 starting at byte 0 of the RAM, using a single call to
52 does not allow programs to overwrite the real-time clock data
53 (bytes 0 through 9), the status registers (10 through 13),
54 the diagnostic status or CMOS shutdown status (bytes 14 and 15),
55 or the CMOS checksum (bytes 46 and 47).
56 Writes to those bytes are ignored.
60 recomputes the CMOS checksum and writes it to the CMOS RAM.
62 Display entire contents of CMOS RAM:
63 .Bd -literal -offset indent
64 # dd if=/dev/cmos bs=48 count=1 | od -t x1
65 0000000 37 00 09 00 22 00 06 13 04 80 26 02 50 80 00 00
66 0000020 00 51 f0 00 01 80 02 00 fc 0f 2f 00 00 00 00 00
67 0000040 00 80 81 f0 ff 00 00 00 00 00 00 00 00 00 05 ee
71 Change boot order on Soekris net4521 to PXE ROM, Primary HDD,
73 .Bd -literal -offset indent
74 # dd if=/dev/cmos of=/tmp/cmos0 bs=48 count=1
77 48 bytes transferred in 0.001 secs (48000 bytes/sec)
78 # cp /tmp/cmos0 /tmp/cmos
79 # printf '\exf0\ex80\ex81\exff' | dd bs=1 seek=33 conv=notrunc of=/tmp/cmos
82 4 bytes transferred in 0.001 secs (4000 bytes/sec)
83 # dd if=/tmp/cmos of=/dev/cmos
86 48 bytes transferred in 0.001 secs (48000 bytes/sec)
89 A program can read or write no more than 48 bytes to
96 if more than 48 bytes are read / written at once.
100 driver was written by
101 .An Takahiro Kambe Aq taca@back-street.net .
102 .An David Young Aq dyoung@NetBSD.org
103 modified the original and added it to