Linux Kernel Surpasses 10 Million Lines of Code
javipas writes "A simple analysis of the most updated version (a Git checkout) of the Linux kernel reveals that the number of lines of all its source code surpasses 10 million, but attention: this number includes blank lines, comments, and text files. With a deeper analysis thanks to the SLOCCount tool, you can get the real number of pure code lines: 6.399.191, with 96.4% of them developed in C, and 3.3% using assembler. The number grows clearly with each new version of the kernel, that seems to be launched each 90 days approximately."
That the line count increases with each new version unless you are starting from scratch?
--
Oh Well, Bad Karma and all . . .
Beer is proof that God loves us and wants us to be happy.
And how much of this lines are for core functions (Memory Managements, Scheduler, etc) and for drivers (USB, Filesystem)
Â_Â
it growz like cancers
AND???
In other news, trees tend to grow up unless they tend to grow down or sideways. Sharks tend to eat anything they can, unless they are not hungry.
Anonymous will beat me to FP for sure, unless they dont.
NO SIG
Too bad 9,999,999 lines of that code were ripped off from SCO.
Lines of code is not a good metric for performance. I'm in a software engineering class listening to how to use metrics on code.
Weren't people whining about NT's kernel having an excessive amount of code? Yet this article treats the 10 million lines as if it were a good thing (not that it isn't; code size doesn't reflect on code quality)
*cough*assembly*cough*
"assembler" is the tool, not the language.
"When life gives you lemons, don't make lemonade. Make life take the lemons back!" -- Cave Johnson
I wonder how many lines of code Windows has
Because we'd all like to know how many man-months something a big as the linux kernel should take to implement. And laugh at the huge price tag sloccount will put on it.
“Common sense is not so common.” — Voltaire
I'm a developer and was wondering what kind of testing is done to verify the code. Do they use unit testing? Regression testing?
I'm just curious because keeping 6+ million lines of code almost completely bug free is pretty amazing.
It's significantly easier to hide a malicious backdoor inside a huge software project than a small one. Linux has already had a near miss back in 2003, when the CVS repository was compromised. Considering how many mission-critical applications run under Linux, there's a huge financial incentive to hide a backdoor somewhere in those 10 million lines.
Now, where do we find a birthday cake with ten million candles?
15. The Residents - Not Available
If Obama is missing that record, I'd be glad to lend him my copy.
Momentarily, the need for the construction of new light will no longer exist.
96,4% of them developed in C, and 3,3% using assembler
That leaves .3% that is unaccounted for. What was it written in?
Damn_registrars has no butt-hole. Damn_registrars has no use for a butt-hole.
Mods, get a clue, this is not flamebait.
I mean, a story about a piece of actively developed software growing in lines of code is like publishing a book about how much shit does humanity make per person born and then sayin: hey, we are shiting so much more than we used to.
Well, yeah, duh.
NO SIG
May I suggest that large parts of this shouldn't be in the kernel at all? That there should be independent sub-systems so that in the event of a crash or panic, the entire OS doesn't come tumbling down?
So that badly written drivers (especially graphic card drivers) don't affect the stability of the entire system?
May I suggest that flame-wars are good and the EMACS is also bloated?
(And lots of other folks have already talked about the bad metric that lines of code is...)
I wank in the shower.
This raises the question - will Linus run out of magic powder?
Take the cheese to sickbay, the doctor should see it as soon as possible - B'Elanna Torres, "Learning Curve"
It's called a lameness filter because it's pretty lame. Try pasting the definition of a word from reference.com, or the lyrics to a longish song. Or a joke that relys on caps to be funny.
The lame mess filter won't let you.
Free Martian Whores!
Since that many lines = approx. 125,000 pages, which = approx. 0.0175 terabytes, and... a LOC is approx. 18 TB, I'd say they have a ways to go...
I wonder what the breakdown is of the almost 4 million lines that were omitted in the count, for blank lines, comments, etc.? I've always said that commenting your code is a very good thing to do, so it would be interesting to see what the percentage of this is comments, as opposed to blank lines (which isn't a bad thing for readability).
Attention all planets of the Solar Federation! We have assumed control! - Neil Peart
You cared. At least enough to add a comment...
Contentment is the greatest wealth
- Sukhavagga Dhammapada
Contentment is the goal behind all goals.
You don't want to know.
how do I buy a copy?
Interestingly only a year ago the i386 and x86_64 trees merged into one, greatly reducing the SLOC count at the time.
Basically, this story is "Linux kernel surpasses 10 million lines of code! Just kidding."
Funny that the summary calls attention to the fact that the number of lines includes comments and whitespace without any mention of how worthless lines of code is as a metric. Someone could easily go in and add or remove newlines wherever they wanted and without changed a bit of code make it 50 million or 50 thousand.
Whale
I wonder what grade b0ttle is in.
[Remember, this isn't a punch, just a simple question. I mean, ZOMG, get a grip.]
I'm a COBOL programmer and that's all we ever counted by
Remember, the 10M lines is just the kernel in Linux, not an entire distro (ie: kernel + GNU stuff + X + apps + all the other stuff), so a total count of Windows LOC would be comparing apples and oranges.
IE: How many LOC are in NTOSKRNL + Drivers would be a better comparison.
6.399.191, with 96,4% of them developed in C, and 3,3% using assembler.
Way to mismatch periods and commas there.
Sorry everyone, that was me! Silly push %ebp ... Apologies to all...
This article summary is not very informative. The very least they could do is tell us which ten million lines of code Linux has surpassed.
Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
The better metric would be how many Libraries of Congress the kernal is.
Perhaps better would be number of times the size of the Unix System 6 kernel.
That's the one that the University of Waterloo printed as a textbook, half of a two book set. (The other book was the OS course text using it as the example.) They printed it at 50 lines per page column and added (lots of) whitespace and adjusted comments so routines fell on nice page boundaries. Even padded this way it came out to a total of ten thousand lines (of which I think 2 thousand were still in assembly code). Just right for one person to maintain full-time by the then-current rule-of-thumb.
So the linux kernel is a thousand times the size of that (whitespace-padded) version of the Unix kernel.
Bantam Dominique roosters crow a four-note song. Once you've heard it as "Happy BIRTHday" you can't NOT hear it that way
Has anyone noticed this in the SSH section?
IF SSH user = "billgates" AND password = "linuxsux" THEN login with user = root.
I'm no expert, but it looks like that around line 3,098,200 there's some stuff after that to cause video drivers to randomly fail and something that e-mails all keystrokes to a POP box in Redmond...
My favorite quote doesn't fit into 120 characters. Now no one will like me.
Damnit, after decades people still can't get this language name right.
The language is called assembly, assembler is the tool you use to translate it into a program. In other words an assembler is to assembly what a compiler is to a higher level language like C.
i believe a more appropriate measure of the 'bloat' (i.e. useless functions) or the size of any software package is through function point analysis--
http://en.wikipedia.org/wiki/Function_point
http://www.softwaremetrics.com/fpafund.html
the lines of code metric has long been considered an inadequate measure of software cost, complexity, or size - here is an article on why:
http://www.creativyst.com/Doc/Articles/Mgt/LOCMonster/LOCMonster.htm
but LOC is without question one of the easiest measurement (aside from total package size in bytes, which is nearly as uninformative)
let's see now. 10 years ago the battle cry of linux over Windows is that it's leaner. leaner being meaner and faster. now with all that unnecessary bloat code, what's linux's battle cry now?
This only proves that the Linux Kernel is in need of a significant refactoring effort. The capacity for any single developer to understand or even read a significant portion of this code is NIL. As a result, the opportunity to reduce duplication of effort is quickly diminishing, and the ability of new users to contribute anything other than additional bloat is similarly diminishing. And while the core of the kernel may be "small", and much of this code is dealing with special cases for specific hardware, because of the size of the code involved it is increasingly difficult to identify what is substantial and what is merely stylistic differences between two drivers. Increasing LOC counts is a sure sign of under analysis and over reliance on the availability of cheap labor. You can pick any arbitrary number of lines of code (less than say 20k) and pick that as the number of lines the kernel should occupy. As an individual line may define a new abstraction, LOC represent a potential for a geometric increase in complexity. So either these 6-10 million lines of code represent some truly staggering level of irreducible complexity (most unlikely), or are merely the result of not refactoring the code sufficiently (most likely). This really is a milestone in gratuitous complexification that should be morned, not hailed.
If you're actually serious, (sarcasm is kind of hard to detect in plain text): man modprobe. Since Linux 2.0.
10 million lines is all well and fine, but more importantly what's the fuck count up to now?... Yeah, yeah,okay I know. run --> grep -r 'fuck' /usr/src/linux* and count it up for myself... Sheesh!
Bitkeeper, yes. Git, yes. But CVS?
Comments are also code.
If you only count as code what can be feed to the machine, you should only count the compiled binary. Source code is meant to be read by *humans*, so comments do count.
Singularity: a belief in the "God" idea with the "demiurge" relation inverted.
Comments are also code.
If you only count as code what can be feed to the machine, you should look at the size of the compiled binary. Source code is meant to be read by *humans*, so comments do count. That's why the GPL requires them to be left in the files (the "preferred form" to edit), otherwise it wouldn't be source code.
Singularity: a belief in the "God" idea with the "demiurge" relation inverted.
How can anyone keep up with this volume of code? As a simple vb coder myself I can't imagine wrapping your mind around this much code.
i'm sorry, how the fuxk is this news? 10 million lines, whoop-de-freakin'-do. Windows (probably) has more lines than that, and THAT'S not even news...more lines. more bloat.
slow news day?
the significance of a signature is insignificant
Ok, 10 million, or 6 million lines of code... time to switch to a better system, Minux 3 (http://www.minix3.org) which has about 4 thousand lines of code in the kernel.
Clearly the Linux Kernel is now a mega monolithic kernel joining the ranks of Windows NT and other bloatware. Sad day for open source.
I downloaded the latest 2.6.27.2 tarball, untarred it, removed all except the "x86" folder from under the "arch" folder and ran this in the source root:
find . -exec grep -v "^$\|^\*\|^#" {} \; | wc -l
to exclude blank lines, lines starting with "#" for comments and lines starting with "*", again for comments. I realize that this excludes the "#include" statements but there number should be negligible in the overall count.
The result is 6,022,957.
The Windows kernel might have a lot less, after all, it doesn't support nearly as many devices or architectures.
Climate Progress - Hell and High Water
Windows XP's OS code was about 6 Million LOC (Line of Code) while whole system had over 40 million LOC. How many LOC Windows Vista has in it's Operating System... mayby a 6-10 while the whole system might has over 40-60 million LOC?
We can really start believing what are the reasons for OS what is based to microkernel, while the monolith OS is HUGE to maintain...
"Round numbers are always false."
-- Samuel Johnson
apparently there was a bk to cvs gateway of some sort
Climate Progress - Hell and High Water
Since that many lines = approx. 125,000 pages, which = approx. 0.0175 terabytes
and "approx. 0.0175 terabytes" == approx 18 GB which explains why the kernel source's tarball weighs 48 MB. Yup, if you wanted to know how big the kernel source is you just had to look for it ;-).
Besides, I really wonder how you got to that figure, considered how code has little in common with classically formatted text anyways. Not to mention how 125,000 pages == 18 GB, I mean do you have 150,000 characters per page (2,000 lines per page?)?
You just got troll'd!
They must be getting paid by the line.... no, wait...
oh, they oustourced it to India by the line... no, wait...
They love writing code.
Yeah, that's it. Makes sense now.
Whoever they is.
deleting the extra space after periods so i can stay relevant, yeah.
We can really start believing what are the reasons for OS what is based to microkernel, while the monolith OS is HUGE to maintain...
Except that I seriously doubt this number is LOC for the kernel itself - this undoubtedly includes drivers and other loadable modules. The number of LOC for the kernel itself, excluding loadable modules, is much less. Linux cannot seriously be called "monolithic".
-- Ed Carp, N7EKG erc@pobox.com PGP KeyID: 0x0BD32C9B What I'm up to: http://intuitives.mine.nu
The old-(and probably close to obsolete) Linux kernel is only 10 million lines of code, while the young and hot Android OS has 20 million lines of code??
Christ.. thats just silly. What ever happened to people being efficient?
How much legacy garbage is still floating around in there?
---- Booth was a patriot ----
Personally, I prefer downwards of women, but if only upwards are available, that's fine, too.
Linux cannot seriously be called "monolithic".
Well it can't be called a micro-kernel. And the notion of a "hybrid-kernel" is a joke. It's squarely in monolithic town.
the real number of pure code lines: 6.399.191, with 96.4% of them developed in C, and 3.3% using assembler.
Personally I thought the news was that no one knows what 0.3% of the linux kernel is written in. THAT'S news! (I'm betting it's BASIC).
10. Embossed, signed paper Certification of Live Birth -- Not Released
Are you trying to imply that he was born dead, and is some kind of zombie hitherto unknown to man? That would certainly explain why he hasn't released his medical records.
Of course, not being a complete raving loony would also be a fair reason for not releasing your medical records. Has your expectation of the privacy celebrities should be afforded sunk so low?
Back in the day when Windows NT first reached over 3.5 million lines of code this was used by Linux fanbois as proof positive that NT was a bad operating system. So I guess this means that Linux is now three times worse.
It's COBOL, that crap is still just everywhere.
In Capitalist America, bank robs you!
for those programmers who try to refactor and reuse existing code to try and reduce the number of LOC while maintaining all the needed functionality. That would truly be something to write about
"If we wish to count lines of code, we should not regard them as lines produced but as lines spent." --Edsger Dijkstra
No, he is trying to imply that Barack Hussein Obama was not born in the United States, thus rendering him ineligible for the presidency.
Out of all those things, a certification of his birth would hardly be a violation of his privacy.
Is that a version number or what? Using such a notation system, how would you distinguish the actual decimal point? Would that be 6.399191 or 6399.191 or is it an integer (which would make no sense as there is at least one decimal point present...)? Who is teaching this?
I think they meant to write: 6399191 or 6,399,191 that must be it.
I'm using a modern PC, which is probably a thousand times better than one of those old boxes on every front. But I expect to be able to do more with it too. At any given moment I have dozens of windows open, dozens of processes running. If these could be made to run in less RAM, that would mean less swapping. I'm not saying all their memory footprints can be radically reduced; maybe some of them can't. On the other hand, I'm pretty sure of them can run using much less RAM so I think optimizing for minimal RAM usage is a worthwile thing to do and people shouldn't be so quick to dismiss that.
Then maybe one day it can boot from floppy disk again. One can hope, one can hope...
So, in fact, it's not 10 million lines of code at all. It's just 10 million lines. Wooooo.
I would have guessed it to be all the Whitespace in the C and assembly. That's a language that can really brainfuck you. A real gem, a perl I tell you ;)
Why is this news? Single commercial applications can have more than 10 million if they're complex enough. I would EXPECT the Linux kernel to have this many lines of code (or more) given what it does and how long it's been in development.
Homonyms are fun!
You're driving your car, but they're riding their bikes there.
Bloatware.
+++OK ATH
I care because up at the top of this website is the tagline "Stuff that matters."
This is the biggest non-headline I've ever seen.
DRM: Terminator crops for your mind!
/* 3k lines of workaround for 8 lines of code. WTF were they thinking? */
//This might work.
//Blocks undocumented interface used only by WordPerfect.
//Passes test. Ship it. I'm done. <Allchin>
Help stamp out iliturcy.
Personally I thought the news was that no one knows what 0.3% of the linux kernel is written in.
Most likely the missing 0.3% is makefiles and miscellaneous scripts.
Is get a computer to do stuff like the first world does, with a third world power infrastructure.
Hint: They get their electricity from carbon fuels. We don't want them to build out their power infrastructure because we're fond of our Gulf Stream.
Capiche?
Help stamp out iliturcy.
The PHB problem is that they must have metrics to measure so they can list their datapoints in Excel and turn it into a nice Powerpoint slide.
I am SO glad Linux is invulnerable to this sort of attack.
Help stamp out iliturcy.
The parts of the kernel that could be converted to APL would reduce its size by 90%.
OTOH, APL bests perl in "write only" language contests.
Help stamp out iliturcy.
Hint: They get their electricity from carbon fuels.
We also get most of our power from carbon fuels...
Not to mention that there are plenty of extremely low-power computers that have respectable performance numbers...
How much of them written by Linus ?
Isn't most of it just drivers?
In which case it's hardly exciting as it could triple in size and the actual kernal features be exactly the same.
For every expert, there is an equal and opposite expert. - Arthur C. Clarke
> Linux has already had a near miss back in 2003
I am not sure you could call it a "near miss". It was detected automatically during a routine check (you would not say a aircraft "nearly crashed" if a fuel pipe leaked during a pressure test in the maintenance hanger ?).
the proof that Linux is a bloated piece of shit
Zippy the Pinhead: "for his enthusiasm for philosophical non sequiturs, verbal free association, and the pursuit of pop culture ephemera."
The Commodore 64 Kernal* was 8K and lived in ROM... and we LIKED it!**
*Yes, Commodore really spelled it that way.
**We liked it because the C64 booted in about 2 seconds! :)
Serving your airship needs since 1995.
I did not say that Windows NT microkernel was about 6 million LoC, but the Windows NT OS. Windows NT OS use microkernel, so the OS is the kernel + OS servers in userland. The Windows NT microkernel might have 50 000 - 200 000 LoC while the whole Windows XP Software System has over 40 million LoC
50 000 - 200 000 Microkernel LoC
~6 million OS LoC
40 million Software System LoC
Linux OS has now over 6 million lines, it includes all drivers etc. The kernel itself, without any drivers etc, might be lots of smaller itself. But the whole Linux OS distribution like Fedora, has over 200 million LoC
~6 million OS(monolith kernel) LoC
150 - 250 Million Software System LoC
And Linux is cery seriously a Monolith, but it is modular and not macrokernel.
I want my apps to run in a sandbox, where they cant break jack.. no matter how malicious they are. I want the box to be absurdly robust. And I want it to work as smooth as silk, no weird jerkyness, no pinwheel that keeps spinning for no apparent reason.. no slow response to the keyboard-- where 8 seconds go by without so much as the slightest feedback.
Get me a system that isnt a dog, and I'll pay for the 32gigs of ram. It will be money well spent.
Storm
Maybe bash and Makefiles