1 .\" $NetBSD: leds.4,v 1.8 2008/03/06 09:30:45 martin Exp $
3 .\" Copyright (c) 1997 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
6 .\" This code is derived from software contributed to The NetBSD Foundation
7 .\" by der Mouse and Jeremy Cooper.
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
18 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGE.
35 .Nd sun2 diagnostic Light Emitting Diodes driver
39 All sun2 machines are equipped
40 a diagnostic display of eight Light Emitting Diodes (LEDs), located
41 on either the front (deskside chassis) or the back (desktop machine)
44 The kernel changes the display during periods of idle processor activity
45 according to a stored sequential pattern list.
48 interface provides a way of manipulating the pattern list via simple file I/O.
50 The structure of the file is as follows:
58 .Bl -tag -width divisor
60 The number of idle periods to wait before switching to the next pattern in
63 The number of patterns stored in the array.
65 The array of patterns to display.
68 When a clock interrupt occurs while the processor is idle, a pattern
69 countdown timer is decremented.
70 When the countdown timer reaches zero
73 value and the next pattern in the array is selected and displayed.
75 Each 8-bit pattern describes the state of the diagnostic LEDs.
76 A set bit in a pattern indicates that its
77 corresponding LED should be extinguished,
78 while a reset bit indicates an LED to be illuminated.
80 .Bl -tag -width /dev/leds -compact
84 The following example uses
86 to display the repeating animation of a single lit LED scrolling from one end
87 of the display to the other, using six clock ticks between each update.
88 .Bd -ragged -offset indent
89 # echo 5 8 254 253 251 247 239 223 191 127 |
90 awk '{ for (i=1;i\*[Le]NF;i++) printf("%c",$i+0); }' \*[Gt] /dev/leds
95 will complete successfully unless:
98 A read or write starting beyond the end of the file was attempted.