*BSD News Article 14081


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!agate!agate.berkeley.edu!cgd
From: cgd@eden.CS.Berkeley.EDU (Chris G. Demetriou)
Newsgroups: comp.os.386bsd.development
Subject: Re: Powerfail / UPS implementation
Date: 5 Apr 93 23:07:16
Organization: Kernel Hackers 'r' Us
Lines: 39
Message-ID: <CGD.93Apr5230716@eden.CS.Berkeley.EDU>
References: <2107@hcshh.hcs.de>
NNTP-Posting-Host: eden.cs.berkeley.edu
In-reply-to: hm@hcshh.hcs.de's message of 5 Apr 93 18:25:48 GMT

In article <2107@hcshh.hcs.de> hm@hcshh.hcs.de (Hellmuth Michaelis) writes:
=> [ ... ]
=>	- a device driver capable of reporting the status of the power
=>		supply (running from AC / running from DC). Should the
=>		query be implemented as a read() returning a char or
=>		as a ioctl() ?
=>
=>	- a daemon starting at /etc/rc.local and running in the background
=>		asking every minute or so for the power supply status by
=>		using the device driver above.
=>
=> [ ... ]
=>
=>Since the only (PC-based) ups-device i have ever seen is mine (built in),
=>is the above draft sufficient as a general purpose solution ?

mostly looks ok, but one thing should be noted:

most UPSs i've seen for PC's aren't that intelligent, and
normally can just sit on a serial port, and have the two
lines they provide, say, hooked to DTR and ground.

then simply have something try to open that port, and if it succeeds,
nuke init...

i think a specialized driver probably isn't necessary...
(if you do one, i'd vote for "read a char" -- no need to clog
ioctl space...)





chris
--
Chris G. Demetriou                                    cgd@cs.berkeley.edu

   "386bsd as depth first search: whenever you go to fix something you
       find that 3 more things are actually broken." -- Adam Glass