[comp.unix.microport] Device Drivers under Microport

plocher@uwspan.UUCP (John Plocher) (12/31/87)

[ This is a reply from John Sully at Microport in regards to a question about
  interrupts and device drivers -John ]

From: John M. Sully <uwmacc!ll-xn!ames!amdcad!suprt!jmsully>
In-Reply-To: Message from "Michael Grenier" of Dec 2, 87 at 2:21 am

>eoi(level)
>	Very Important!  In a device driver interrupt routine,
>	there is one argument, the interrupt vector number.
>	eoi() must be called with this number before any more
>	interrupts may occur.  It is wise to call the appropriate
>	spl routine first.

eoi() is called with the *vector* number, which is the parameter passed to
the device driver.  This reenables interrupts at higher spl's and should be
called as soon as possible after you enter your driver interrupt handler
routine (in 2.3 it is called by the kernel *before* your device driver
is entered).

>The part of all this that gripes me is when I called the tech support
>(Yes, I paid for my hotline service) the guy tells me that I have to
>sign a device driver support contract with Microport for $100/hr !!!

This is correct, in general we require a special support contract for 
people who wish assistance with writing their device drivers, this contract
gets them consulting time with our engineering staff, rather than the tech
support staff.  Since this is a fairly simple question, however, we can
answer it within the support department and there is no need for the driver
support service.

>He didn't know hardly anything about device drivers and I couldn't
>get the basic information on even what the routines were.  The
>tech support person told me that the device driver chapter was in fact only 
>for installing canned device drivers and linking them, not for actually
>writing them. How disgusting.

The device driver chapter is supposed to provide guidance for writing device
drivers, although, being a first cut, it does need improvement.

>Take a look at the file linkkit/doc/link.doc. Can I call printf
>within an interrupt routine (does it talk right to the screen hardware
>or does it issue a sleep somewhere hanging the system?) How should
>these routines be declared? as int() ?  Obviously, some return
>chars, some probably return nothing -

printf can be called from within an interrupt routine, it talks directly to
the console driver.  Many do return ints, others return pointers.  You 
should look at the example drivers to see how these are used.

--
John M. Sully         UUCP: ...!{sun | ucbvax | ihnp4}!amdcad!uport!techs
Microport Systems     ARPA: uport!techs@ucscc.UCSC.EDU
Technical Support         

-- 
Submissions to microport@uwspan with a Subject: line  containing one of:
	    Post, 386, 286, Bug, Source, Merge, 6300+
	  "Send Buglist", "Send Version", or "Send Info"
(UUCP: ...!uwvax!uwspan!microport & ...!uwvax!uwspan!microport-request)