Questions about writing a device driver

Simon Clubley simon-rtems at
Mon Mar 21 13:40:47 UTC 2005


I am looking at writing a device driver and would like to check
several things before I start. The device driver will be a character
style (but NOT tty) driver talking to a PCI controller and will have
outstanding requests from several tasks at the same time.

[BTW, are people aware that the mail list search function does not
appear to be working ? You end up getting an empty screen regardless
of the search query]

1) What is the preferred method for drivers to stall the caller
while waiting for the ISR to trigger on I/O completion ?

It appears to be a choice between waiting on an event or waiting on
a semaphore. (Does the semaphore have a potential race problem with
the ISR firing between the I/O been issued and the caller stalling
on the semaphore ?)

2) Does the rtems_device_driver_entry (ie read_entry) execute within
the context of the calling task so that the driver can stall two
seperate tasks with overlapping I/O requests by using the same event
number ?

3) If you use mknod to create a device node /dev/simon with the
major number of the device driver, can you access the device using
the C open/close/read/write RTL calls, or do you have to use
rtems_io_read and friends ?

Thanks for any information,


Join Excite! -
The most personalized portal on the Web!

More information about the users mailing list