I actually wanted to add a comment to the thread:
but I dont have the "reputation" to do it, it seems, forgive my lack of knowledge of this site. That thread although put on hold was great! great resources since I want to do what the OP wanted to do: learn to program device drivers (and I dont think the question was too general)
Anyway,I am following a lot of that great advice, including reading Linux Device Drivers, Third Edition.
But in this book it is said on page 15
Regardless of the origin of your kernel, building modules for 2.6.x requires that you have a configured and built kernel tree on your system.
and on page 16
So, if you do not yet have a suitable system with a configured and built kernel source tree on disk, now would be a good time to set that up. We’ll wait. Once that task is taken care of, you’ll be ready to start playing with kernel modules.
what does this means??! (I know it is basic, but it is the most basic what is not explained- I already understood the more complicated things)
"A configured and built kernel tree"??
I mean I have a debian system. and I have the source code of the kernel. Which I put on some directory (after untar it) . Do I have to compile this? And even if I compile it, that will produce a "image file" right?? Is that what they mean a "configured and built kernel"?? Isnt it enough my original kernel on which I am working on??
Do I have to recompile the entire kernel when I build my driver? I guess not right?
And what happens if I want to crosscompile (which is my final situation now, but I think I ll keep it to later) , meaning I am developing on a debian system but want to produce the drivers for an embedded ARM uCLinus system? Of course so far I have been able to get the kernel and userland sources, crosscompile them (after configuring them) and write them on the micro but if I want to write a device driver what the "configured and built system" stands for? (and an arm image wont run on a PC right?)
Anyway, lot of questions but I guess it can be summarized on only ONE simple question:
what do I have to do to be able to build the simplest, do nothing example of a driver that all books and tutorials talk about?
thanks a lot for the help