Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Feb 1997 20:27:53 -0500
From:      "Brian J. McGovern" <mcgovern@spoon.beta.com>
To:        patrick collins <pc012@seqeb.gov.au>
Cc:        hackers@freebsd.org
Subject:   Driver question on interval execution (polling?)
Message-ID:  <199702240127.UAA04260@spoon.beta.com>
In-Reply-To: Your message of "Mon, 24 Feb 1997 10:58:14 %2B1000." <Pine.3.89.9702241008.A14703-0100000@svbyo4.seqeb.gov.au> 

next in thread | previous in thread | raw e-mail | index | archive | help
I'm glad you appreciated the post. Unfortuately, I am using the documentation
as a learning tool for myself as much as anything, and I'm strugging to master
the interface myself.

Based on my reading of several device driver books, I am aware of a mechanism
to be able to have the kernel re-enter a particular function after a certain
time period is past. Using this system, you should be able to do your
poll, and then implement the required code so the function will be restarted
some time in the future, and then it should terminate.

As I don't have my documentation handy (and I've yet to figure out how
the docs I do have would apply to FreeBSD specifically), I am forwarding 
the message to the FreeBSD hackers list, so that perhaps someone with a bit
more insight and experience can describe any existing mechanism, or perhaps
a better way to handle the case - and can post a response to both of us,
so you may have your answer, and I can document the feature when I see the
feature as being useful.
	-Brian

> I really appreciated your example device driver. Your explanation was 
> very easy to understand and I look forward to further posts on this 
> subject.
> 
> I am particularly interested in writing a device driver for a 
> digital I/O card I have. This card consists of a couple of 8255 PIO's. I 
> would like my device driver to be able to configure one 8255 for input 
> and the other for output. I would like the device driver to be able to 
> read the inputs every n milliseconds in order to be able to count a 2 Hz 
> pulse train on these inputs.
> 
> I have a fairly general idea on how to go about this but would appreciate
> any pointers you might have, especially in the area of how to get the device 
> driver to continually read the input ports without the intervention of the 
> application software.
> 
> -----------------------------------------------------------------------------
> Patrick Collins - Load Survey Technician           email : pc012@seqeb.gov.au
> South East Queensland Electricity Corporation      phone : +61 7 3407 5954
> Blinzinger Rd, Banyo, 4014                         fax   : +61 7 3407 5454
> Queensland, AUSTRALIA (Best State, Best Country)   Viva el Cristo Rey !
> -----------------------------------------------------------------------------



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199702240127.UAA04260>