🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.unix.internals
1 messages
1 total messages Started by Keith Amann Fri, 10 Sep 1993 21:47
Port of DOS hardware/software to SCO Unix
#2633
Author: Keith Amann
Date: Fri, 10 Sep 1993 21:47
66 lines
4497 bytes
I have a piece of hardware with software support under DOS.  I wish to
move this piece of hardware to an SCO Unix 3.2.2 environment, along with
the code that is associated with it, running on a AST 486.  
I recognize the fact that the hardware WILL require a device driver of 
some kind, and am already committed to developing it.  The problem is 
concerning the associated 'C' libraries and such that accompany the device.

The situation looks kinda like this (under DOS):

- The library has a function which must be called prior to anything
  else in order to prepare the device, and code settings.  This function
  receives a pointer to a user defined function, which is used for
  "polling" the device (I'll explain the "polling" in a minute).

- The initialization function stores the pointer to the user defined
  function in a global variable for later use.  It then proceeds to
  install an internal interrupt service routine which is called every
  time the device generates an interrupt.

- The internal interrupt service routine alters the state of various
  internal variables, then proceeds to call the user defined function
  through the use of the global variable.

Pseudocode might look like (under DOS):

	FuncPtr UserFunc;

	function initialize ( FuncPtr userFunc )
	{
		UserFunc = userFunc;

		set interruptRoutine = (function isr);
	}

	function isr ()
	{
				.
				.
		"take care of business"
				.
				.
		execute UserFunc;
	}

	then programmer calls "initialize" to set things up.  At interrupt time
	"isr" is called by the operating system.

My question is this, once the device generates the interrupt getting
at it from the Unix device driver is simple enough.  The problem is accessing
the user defined function from within the Unix device drivers xxintr routine,
as far as I know, it can't be done.  What I'm looking for is possible
recommendations on how this situation could be handled, but by making as 
few changes to the existing library interfaces as possible.
I would like to retain the ability to execute a user defined function
at the time of interrupt if possible.  Any suggestions??

-------------------------------------------------------------------------------
Keith Amann, StorageTek                | My views/opinions belong to me, the 
 <Insert some snappy comment here!>    | company isn't responsible for them.
-------------------------------------------------------------------------------
Internet: v043332@stortek.com  VoiceNet: (303)673-4038  FAX-Net: (303)673-2581
-- 
Keith Amann, StorageTek                | My views/opinions belong to me, the 
 <Insert some snappy comment here!>    | company isn't responsible for them.
-------------------------------------------------------------------------------
Internet: v043332@stortek.com  VoiceNet: (303)673-4038  FAX-Net: (303)673-2581
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads