ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
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, I am a fresh man, and I am very interesting in linux kernel programing. I want to ask a question that how can I access this programing easily and effectively.
Thanks for all of you!
Last edited by gschen2010; 01-08-2011 at 09:08 PM.
Click here to see the post LQ members have rated as the most helpful post in this thread.
hi, I am a fresh man, and I am very interesting in linux kernel programing. I want to ask a question that how can I access this programing easily and effectively.
The Linux kernel uses the C (not C++) programming language; unless you are familiar with it, you won't be able to get much out of the source code. Please don't ask the kernel developers to teach you C, that would be extremely rude.
The C source for the Linux kernel is available at kernel.org. The gitweb link will show you the latest changes applied; click the tree link to browse the entire source code tree.
Various distributions like Debian, Ubuntu and Fedora use a specific version of the Linux kernel, with a number of "patches" applied. These patches are also available, but from the distribution itself; they are mostly bug fixes and sometimes new device drivers backported to work on the "older" kernel used by the distribution. Distributions do this "stabilization" work in order for users to get all bug fixes, but otherwise as few changes as possible. (This is actually quite beneficial for all, including users: we get rapid development from the vanilla kernel developers, and also stabilization and bug fixes from the distribution kernel maintainers!)
You might get most benefits for yourself by first installing a user-friendly Linux distribution such as Ubuntu on your computer. Personally, I use Xubuntu, but do pick whichever you feel best suited for you. There is a large list of Linux distributions at Distrowatch.com. Then, after familiarizing yourself with it, install the linux-source package (name might vary in other distributions), to get the kernel source code for the kernel version you're running.
You can also install Linux easily in a virtual machine; personally I use VirtualBox. (It's best installed via the distribution's own package manager, just like almost all software. Don't ask me how to use it in Windows; it don't touch that stuff.) With a virtual machine running a Linux distribution, and either another virtual machine or your "real" workstation running the same distribution, you can make changes to the kernel sources, recompile it in minutes, install the new kernel into a virtual machine, and run your customized kernel, without ever rebooting your computer, and never interrupting your work flow.
Although Linux is open and free, don't expect it (especially the kernel) to be simple. If you want to really understand and work with it, you'll have to invest a lot of time learning it. (To be honest, you'll probably spend more time initially in "un-learning" stuff, in learning that there are multiple ways to do things - and the way you do it with Windows is often not the best way to do it in Linux.) In my experience the time is well worth the effort, though
Nominal Animal
Last edited by Nominal Animal; 03-21-2011 at 01:41 AM.
The Linux kernel uses the C (not C++) programming language; unless you are familiar with it, you won't be able to get much out of the source code. Please don't ask the kernel developers to teach you C, that would be extremely rude.
The C source for the Linux kernel is available at kernel.org. The gitweb link will show you the latest changes applied; click the tree link to browse the entire source code tree.
Various distributions like Debian, Ubuntu and Fedora use a specific version of the Linux kernel, with a number of "patches" applied. These patches are also available, but from the distribution itself; they are mostly bug fixes and sometimes new device drivers backported to work on the "older" kernel used by the distribution. Distributions do this "stabilization" work in order for users to get all bug fixes, but otherwise as few changes as possible. (This is actually quite beneficial for all, including users: we get rapid development from the vanilla kernel developers, and also stabilization and bug fixes from the distribution kernel maintainers!)
You might get most benefits for yourself by first installing a user-friendly Linux distribution such as Ubuntu on your computer. Personally, I use Xubuntu, but do pick whichever you feel best suited for you. There is a large list of Linux distributions at Distrowatch.com. Then, after familiarizing yourself with it, install the linux-source package (name might vary in other distributions), to get the kernel source code for the kernel version you're running.
You can also install Linux easily in a virtual machine; personally I use VirtualBox. (It's best installed via the distribution's own package manager, just like almost all software. Don't ask me how to use it in Windows; it don't touch that stuff.) With a virtual machine running a Linux distribution, and either another virtual machine or your "real" workstation running the same distribution, you can make changes to the kernel sources, recompile it in minutes, install the new kernel into a virtual machine, and run your customized kernel, without ever rebooting your computer, and never interrupting your work flow.
Although Linux is open and free, don't expect it (especially the kernel) to be simple. If you want to really understand and work with it, you'll have to invest a lot of time learning it. (To be honest, you'll probably spend more time initially in "un-learning" stuff, in learning that there are multiple ways to do things - and the way you do it with Windows is often not the best way to do it in Linux.) In my experience the time is well worth the effort, though
... The Linux kernel uses the C (not C++) programming language ...
This is correct, but requires a clarification. The language is neither C89 (ANSI "C"), nor C99, but GNU dialect of "C". I.e. to compile Linux kernel one needs 'gcc' and not just any standards compliant "C" compiler.
This is correct, but requires a clarification. The language is neither C89 (ANSI "C"), nor C99, but GNU dialect of "C". I.e. to compile Linux kernel one needs 'gcc' and not just any standards compliant "C" compiler.
Right. Some compilers (Intel Compiler Collection and Open64) are GCC-compatible enough to compile a working kernel, but it is not recommended at all; there might be bugs nobody has noticed yet in the end result. And development versions of GCC often fail to build a working kernel.
You should use the stable GCC version that your Linux distribution provides to compile the kernel. It should be what the distribution maintainers have used to compile the distribution kernel. On Debian (and variants like Ubuntu), you can use the make-kpkg script (part of kernel-package) to build installable kernel packages with just one command. (You don't have to use the distribution sources or patches, it works fine with kernel sources downloaded from kernel.org.)
If you are unsure, the file Documentation/Changes in the Linux kernel sources describes the versions of tools needed to compile the kernel on Linux; those, or any later stable (not development or beta) versions should be okay, unless the file says otherwise. There is also Documentation/HOWTO to help aspiring kernel developers further along.
Nominal Animal
Last edited by Nominal Animal; 03-21-2011 at 03:21 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.