Device Driver Skeleton?
Angelo Fraietta
angelo_f at internode.on.net
Mon Feb 14 21:17:28 UTC 2005
angelo wrote:
>
>
>On Fri Feb 11 10:00:51 PST 2005, =?iso-8859-1?Q?Alex?=
><kbyte at iol.pt> wrote:
>
>
>
>>Good Morning Dr Fraietta,
>>
>>
Not Dr yet.
>>At some days ago, I had a doubt concerning writing my first
>>device driver and you said to me to send you an email on the 10th
>>feb. So here I am... Could you help me, please?
>>
>>
OK
>>I already study the console and serial drivers in the rtems
>>distribution and appart from the skeletton of a generic rtems
>>device driver, why do we have to define always a macro like this:
>>
>> #define CONSOLE_DRIVER_TABLE_ENTRY \
>> { console_initialize, console_open, console_close, \
>> console_read, console_write, console_control }
>>
>>
>>Who invoke those functions members, and in what circunstancies?
>>
This is my understanding of what happens. Hopefully, someone will
correct me if I am wrong.
The initisalise function,
console_initialize in this case, is called when the device drivers are initialised.
The Open is when you a file open on this device, the close when you do a file close, the read when do do a read from the file, the write, when you do a write to the file, and I am not sure what the control does.
I have only implemented the initialise because I write to my device direct. I have not implemented a read, or write -- I don't treat my device like a file. I suppose that that is what you have to decide first--whether you want to treat your device like a file or whether you want to write directly from your application
>>Which are the steps to put to work a device driver made by us,
>>or, using the hello world sample how can we put a device driver
>>to work?
>>
>>
I would have a look at an example that uses a COMM port (TTYS1) if you
want to open and close your device like a file.
--
Angelo Fraietta
PO Box 859
Hamilton NSW 2303
Home Page
http://www.users.bigpond.com/angelo_f/
There are those who seek knowledge for the sake of knowledge - that is CURIOSITY
There are those who seek knowledge to be known by others - that is VANITY
There are those who seek knowledge in order to serve - that is LOVE
Bernard of Clairvaux (1090 - 1153)
More information about the users
mailing list