Monday, April 20, 2009

How The Kernel Development Process Works ?

Just wondering how the kernel development process works ? Check out this article ....




There seems to be a lot of misunderstanding about how code actually gets into the Linux kernel. People are claiming that code can just get "slipped into" the main kernel tree without realizing where it really came from, or without any sort of review process. Obviously they have never actually tried to get a major kernel patch accepted, otherwise they would not be making these kinds of claims :)

First, what do we mean when we speak of a "patch"? In order to get any kind of change accepted into the kernel, a developer has to generate something called a "patch" and send it to the maintainer of the code they are changing (more on that process below.) To do this, they make the changes needed to the specific part of the kernel that they wish to modify, and then run a tool called 'diff'. This tool generates a human readable file that shows exactly what lines of code were modified, and what they were changed into. A very simple example of this can be seen here:

--- a/drivers/usb/image/microtek.c
+++ b/drivers/usb/image/microtek.c
@@ -335,7 +335,7 @@ static int mts_scsi_abort (Scsi_Cmnd *sr

mts_urb_abort(desc);

- return FAILURE;
+ return FAILED;
}

static int mts_scsi_host_reset (Scsi_Cmnd *srb)

This shows that the file, drivers/usb/image/microtek.c had one line of code changed. From:

return FAILURE;

to:

return FAILED;

This bit of text can then be emailed to other people, who can instantly see that yes, it only changes 1 line of code, and yes, this is probably a correct thing. Then they run another program called 'patch' and give it this bit of text. The patch program then modifies the specified file in the specified way. Because the developer uses the program 'patch' to apply this bit of text, the bits of text themselves have come to be called 'patches'.

All Linux kernel development is done by sending patches though publicly posted email. If you take a look at the main Linux kernel development mailing list, you will see hundreds of these patches being sent around, discussed, critiqued, and even accepted, into the main kernel tree. This is how kernel development is done.

...


Reference : http://www.groklaw.net/article.php?story=20050529095918381

No comments: