Date: Tue, 25 Apr 2000 16:21:01 -0400 From: "Charles Anderson" <caa@columbus.rr.com> To: Alfred Perlstein <bright@wintelcom.net> Cc: Leif Neland <leif@neland.dk>, freebsd-hackers@FreeBSD.ORG Subject: Re: Turning on a relay. Message-ID: <20000425162101.D51324@midgard.dhs.org> In-Reply-To: <20000425123021.F9754@fw.wintelcom.net>; from bright@wintelcom.net on Tue, Apr 25, 2000 at 12:30:21PM -0700 References: <00b901bfaee7$55da1fe0$0e00a8c0@neland.dk> <20000425123021.F9754@fw.wintelcom.net>
next in thread | previous in thread | raw e-mail | index | archive | help
Yet another way. I used #include <sys/kbio.h> ... io_fd = open("/dev/console", O_RDWR, 0); ioctl(io_fd, KDENABIO, 0); and ioctl(io_fd, KDDISABIO, 0); to turn it off again. Is there a "right" way of doing it? Linux has a iopl call that sets the i/o privilege level, it seems much easier and at least better documented. (I was porting glx code, that was using iopl) -Charlie On Tue, Apr 25, 2000 at 12:30:21PM -0700, Alfred Perlstein wrote: > * Leif Neland <leifn@neland.dk> [000425 12:24] wrote: > > I'd like to turn on a relay to the power for my laserprinter 3 rooms away > > where the server is located. > > > > I have an i/o board with a 8255 24 bit i/o port.(IIRC) > > > > So I wrote a simple userland program to do inb/outb, but it dumped core with > > BUSERR, I presume because userland is not supposed to do i/o to the > > hardware. > > > > I guess I have these options: > > A: write a driver/kernel module to access the port. > > B: use an extra parallel port. (I use 2 at the moment) > > C: use a serial port; I have 3-4 available. > > D: open(/dev/io) > > -Alfred > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message -- Charles Anderson caa@columbus.rr.com No quote, no nothin' To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000425162101.D51324>