
CSCI 513 ā Spring 2008
Systems Programming and Operating Systems Internals
Assignment 3, 400 points
Due: Wednesday, May 13, 2008.
From what you have learned from your ātoyā device driver, it is now time to
do the complete PCI-DAS08 A to D driver.
ā¢It is a PCI device!
ā¢Your /dev entry should be /dev/das0.
ā¢It should allow only one process to open it at a time.
ā¢You should have a default rate and channel that is reset on a new open().
ā¢Read() should return an integral number of āsamplesā. (Each read should
return a multiple of 4 bytes.) Each sample is returned as a 4 byte integer
value. The most significant two bytes is a 16 bit integer representing the
time offset from the interrupt for when the sample was taken. The value
should be in units of 10ā6seconds. The least significiant two bytes is the
12 bit data value. If no data is available and the driver is sampling, the
user process should block until there is at least one sample available. It
should return EOF (zero bytes read) when there is no more data in your
driverās buffer and the driver is not sampling.
ā¢Write() returns ENODEV.
ā¢Implement an ioctl call for ioctls in the file ā¼phil/public/cs513/dasio.h.
The rate in āset rateā and āget rateā is in units of 10ā5seconds. Channel
numbers are from 0 to 7.
ā¢The program ā¼phil/public/cs513/osc.c will be used for demonstrating your
driver.
Please turn in a printed copy of your source code for your device driver plus
a ādiff -uā of any files you modified. Also, send me in e-mail all your sources
for your das driver. We will use part of the class period for individual demos of
your driver. Students with late assignments will have to make an appointment
to demo their driver.
1