Article View: comp.unix.internals
Article #2633Port of DOS hardware/software to SCO Unix
From: Keith Amann
Date: Fri, 10 Sep 1993 21:47
Date: Fri, 10 Sep 1993 21:47
66 lines
4497 bytes
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
Technical Details
Message-ID:
<CD5r79.26u@stortek.com>Path:
arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!math.ohio-state.edu!magnus.acs.ohio-state.edu!csn!server!otis1.stortek.com!v043332Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fc89c,e391e7a61ff404f2,start X-Google-Attributes: gidfc89c,public X-Google-Thread: 10650a,e391e7a61ff404f2,start X-Google-Attributes: gid10650a,public X-Google-Thread: 1048e3,e391e7a61ff404f2,start X-Google-Attributes: gid1048e3,public X-Google-Thread: f6a6c,e391e7a61ff404f2,start X-Google-Attributes: gidf6a6c,public X-Google-Thread: 10f9b1,e391e7a61ff404f2,start X-Google-Attributes: gid10f9b1,public X-Google-Thread: 100cc1,e391e7a61ff404f2,start X-Google-Attributes: gid100cc1,public X-Google-Thread: 10c7e6,e391e7a61ff404f2,start X-Google-Attributes: gid10c7e6,public X-Google-Thread: 134180,e391e7a61ff404f2,start X-Google-Attributes: gid134180,public X-Google-ArrivalTime: 1993-09-10 17:00:28 PST Newsgroups: comp.unix.internals,comp.unix.programmer,comp.unix.wizards,comp.unix.sysv386,comp.unix.xenix.sco,comp.unix.pc-clone.32bit,comp.unix.sys5.r3,biz.sco.opendesktop,comp.unix.xenix,biz.sco.general Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!math.ohio-state.edu!magnus.acs.ohio-state.edu!csn!server!otis1.stortek.com!v043332 From: v043332@otis1.stortek.com (Keith Amann) Subject: Port of DOS hardware/software to SCO Unix Message-ID: <CD5r79.26u@stortek.com> Followup-To: comp.unix.pc-clone.32bit Summary: Need recommendations for dealing with interrupt routines. Originator: v043332@otis1.stortek.com Keywords: DOS SCO hardware port Sender: usenet@stortek.com Nntp-Posting-Host: otis1.stortek.com Organization: Storage Technology Corp. Date: Fri, 10 Sep 1993 21:47:33 GMT Lines: 66