Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi Friends,
I have been trying to learn Linux device driver programming.I have been following LKM Programming guide and Linux Device driver 3rd Edition.But it seems i have no clue of entire process to write a complete driver which i can use to interface the serial port or parrallel port.
I am looking for some concrete document/link/code which can give me a better idea of complete driverdevelopment cycle.
hai ,
iam also a beginer of a device driver program.. if you find any code/ebook/website please share with me to start in a device driver.. i dont have any idea of how to enter into it.. can u guide me in this regard. where to start and proceed to be device driver programmer in linux..
Duplicate thread...
Use the source-code of Linux itself.
It's in /usr/src/linux/drivers/block, probably.
If you are using packages, source-code might be in an optionally installed package.
Hi:
I'm a newbie too and also trying to start in kernel programming. These links (most of it, related with serial port driver) I have found, maybe can help:
(I cannot post URLS yet ;-< ; don't copy&past! )
Other resource to start is www[.]kernelnewbies[.]org Take a look of the mail list, it really can help you a lot!
Of course, the most important (also the hardest way):
/usr/src/linux/drivers/...
(For Serial Port - Generic UART)
/usr/src/linux/drivers/serial/serial_core.c
/usr/src/linux/drivers/serial/8250.c
/usr/src/linux/drivers/serial/8250_pnp.c
please help me in adding a new driver source code into /usr/sr/linux/drivers/ directory..
and what all the files i need to manipulate..
can u take example of adding bnx2.c driver into /usr/sr/linux/drivers/net/ directory .... and what all the changes should be made to make file and Kconfig file...
Please, gentlebeings, save yourself a lot of trouble and start by reading the existing source! I wasn't trying to "blow you off" by saying that.
You're not the first ones on the planet to start trying to write a driver, so it makes no sense at all to try to start from-scratch. The most efficient way to learn is by example, and Linux is by its very nature stuffed with literally hundreds of these.
Find a driver that's as close as possible to the one you need to write. Read all of the source-code systematically and then try to trace a request through it. Try to see what happens when an interrupt comes in.
Keep a diary. If you run into something you don't understand, write it down but keep going. Once you've captured the question on paper you won't forget it and you can pursue it at the most opportune time.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.