home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / next / programm / 7814 < prev    next >
Encoding:
Text File  |  1992-12-20  |  2.5 KB  |  58 lines

  1. Newsgroups: comp.sys.next.programmer
  2. Path: sparky!uunet!caen!nic.umass.edu!titan.ucc.umass.edu!a74k110
  3. From: a74k110@titan.ucc.umass.edu (Chris Lloyd)
  4. Subject: Re: 8 bits AND parity, please
  5. Message-ID: <BzFuCK.9G3@nic.umass.edu>
  6. Sender: usenet@nic.umass.edu (USENET News System)
  7. Organization: University of Massachusetts, Amherst
  8. References: <1992Dec15.182315.6970@zetetic.uucp> <BzE0qx.559@nic.umass.edu> <1992Dec17.182417.28639@netcom.com>
  9. Date: Fri, 18 Dec 1992 04:41:07 GMT
  10. Lines: 46
  11.  
  12. In article <1992Dec17.182417.28639@netcom.com> abell@netcom.com (Steven T. Abell) writes:
  13. >a74k110@titan.ucc.umass.edu (Chris Lloyd) writes:
  14. >>With an 8530 manual and a kernel loaded server you're in business.
  15. >>Just somewhat of a pain to do...
  16. >
  17. >My NeXT docs say "It isn't currently possible for third parties to write
  18. >drivers for any on-board interfaces" (Writing Loadable Kernel Servers,
  19. >page 1-1).
  20. >
  21. >If this is no longer true, I'd love to have more information.
  22.  
  23. Well, as with a lot of the NeXT documentation, it's wrong.  All depending on
  24. the level of hacking you want to go thru you can write a driver for any
  25. of the hardware.  The DSP and serial ports are the easiest IMO to write drivers
  26. for, as all you need is in header files hanging around on the system.
  27.  
  28. /usr/include/nextdev/zscom.h has the kernel entry points for a driver to
  29. acquire and install interrupts for each of the serial ports. At driver open
  30. you call zsacquire(0 or 1 (a or b), ZCUSER_LOADABLE, intrsw) with
  31. intrsw filled in (see zscom.h) with a tx/rx and line state change interrupt
  32. routine. 'chan' would be the device port (0 or 1).  and zsrelease is done
  33. when the device is close'd.
  34.  
  35. /usr/include/nextdev/zsreg.h has all the defines you probably need for
  36. accessing the 8530 hardware directly. ZSADDR_A = serial port A's hardware
  37. registers. ZSADDR_B = serial port B's hardware registers. An 8530 manual
  38. would be a must at this stage...  ZSREAD_A et al are handy macros for accessing
  39. the hardware and such.
  40.  
  41. So, you need a basic kernel loaded server.  When the device is opened you 
  42. install your interrupt routines with zsacquire, when the device is closed
  43. you zsrelease it.  When accessing hardware registers or interrupt routine
  44. acessed variables bracket with
  45.    {
  46.     int level=splscc(); /* next/spl.h */
  47.       /* access whatever */
  48.     splx(level);
  49.    }
  50.  
  51. To disable interrupts at SCC levels.
  52. And disassembling the MIDI driver and kernel is a good idea for pointers...
  53.  
  54. la la la,
  55.  
  56. -- 
  57. ::   Christopher Lloyd  ::  a74k110@titan.ucc.umass.edu  ::  Yrrid, Inc.    ::
  58.