Re: Phoronix estimates ....???
>How the fuck does a kernel, any kernel, get to 35M+ lines of code?
By having a drivers for large amounts of hardware, plus extremely bloated drivers.
For example the amdgpu driver;
`cloc drivers/gpu/drm/amd/`;
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C/C++ Header 1597 79857 523298 4410555
C 886 122470 87621 670478
Assembly 9 906 1014 3205
make 63 869 1763 1373
-------------------------------------------------------------------------------
SUM: 2555 204102 613696 5,085,611
-------------------------------------------------------------------------------
The large size appears to be how there are register dumps for each GPU included.
Note that amd withholds the source code of much of the driver and provides half or more of it as proprietary binaries (how it is loaded on co-processors in the GPU instead of loaded onto the main processor doesn't magically make it not part of the driver).
(git.kernel.org now serves malware in the form of JavaScript - to avoid running malware, you'll need to change your useragent to not include "Mozilla" or use; https://addons.mozilla.org/en-US/firefox/addon/nopow/ );
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/amdgpu
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/LICENSE.amdgpu
Adding up the size of the current binaries, that works out to be ~81MiB - which is a substantial amount of software without source code.
The whole repo weighs; ~2.7GiB (of which only a MiB of binaries are free software that complies with Linux's license).
On the basis that the core elf plus all modules under /lib/modules/ weighs ~1GiB, it appears Linux in fact weighs somewhere in the ballpark of 94.5 million LoC.
The non-peripheral device driver parts are much smaller;
`cloc kernel/`;
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C 451 70520 100633 311033
C/C++ Header 118 3833 6649 18365
make 24 102 88 564
Bourne Shell 1 16 27 56
-------------------------------------------------------------------------------
SUM: 594 74471 107397 330018
-------------------------------------------------------------------------------
`cloc arch/`;
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C 4324 224484 238384 1074853
C/C++ Header 4889 83790 111141 441335
Assembly 1260 45784 96458 222149
make 623 3290 3224 14369
Perl 12 1786 1256 12120
Text 4 72 0 2750
Bourne Shell 40 316 591 1531
awk 7 163 92 842
Linker Script 2 23 9 101
C++ 2 19 47 59
Umka 1 18 0 45
Snakemake 1 6 7 14
sed 1 2 5 5
-------------------------------------------------------------------------------
SUM: 11166 359753 451214 1770173
-------------------------------------------------------------------------------
>the FreeBSD kernel which pretty much does everything a Linux kernel does (except suck bigly) is ~3M lines of code. OpenBSD's even smaller IIRC
The nonfreeBSD and "open"BSD kernel's lack drivers for many peripheral devices and don't work properly with GNU and are proprietary software like Linux, thus those in fact suck more than Linux.
Hurd, which is a more suitable replacement to Linux, as it is actually free software and is designed to work as well with GNU, as GNU Linux-libre and is quite a lot lighter;
https://cgit.git.savannah.gnu.org/cgit/hurd/hurd.git/
https://cgit.git.savannah.gnu.org/cgit/hurd/gnumach.git/tree/
`cloc gnumach/ hurd/`
--------------------------------------------------------------------------------
Language files blank comment code
--------------------------------------------------------------------------------
C 1294 88077 117432 418852
C/C++ Header 1310 28595 54164 113079
Assembly 31 873 2533 5443
Bourne Shell 20 386 781 4452
make 84 904 1821 3705
m4 12 265 181 1693
awk 3 25 54 203
Bourne Again Shell 2 29 41 163
Pascal 1 15 0 103
Clojure 4 9 0 46
diff 3 6 18 32
--------------------------------------------------------------------------------
SUM: 2764 119184 177025 547771
--------------------------------------------------------------------------------
But that is not including the external drivers.
Regardless, a kernel on its own is useless - you need the rest of the OS.
GNU indeed dwarfs the LoC of Linux (although more LoC is only as good as the functionality it implements and GNU is indeed full of functionality); https://gnu.org/software