home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!rphroy!caen!batcomputer!cornell!uw-beaver!uw-coco!mdisea!mdivax1!van-bc!rwsys!root
- From: root@rwsys.wimsey.bc.ca (Superuser)
- Newsgroups: comp.os.coherent
- Subject: Re: game port driver code?
- Message-ID: <92121815346@rwsys.wimsey.bc.ca>
- Date: 20 Dec 92 04:16:45 GMT
- References: <1992Dec11.205204.14437@sequent.com>
- Organization: RWSYS Exporter BBS system
- Lines: 48
-
- patbob@sequent.com (Patrick White) writes:
- > Does anyone have any code for reading joysticks from the gameport under
- > Coherent? A device driver or program code would be fine.
- >
- > I've got info on what needs to be done and don't want to reimplement it
- > if I can avoid it. Any ideas on how to implement it would be welcome too (eg.
- > how to turn off task switching while in the busy wait loop, timers and the ilk
- > I might be able to use, more efficient ways to access the I/O port than
- > /dev/kmem, etc.)
- >
- > If I decide it's too much for me to do, I'll summarize if there is
- > interest.
- >
- > thanks,
- > Pat White (patbob)
- > --
- > Pat White (patbob@sequent.com, work: (503) 578-3463)
- >
- You will need a device driver. You can't create a dos-style event loop
- that reads the hardware and then loops again because application (user)
- level software is 'protected' and cannot read/write directly to hardware.
-
- The DDK allows a device driver to use the timeout() function with
- 10 millisec granularity. Or you can sit in an event loop in a device
- driver ( but it really makes the device driver useless if any sort
- of multitasking or multiuser stuff is needed. It could also screw
- up things like serial port access and disk drive access to monopolize
- the processor in an event loop. )
-
- The physical operation of the game port ( ibm version ) is so simple
- that a device driver should be easy to write. According to my
- literature, all you have to do is write to 0x201 and then keep
- checking back for the the amount of elapsed time before the bit
- corresponding to the joystick goes low.
-
- The only possible problem is coherent's 10 millisec granularity. If
- it is too long, the read_t0() function can offer shorter timing
- but at the cost of a bit more complexity.
-
- One way or another, however, you'll need the DDK.
- Randy Wright
-
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- root@rwsys.wimsey.bc.ca (Randy Wright) | Exporter BBS 2400 bps
- or | (604) 581-0518 8N1
- Randy_Wright@Mindlink.bc.ca | uucp ogin: uguest
- | interactive login: guest
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-