Posts Tagged ‘kernel’

Linux Kernel Package Composition

Thursday, October 9th, 2008

Ever wondered how the Linux kernel’s source code is over 250 megabytes? I was recently curious what comprises the bulk of the Linux kernel’s full source and patch baseline packages. Kernel version 2.6.26 was over six million SLOCs (“5 things you didn’t know about linux kernel code metrics”. Maciej Sołtysiak. Accessed on 2008-10-08), so 250MB is reasonable. I downloaded the patch baseline package of Kernel version 2.6.27-rc9 and ran Markus Lausser’s gdmap on the extracted files. Here are the results:
Here are the colours I used in my configuration:

colour-coded file type composition of the Linux Kernel

colour-coded file type composition of the Linux Kernel

dark green (#004400): C sourcecode (.c .cc .agh .cpp .c_shipped)
light green (#00FF00): C headers (.h .hh .h_shipped)
orange (#FF6600): low-level language code (.S .s .dts .uc .reg .seq .ld .ucode .sa)
brown (#998844): scripting language code (.y .l .inc_shipped .pl .sh)
light blue (#66AAFF): documentation (.tmpl .mdb .src .ioctl .txt .po .history .oss .xsl .xml .html .htm)
dark pink (#CC2299): configuration and some documentation (some documentation files lack filename extensions¹).
olive (#443300): hexadecimal (.HEX, .h16, .ihex)
yellow (#EEEE00): images (.eps .ppm .pbm)
bright pink (#FF3333): Tex (.tex)
purple (#6600CC): Unicode definitions (.uni)
grey (#888888): testcase data (.tst)

I chose the filename extensions for each group by examining the MIME types and briefly checking the files individually; however some data might be inaccurate, especially for files that constitute less than .05% of the total. This image shows the package’s general makeup, but running gdmap should give you a better and more specific sense.

¹ gdmap relies exclusively on filename extensions. This group actually consists of every file not identified by another.