Hi, I want to write some small device drivers. As I read a book on Linux driver, it says that I must download a kernel source tree, build it, before write and load device drivers to the kernel. I would like to know OPENSUSE has the source code to download? Thanks,…[FONT=Birka][size=2]So your first order of business is to come up with a kernel source tree
[/size][/FONT][FONT=Birka][size=2](either from the [/size][/FONT][FONT=Birka-Italic][size=2]kernel.org [/size][/FONT][FONT=Birka][size=2]network or your distributor’s kernel source package),[/size][/FONT]
[FONT=Birka][size=2]build a new kernel, and install it on your system.
[/size][/FONT]
So not specifically intended to write your own kernel driver, you can download the kernel source tree using my bash script here: S.G.T.B. - SuSE Git Kernel Tarball Creator - Version 1.31 - Blogs - openSUSE Forums
and there is more than one version as you will see though still about and for the Linux Kernel. You can read more about the kernel here: openSUSE and Installing New Linux Kernel Versions - Blogs - openSUSE Forums
though this is intended to help compile your own kernel. Here is another interesting Link: https://lkml.org/lkml/2012/11/13/531
and you should do the following before working with the Linux Kernel:
Open YaST / Software / Software Management - Select the View Button on the top left and pick Patterns. Now, you will see several Patterns listed and you want to select:
Development
[X] Base Development
[X] Linux Kernel Development
[X] C/C++ Development
Then Press the Accept button on the bottom right and allow these applications to install.
Thank You,
Thanks for your reply. When I go to the below link, I see each line code preceding with + sign. It is from a repository? Does the author want someone else, like me, to directly copy his code?
Here is another interesting Link: https://lkml.org/lkml/2012/11/13/531
The short answer is that is a patch file, designed to modify existing files and to create new ones, named at the top of the patch, where a plus sign adds lines, a minus sign removes lines and some code indicates where the patched lines start. I some times find it hard to know where the message ends and the patch text file portion starts. There is a terminal command called patch and when you execute the patch text file, you need the kernel source files extracted in some folder and you need to run the patch at some relative folder to the kernel source code. Consider that I do not write kernel driver files myself and don’t claim to know how it is done. I do compile the latest kernel and write scripts and such to load it into openSUSE, determine how to modify its default operations, but that is the extent of my kernel dealings.
I have a new blog on kernel operation here: openSUSE and Installing New Linux Kernel Versions - Blogs - openSUSE Forums
Thank You,
A short answer to this question would be:
The kernel source code is in the package “kernel-source”.
Just install that and you have the kernel source in /usr/src/linux