summaryrefslogtreecommitdiff
path: root/static/netbsd/man4/man4.i386/cmos.4 3.html
blob: cbbd20277171f63af0f06ae09ce16cf2d3fe276c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<table class="head">
  <tr>
    <td class="head-ltitle">CMOS(4)</td>
    <td class="head-vol">Device Drivers Manual (i386)</td>
    <td class="head-rtitle">CMOS(4)</td>
  </tr>
</table>
<div class="manual-text">
<section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<p class="Pp"><code class="Nm">cmos</code> &#x2014; <span class="Nd">Read/write
    access to IBM PC/AT CMOS RAM</span></p>
</section>
<section class="Sh">
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<p class="Pp"><code class="Cd">pseudo-device cmos</code></p>
</section>
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<p class="Pp">The <code class="Nm">cmos</code> 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.</p>
<p class="Pp">A program reads between 0 and 48 bytes from the CMOS RAM, starting
    at byte 0 of the RAM, using a single call to <a class="Xr">read(2)</a>.
    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 <a class="Xr">write(2)</a>.</p>
<p class="Pp"><code class="Nm">cmos</code> 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.</p>
<p class="Pp">On writes, <code class="Nm">cmos</code> recomputes the CMOS
    checksum and writes it to the CMOS RAM.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1>
<p class="Pp">Display entire contents of CMOS RAM:</p>
<div class="Bd Pp Bd-indent Li">
<pre># dd if=/dev/cmos bs=48 count=1 | od -t x1
0000000   37  00  09  00  22  00  06  13  04  80  26  02  50  80  00  00
0000020   00  51  f0  00  01  80  02  00  fc  0f  2f  00  00  00  00  00
0000040   00  80  81  f0  ff  00  00  00  00  00  00  00  00  00  05  ee
0000060</pre>
</div>
<p class="Pp">Change boot order on Soekris net4521 to PXE ROM, Primary HDD,
    Secondary HDD:</p>
<div class="Bd Pp Bd-indent Li">
<pre># dd if=/dev/cmos of=/tmp/cmos0 bs=48 count=1
1+0 records in
1+0 records out
48 bytes transferred in 0.001 secs (48000 bytes/sec)
# cp /tmp/cmos0 /tmp/cmos
# printf '\xf0\x80\x81\xff' | dd bs=1 seek=33 conv=notrunc of=/tmp/cmos
4+0 records in
4+0 records out
4 bytes transferred in 0.001 secs (4000 bytes/sec)
# dd if=/tmp/cmos of=/dev/cmos
0+1 records in
0+1 records out
48 bytes transferred in 0.001 secs (48000 bytes/sec)</pre>
</div>
</section>
<section class="Sh">
<h1 class="Sh" id="ERRORS"><a class="permalink" href="#ERRORS">ERRORS</a></h1>
<p class="Pp">A program can read or write no more than 48 bytes to
    <code class="Nm">cmos</code>. Both <a class="Xr">read(2)</a> and
    <a class="Xr">write(2)</a> will return <code class="Er">EINVAL</code> if
    more than 48 bytes are read or written at once.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1>
<p class="Pp">The original <code class="Nm">cmos</code> driver was written by
    <span class="An">Takahiro Kambe</span>
    &lt;<a class="Mt" href="mailto:taca@back-street.net">taca@back-street.net</a>&gt;.
  <br/>
  <span class="An">David Young</span>
    &lt;<a class="Mt" href="mailto:dyoung@NetBSD.org">dyoung@NetBSD.org</a>&gt;
    modified the original and added it to <span class="Ux">NetBSD</span>.</p>
</section>
</div>
<table class="foot">
  <tr>
    <td class="foot-date">April 21, 2010</td>
    <td class="foot-os">NetBSD 10.1</td>
  </tr>
</table>