-   Programming (
-   -   linux: easy example of a block device driver? (

eantoranz 11-30-2010 07:51 PM

linux: easy example of a block device driver?

Is there an easy example of a block device driver I could follow as a guide to write my own module?

Thanks in advance.

TheIndependentAquarius 11-30-2010 10:45 PM

See if you can get a translator for this:

I would suggest to get yourself started with some thing very easy like:
  • Writing an interrupt handler for a keyboard (keyboard is a character device)
  • Writing an user space character device driver.
By the above two things you'll come to know what you are heading towards, straightway jumping in the ocean for learning swimming will not help.

Check out this site for further clarifications:

eantoranz 12-01-2010 07:50 AM

Oh, I don't need one. I'm a native spanish speaker. Thanks! I'll take a look at it.

eantoranz 12-02-2010 09:05 PM

Anishakaul! Look, I'm already decoding the sbull driver from that page with my "Understanding the linux kernel" book in hand. :-)

However, when I try to compile it (maybe it's not the best thing to do but....) I get this message:


/home/ubuntu/raid5/r5r/sbull/sbull.c:72: error: expected ‘)’ before ‘*’ token
I think it could be related to the definition of request_queue_t, because I changed it for foo_t and it kept the same error. What do you think?

TheIndependentAquarius 12-02-2010 09:56 PM

That link is not working for me now neither do I have that book in my hand!
and secondly, how do you think that I can "guess" what is the cause of the error without reading the code near "line 72" of "sbull.c" ?

For this error you should start a new thread, with the relevant code, then may be someone can help you!

eantoranz 12-03-2010 09:28 AM

Ok. sbull.c is the code taken from the driver page you told me to follow as such.

You are right on having to open a new thread, though. I'll do it later during the day. Thanks anyway. :-)

All times are GMT -5. The time now is 03:37 PM.