Some analyses of the Linux kernel code base using David Wheeler's SLOCCount program yield some interesting facts. (The acronym "SLOC" stands for Source Lines of Code.) It finds only 6,399,191 lines of source code, since it doesn't count blank lines, comments and other input. One breakdown of the code base by SLOCCount comes up with the following figures (percentages are rounded to one decimal place)
TYPE | COUNT | PER CENT |
---|---|---|
Drivers | 3,301,081 | 51.6 |
Architectures | 1,258,638 | 19.7 |
Filesystems | 544,871 | 8.5 |
Networking | 376,716 | 5.9 |
Sound | 356,180 | 5.6 |
Include | 320,078 | 5.0 |
Kernel | 74,503 | 1.2 |
Memory Mgmt | 36,312 | 0.6 |
Cryptography | 32,769 | 0.5 |
Security | 25,303 | 0.4 |
Other | 72,780 | 1.1 |
Categorisation by language finds that the overwhelming majority of the Linux kernel code is written in ANSI C, at 96.39 per cent, with Assembly Language accounting for almost all of the rest at 3.32 per cent. Other languages used in the kernel source files, in descending order of the number of lines of code, include Perl, C++, Yacc, Sh(ell), Lex, Python, LISP, Pascal and Awk.