🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #2129

Re: 8 bits AND parity, please

#2129
From: Chris Lloyd
Date: Fri, 18 Dec 1992 04:41
46 lines
2592 bytes
In article <1992Dec17.182417.28639@netcom.com> abell@netcom.com (Steven T. Abell) writes:
>a74k110@titan.ucc.umass.edu (Chris Lloyd) writes:
>>With an 8530 manual and a kernel loaded server you're in business.
>>Just somewhat of a pain to do...
>
>My NeXT docs say "It isn't currently possible for third parties to write
>drivers for any on-board interfaces" (Writing Loadable Kernel Servers,
>page 1-1).
>
>If this is no longer true, I'd love to have more information.

Well, as with a lot of the NeXT documentation, it's wrong.  All depending on
the level of hacking you want to go thru you can write a driver for any
of the hardware.  The DSP and serial ports are the easiest IMO to write drivers
for, as all you need is in header files hanging around on the system.

/usr/include/nextdev/zscom.h has the kernel entry points for a driver to
acquire and install interrupts for each of the serial ports. At driver open
you call zsacquire(0 or 1 (a or b), ZCUSER_LOADABLE, intrsw) with
intrsw filled in (see zscom.h) with a tx/rx and line state change interrupt
routine. 'chan' would be the device port (0 or 1).  and zsrelease is done
when the device is close'd.

/usr/include/nextdev/zsreg.h has all the defines you probably need for
accessing the 8530 hardware directly. ZSADDR_A = serial port A's hardware
registers. ZSADDR_B = serial port B's hardware registers. An 8530 manual
would be a must at this stage...  ZSREAD_A et al are handy macros for accessing
the hardware and such.

So, you need a basic kernel loaded server.  When the device is opened you 
install your interrupt routines with zsacquire, when the device is closed
you zsrelease it.  When accessing hardware registers or interrupt routine
acessed variables bracket with
   {
    int level=splscc(); /* next/spl.h */
      /* access whatever */
    splx(level);
   }

To disable interrupts at SCC levels.
And disassembling the MIDI driver and kernel is a good idea for pointers...

la la la,

-- 
::   Christopher Lloyd  ::  a74k110@titan.ucc.umass.edu  ::  Yrrid, Inc.    ::
Technical Details
Message-ID: <BzFuCK.9G3@nic.umass.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!caen!nic.umass.edu!titan.ucc.umass.edu!a74k110
References: <1992Dec15.182315.6970@zetetic.uucp> <BzE0qx.559@nic.umass.edu> <1992Dec17.182417.28639@netcom.com>

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!caen!nic.umass.edu!titan.ucc.umass.edu!a74k110
From: a74k110@titan.ucc.umass.edu (Chris Lloyd)
Subject: Re: 8 bits AND parity, please
Message-ID: <BzFuCK.9G3@nic.umass.edu>
Sender: usenet@nic.umass.edu (USENET News System)
Organization: University of Massachusetts, Amherst
References: <1992Dec15.182315.6970@zetetic.uucp> <BzE0qx.559@nic.umass.edu> <1992Dec17.182417.28639@netcom.com>
Date: Fri, 18 Dec 1992 04:41:07 GMT
Lines: 46