TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Richard wwp
from: Mike Bilow
date: 1996-04-18 17:30:02
subject: OS/2 Device drivers

Richard wwp wrote in a message to All:

 Rw> Doesn anyone know if I have to serialise access to the Open,
 Rw> Close and Ioctl strategy routines in an OS/2 character
 Rw> device driver. I have one that blocks in an Ioctl while a
 Rw> buffer fills up, then the ISR Runs the blocked thread. This
 Rw> works OK until another process opens the driver while the
 Rw> original is blocked. The new process works fine, but the
 Rw> original one seems to deadlock. I stripped the driver down
 Rw> to a very simple dd that has a timer service routine and an
 Rw> ioctl. When the ioctl is called it blocks, then the timer
 Rw> routine ProcRuns after 256 calls; again the same problem if
 Rw> the driver is reopened while the original thread is blocked.

This is kind of complicated.  You have to set the capabilities flags in the
driver to show that it can handle its own open/close management if you
don't want the FS router to do it for you.  You can also return from the
IOCtl call without setting the "done" bit in the request packet,
leaving that job to the ISR.  You can also make explicit calls to the
DevHelp_Yield() service if that proves to be necessary.  Finally, if
absolute maximum performance is needed, you can enable strat2 handling on
your driver and take whole blocks of request packets at once.
 
-- Mike


--- 
* Origin: N1BEE BBS +1 401 944 8498 V.34/V.FC/V.32bis/HST16.8 (1:323/107)
SEEN-BY: 50/99 78/0 270/101 620/243 711/401 409 410 413 430 808 809 934 955
SEEN-BY: 712/407 515 517 628 713/888 800/1 7877/2809
@PATH: 323/107 396/1 270/101 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.