[comp.realtime] Is polling possible with OS9000 device drivers

rhl@computing-maths.cardiff.ac.uk (Robert Hartill) (01/17/91)

Sorry to OS9 newsgroup readers if this is the wrong place to ask.. is there
a comp.os.os9000 ?, does comp.os.os9 also discuss os9000 ?

-------------------------------------

A friend of mine who is new to OS9000 wants to write a device driver for a
programmable I/O controler which does not raise an interrupt on the host PC.

He says that OS9000 doesn't directly support device drivers that poll devices.
He's come up with some sort of solution which he is not entirely happy with.

Sorry I can't give any more details than this,
Any comments ?

While i'm talking OS9000, can anyone recomend a good book on writing device
drivers.

Thanks in advance,
		Robert.
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::     Robert Hartill, Dept Of Computing Mathematics, UWCC, Cardiff, UK.     ::
::          e-mail : rhl@cm.cf.ac.uk         Fax : 0222 371921               ::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
An expert is a man who has made all the mistakes which can be made in a very 
narrow field.  -D.N.H. Bohr
-------------------------------------------------------------------------------

kdarling@hobbes.ncsu.edu (Kevin Darling) (01/17/91)

| A friend of mine who is new to OS9000 wants to write a device driver
| for a programmable I/O controller which does not raise an interrupt on
| the host PC.  He says that OS9000 doesn't directly support device
| drivers that poll devices.

I haven't programmed under OS-9000, but assume OS-9 is close enough :-).
It might help to know more about the controller (SCF device? RBF?)...
this can make a huge difference in polling techniques.  For example:

RBF I/O: do request, then loop for done status, sleeping a tick in loop.

SCF I/O: this is much harder; my first suggestion is to ask if there's
a hardware timer somewhere he can use to trigger a polling irq routine.
Alternatively, a system Alarm could be used (altho I had no luck when
I gave that method a quick shot under OS-9).  A dirtier (but ok) method
would be to directly hook into the os9 clock tick vector and poll the port.

| While i'm talking OS9000, can anyone recommend a good book on writing
| device drivers.

Lots of people have talked about writing such a book.  The best so far
is still the "OS-9 Insights" book from Microware (altho it is mostly 68K,
I'd think that much crosses over).  best - kevin <kdarling@catt.ncsu.edu>

ric@mcrware.UUCP (Ric Yeates) (01/18/91)

Polling people:

Polling is directly supported by OS-9000.  You simply set a couple of
items in the descriptor and POOF!, your driver is a polling driver. 

In OS-9000, polling simply means that if SCF does not already have
enough characters to satisfy a request (from previous calls to the
driver's read routine), it calls the driver's read routine.  If SCF
wants to do some output, it calls your write routine with a buffer of
characters.  Some extra programming may have to be done if you want
type-ahead to work very well though.  (type-ahead == typing characters
when no application is requesting input).  The amount of work is
dependent on the chip and the designer's intentions. 

"Does this system work?" Yes.  The keyboard/monitor driver on the PC is
polling on output, but interrupt driven on input. 

Ric


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Ric Yeates                                             Microware Systems Corp.
  "I found these opinions on the floor, so I don't think they belong
                                                              to Microware."
                         1. Grease Generously
                         2. Wax Philosophically
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

stp@bernina.ethz.ch (Stephan Paschedag) (01/20/91)

In article <1991Jan16.174652.10867@computing-maths.cardiff.ac.uk> rhl@computing-maths.cardiff.ac.uk (Robert Hartill) writes:
>Sorry to OS9 newsgroup readers if this is the wrong place to ask.. is there
>A friend of mine who is new to OS9000 wants to write a device driver for a
>programmable I/O controler which does not raise an interrupt on the host PC.
>
>He says that OS9000 doesn't directly support device drivers that poll devices.
>He's come up with some sort of solution which he is not entirely happy with.
>
>Sorry I can't give any more details than this,
>Any comments ?

I think there are two ways for a solution :

  -  use system state alarms for polling (polling speed is limited to tickrate)

  -  use an external timer for generating the polling frequency (the timer must
     support interrupts).

good luck !

Stephan

==============================================================================
OS/2 & PS/2 : half an operating system for half a computer

Stephan Paschedag                                         stp@ethz.UUCP
MPL AG, Zelgweg 12, CH-5405 Baden-Daettwil     ..!mcvax!cernvax!chx400!ethz!stp
______________________________________________________________________________