Article View: comp.sys.next.programmer
Article #1441Implementing select() in an asynchronous device driver. Impossible!
From: Graham Stoney
Date: Mon, 12 Oct 1992 11:02
Date: Mon, 12 Oct 1992 11:02
21 lines
1616 bytes
1616 bytes
I'm having great difficulty writing an asynchronous Unix style device driver running under BSD/Mach/NeXTStep. Are there any asynchronous device driver authors out there that could help me please?. There's zippo documentation on how to do this in NeXT's "Writing Loadable Kernel Servers" manual, and it's proving very difficult. In particular, implementing select() for the driver is a nightmare; the "selwakeup" kernel function is undocumented, and it's operation is different to the same function on other BSDish systems, such as a Sun. The only example code I can find is from the Sun device driver manual, and it appears to have a race condition where the driver could get an interrupt between when the driver's xxselect returns false and the kernel puts the process to sleep; causing the process to hang since it's already missed the chance to selwakeup. Egan and Teixeira's "Writing a UNIX Device Driver" doesn't even come close to describing an asynchronous driver. Is there any hope for me?. Any help would be greatly appreciated, Graham
Technical Details
Message-ID:
<Bw09Bt.HpI@research.canon.oz.au>Path:
arc1-ca.pugleaf.net!sparky!uunet!ferkel.ucsb.edu!taco!lll-winken!elroy.jpl.nasa.gov!sdd.hp.com!uakari.primate.wisc.edu!caen!uwm.edu!spool.mu.edu!sgiblab!munnari.oz.au!metro!mama!greyhamShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!ferkel.ucsb.edu!taco!lll-winken!elroy.jpl.nasa.gov!sdd.hp.com!uakari.primate.wisc.edu!caen!uwm.edu!spool.mu.edu!sgiblab!munnari.oz.au!metro!mama!greyham From: greyham@research.canon.oz.au (Graham Stoney) Newsgroups: comp.sys.next.programmer,comp.unix.internals Subject: Implementing select() in an asynchronous device driver. Impossible! Message-ID: <Bw09Bt.HpI@research.canon.oz.au> Date: 12 Oct 92 11:02:16 GMT Sender: news@research.canon.oz.au Organization: Canon Information Systems Research Australia Lines: 21