From owner-freebsd-questions Thu Jan 11 19:07:44 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id TAA18309 for questions-outgoing; Thu, 11 Jan 1996 19:07:44 -0800 (PST) Received: from labinfo.iet.unipi.it (labinfo.iet.unipi.it [131.114.9.5]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id TAA18298 for ; Thu, 11 Jan 1996 19:07:34 -0800 (PST) Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id PAA02064; Thu, 11 Jan 1996 15:15:04 +0100 From: Luigi Rizzo Message-Id: <199601111415.PAA02064@labinfo.iet.unipi.it> Subject: Re: lpt driver question To: charlie_conklin@il.us.swissbank.com (Charlie Conklin) Date: Thu, 11 Jan 1996 15:15:03 +0100 (MET) Cc: questions@FreeBSD.org In-Reply-To: <9601111144.AA01349@ln1d279nwk> from "Charlie Conklin" at Jan 11, 96 11:43:56 am X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-questions@FreeBSD.org Precedence: bulk > Hello all... > > I have a simple piece of hardware that sits on the PC printer port. > I also have some C source code that compiles and works, and is used > to talk to that hardware. The code looks fairly simple, basically just > poking a few values at an io port. > > I am now faced with the task of making the hardware work under > FreeBSD instead of windows, and I realize that I do not have the > foggiest notion of how to proceed! :-( Does anyone have any ideas, > or have some useful direction to point me in? Can I use the lpt > driver to do this easily? Don't use the lpt driver (as a matter of fact, you might even want to disable it). Instead, insert a call to open "/dev/io": after that, you can play with the io ports of the PC, which means that you can compile your C code with almost no changes (except for inb()/outb() which you can replace with the macros or functions which are part of almost all device drivers. > - Charlie Conklin conklic@swissbank.com ^^^^^^^^^^^^^ Tell us, are you playing with some super-secret encription key used to protect electronic money transfers ? :) Luigi ==================================================================== Luigi Rizzo Dip. di Ingegneria dell'Informazione email: luigi@iet.unipi.it Universita' di Pisa tel: +39-50-568533 via Diotisalvi 2, 56126 PISA (Italy) fax: +39-50-568522 http://www.iet.unipi.it/~luigi/ ====================================================================