pakdefender
SENIOR MEMBER
- Joined
- Aug 7, 2009
- Messages
- 5,671
- Reaction score
- -8
- Country
- Location
@cnleio
you can create a development plan for yourself for learning linux device drivers and best way to learn is through writing code, you can learn about linux drivers on a PC as well.
Linux drivers are kernel modules, which have the .ko extension. If you are on a linux machine you can type lsmod at the command prompt, which will show kernel modules that are currently loaded. You can load individual kernel module using modprobe or when you write your own .ko file you can use insmod
Here is tutorial on a 'Hello World' kernel module that you can try on PC running linux
How to Write Your Own Linux Kernel Module with a Simple Example
More complex device drivers start out the same way.
Once you have the basic understanding of the kmodules , then pick an existing driver and study it by enabling debug messages and by putting in printk statements in the source code. For USB the drivers will be as follows
ehci-hcd
ohci-hcd
Then you need to also get an understanding of git , which is the version control program for linux kernel and most other open source software development projects.
You can get the linux source code from kernel.org as follows
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git linux-git
To browse linux code online :
Linux/drivers/usb/host/ - Linux Cross Reference - Free Electrons
Studying the Kernel directly from the source is good for writing drivers , for building root file systems along with the Kernel then Yocto makes the process much more simplified
Keep in mind that you could spend years ( like more than 10-15 years ) learning linux kernel internals and still you may find that there are some aspects that still prove to be elusive.
All the best in your journey
you can create a development plan for yourself for learning linux device drivers and best way to learn is through writing code, you can learn about linux drivers on a PC as well.
Linux drivers are kernel modules, which have the .ko extension. If you are on a linux machine you can type lsmod at the command prompt, which will show kernel modules that are currently loaded. You can load individual kernel module using modprobe or when you write your own .ko file you can use insmod
Here is tutorial on a 'Hello World' kernel module that you can try on PC running linux
How to Write Your Own Linux Kernel Module with a Simple Example
More complex device drivers start out the same way.
Once you have the basic understanding of the kmodules , then pick an existing driver and study it by enabling debug messages and by putting in printk statements in the source code. For USB the drivers will be as follows
ehci-hcd
ohci-hcd
Then you need to also get an understanding of git , which is the version control program for linux kernel and most other open source software development projects.
You can get the linux source code from kernel.org as follows
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git linux-git
To browse linux code online :
Linux/drivers/usb/host/ - Linux Cross Reference - Free Electrons
Studying the Kernel directly from the source is good for writing drivers , for building root file systems along with the Kernel then Yocto makes the process much more simplified
Keep in mind that you could spend years ( like more than 10-15 years ) learning linux kernel internals and still you may find that there are some aspects that still prove to be elusive.
All the best in your journey