Home | History | Annotate | Line # | Download | only in man4.sun2
 $NetBSD: leds.4,v 1.11 2022/08/28 10:48:16 hgutch Exp $

Copyright (c) 1997 The NetBSD Foundation, Inc.
All rights reserved.

This code is derived from software contributed to The NetBSD Foundation
by der Mouse and Jeremy Cooper.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

.Dd March 2, 1996 .Dt LEDS 4 sun2 .Os .Sh NAME .Nm leds .Nd sun2 diagnostic Light Emitting Diodes driver .Sh SYNOPSIS n machine/leds.h .Sh DESCRIPTION All sun2 machines are equipped a diagnostic display of eight Light Emitting Diodes (LEDs), located on either the front (deskside chassis) or the back (desktop machine) of the system unit.

p The kernel changes the display during periods of idle processor activity according to a stored sequential pattern list. The

a /dev/leds interface provides a way of manipulating the pattern list via simple file I/O.

p The structure of the file is as follows: d -literal struct led_patterns { u_char divisor; u_char patlen; u_char pat[256]; }; .Ed l -tag -width divisor t Sy divisor The number of idle periods to wait before switching to the next pattern in the array. t Sy patlen The number of patterns stored in the array. t Sy pat The array of patterns to display. .El

p When a clock interrupt occurs while the processor is idle, a pattern countdown timer is decremented. When the countdown timer reaches zero it is reset with the .Sy divisor value and the next pattern in the array is selected and displayed.

p Each 8-bit pattern describes the state of the diagnostic LEDs. A set bit in a pattern indicates that its corresponding LED should be extinguished, while a reset bit indicates an LED to be illuminated. .Sh FILES l -tag -width /dev/leds -compact t Pa /dev/leds .El .Sh EXAMPLES The following example uses .Xr awk 1 to display the repeating animation of a single lit LED scrolling from one end of the display to the other, using six clock ticks between each update. d -ragged -offset indent # echo 5 8 254 253 251 247 239 223 191 127 | awk '{ for (i=1;i<=NF;i++) printf("%c",$i+0); }' > /dev/leds .Ed .Sh ERRORS An I/O transfer to

a /dev/leds will complete successfully unless: l -tag -width Er t Bq Er EIO A read or write starting beyond the end of the file was attempted. .El .Sh SEE ALSO .Xr ppt 6 .Sh HISTORY

a /dev/leds first appeared in .Nx 1.2 .