Return to BSD News archive
Path: sserve!manuel.anu.edu.au!munnari.oz.au!spool.mu.edu!uunet!mcsun!Germany.EU.net!unidui!du9ds3!veit From: veit@du9ds3 (Holger Veit) Newsgroups: comp.unix.bsd Subject: Re: [386BSD] Reading joystick port Date: 7 Dec 92 08:47:46 GMT Organization: Uni-Duisburg FB9 Datenverarbeitung Lines: 41 Message-ID: <veit.723718066@du9ds3> References: <jboyle.723341435@godzilla.cgl.citri.edu.au> <veit.723370235@du9ds3> <1247@galileo.rtn.ca.boeing.com> Reply-To: veit@du9ds3.fb9dv.uni-duisburg.de NNTP-Posting-Host: du9ds3.fb9dv.uni-duisburg.de In <1247@galileo.rtn.ca.boeing.com> dmp3592@galileo.rtn.ca.boeing.com (Dean M. Phillips) writes: >In article <veit.723370235@du9ds3> veit@du9ds3.fb9dv.uni-duisburg.de writes: ><In <jboyle.723341435@godzilla.cgl.citri.edu.au> jboyle@cgl.citri.edu.au (James Boyle) writes: ><The clean solution is a device driver, say /dev/game. You have to write ><the necessary gameopen, gameclose, gameread, gameprobe, and gameattach ><routines. See the various lpt drivers for hints (and read some books, ><such as Bach, and Leiffler et al.) to understand the driver interface. ><The problem with the game port is that it has no interrupt, so you need ><some small code which periodically (internal kernel timer routines) ><wakes up the driver to sample the game port (once each some milliseconds). >< >>Life is not easy. >< ><Holger >Life is even harder than you think. A standard IBM game port is >operated as follows: An output command triggers a measurement. To get >the measurement you have to sit in a tight loop reading the input port >and count the number of iterations until certain bits change. This is >a VERY bad thing in a multitasking environment. I know that. My reply didn't restrict this. If your sampling is fast enough, you can use it to calculate the pulse period. I agree polling is bad manner for a want-to-be UNIX driver. >IBM: Incompatible Brain-damaged Machinery ;-) Unfortunately. >-- >#include <standard_disclaimer.h> >Dean M. Phillips (206) 393-9333 >Boeing Commercial Airplane Group dmp3592@galileo.boeing.com Holger -- | | / Dr. Holger Veit | INTERNET: veit@du9ds3.fb9dv.uni-duisburg.de |__| / University of Duisburg | "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | | / Dept. of Electr. Eng. | Sorry, the above really good fortune has | |/ Inst. f. Dataprocessing | been CENSORED because of obscenity"