News for hackers. Stuff that matters.
Re:Linux kernel exceeds 15 million lines of code by gizzlon on Friday January 13, 2012 @08:52AM (#3460499)
Would be interesting to see comparable numbers for other operating systems.
Re:Linux kernel exceeds 15 million lines of code by ch0wn on Friday January 13, 2012 @08:58AM (#3460518)
There are some numbers available on Wikipedia[0]. Comparing with Windows is especially difficult though, because there is no differentiation between the kernel and graphical systems or system tools.

[0] http://en.wikipedia.org/wiki/Source_lines_of_code#Example

Re:Linux kernel exceeds 15 million lines of code by 4ad on Friday January 13, 2012 @09:39AM (#3460675)
I've worked on Windows. I never really did a thorough analysis, but I'd say kernel mode components total around 3MLOC (out of ~50MLOC total). Definitely smaller than Linux.
Re:Linux kernel exceeds 15 million lines of code by __alexs on Friday January 13, 2012 @09:54AM (#3460746)
Presumably there aren't all that many device drivers in there though? I'd imagine that mostly lived off in a WHQL repo or something in a different department.
Re:Linux kernel exceeds 15 million lines of code by 4ad on Friday January 13, 2012 @10:18AM (#3460865)
Drivers made by Microsoft are in the tree. WHQL'ed 3rd party drivers offered by Windows Update are somewhere else, but there's no source for those so it's hard to count lines of code.

On a typical computer more than half of the drivers loaded are made by Microsoft, you can check easily with sysinternals' autoruns.

Re:Linux kernel exceeds 15 million lines of code by rplnt on Friday January 13, 2012 @11:44AM (#3461244)
And they are in the kernel? What are dozens of .sys files in drivers folder then?
Re:Linux kernel exceeds 15 million lines of code by Someone on Friday January 13, 2012 @01:11PM (#3461643)
There are at least three different definitions of "in the kernel":

- code that compiles to the single executable file that runs the OS (this can be limited to a mechanism for booting the system, a thread scheduler, basic memory allocator, but this may also contain some device drivers, file systems, etc)

- any code that compiles to anything that will run in kernel mode (many file systems and device drivers)

- the code that someone (say the people distributing what they call "the Linux kernel") call the kernel.

This count is about the third. I do not think it contains a kitchen sink, but it is close :-)

Re:Linux kernel exceeds 15 million lines of code by sciurus on Friday January 13, 2012 @12:22PM (#3461424)
I've got a lot of .ko files in /lib/modules; that doesn't mean they aren't part of the kernel.
Re:Linux kernel exceeds 15 million lines of code by easp on Friday January 13, 2012 @12:29PM (#3461463)
Linux supports a wider range of hardware than Windows.
Re:Linux kernel exceeds 15 million lines of code by 4ad on Friday January 13, 2012 @12:41PM (#3461501)
Sure, I'm just offering some stats for comparison, I'm not trying to say anything in particular.
Re:Linux kernel exceeds 15 million lines of code by easp on Saturday January 14, 2012 @02:56AM (#3463766)
Yup, and I'm just adding something to consider when interpreting it.
Re:Linux kernel exceeds 15 million lines of code by obtu on Friday January 13, 2012 @09:10AM (#3460548)
On the other end of the scale, the Debian lenny archive (released in 2009, superseded by squeeze) totals about 324M lines of non-comment code: http://gsyc.es/~frivas/paper.pdf
Re:Linux kernel exceeds 15 million lines of code by dhughes on Friday January 13, 2012 @11:25AM (#3461159)
Thanks, I was just going to ask what is considered a line it sounds silly but I couldn't understand if a "line" was the full length of a screen at a certain resolution no matter if it was filled with characters. I know a space (spacebar) is a character too but not the blank space before you enter space character.

I'm not a programmer but I know you can cram certain methods, functions onto one line instead of arranging it on separate lines for easier comprehension by other programmers. As well comments and blank lines would add a lot depending on the style of the programmers doing it and if a blank line is considered a line.

Logical SLOC and physical SLOC make sense.

Re:Linux kernel exceeds 15 million lines of code by Game_Ender on Friday January 13, 2012 @09:13AM (#3460554)
Especially the driver breakdown, since many other kernels don't ship with the same number of drivers that Linux does.