[comp.os.os9] OS-9 68k interrupts

rchampe@hubcap.clemson.edu (Richard Champeaux) (09/15/89)

How does OS-9 68k deal with interrupts.  For instance, say some user adds
some gadget to the system and want's it to produce an interrupt.  How would
the user install his interrupt handler into the system.  The interrupt
vectors are down in low memory where I imagine the OS-9 kernel ROM is, and
therefore can't be changed.  Does OS-9 have hooks in it to get around this?
For example, do the interrupt vectors point to some routine which would then
jump to the interrupt handler?

I just need a general description of the process, not the actual system calls.
My thesis of the moment involves designing a system that OS-9 will eventually
ported to and right now I don't have any info about OS-9.

Thanks,
Rich Champeaux  (rchampe@hubcap.clemson.edu)

davely@mcrware.UUCP (Dave Lyons) (09/18/89)

In article <6472@hubcap.clemson.edu> rchampe@hubcap.clemson.edu (Richard Champeaux) writes:
>How does OS-9 68k deal with interrupts.  For instance, say some user adds
>some gadget to the system and want's it to produce an interrupt.  How would
>the user install his interrupt handler into the system.  The interrupt
>vectors are down in low memory where I imagine the OS-9 kernel ROM is, and
>therefore can't be changed.  Does OS-9 have hooks in it to get around this?
>For example, do the interrupt vectors point to some routine which would then
>jump to the interrupt handler?

Yes, the vectors themselves point to a place in memory where, for every vector,
there is a pea instruction that pushes the number of the vector (since the 
68000 didn't put this in the stack frame like later processors) and a jump
instruction that jumps into the kernel.  The kernel keeps a table of what
interrupt service routines should be called for which vectors.  There can be
more than one service routine using a particular vector and service routines 
are called in order of priority.  A service routine is placed in the table
(called the "polling table") by means of a system state service request.
Among the parameters for the request are the vector number, priority, and 
address of the service routine code.  Service routines are normally added
to the polling table by the initialization routine of a device driver although
virtually any code that runs in system state can add a service routine to
the polling table (i.e. file managers, system state processes, etc.)

-- 
 Dave Lyons - reach him at ...!sun!mcrware!davely                    
 My employer laughs at my opinions.
----------------------------------------------------------------------
 Watch this space for a snappy quote coming soon !