loading...

OS size

yujiri8 profile image Ryan Westlund ・1 min read

Today, out of random curiosity, I counted the SLOC of the Linux kernel and of FreeBSD.

Linux: 21 million
FreeBSD: 17 million

I was surprised to find Linux bigger when it's only a kernel while the FreeBSD repository also includes the FreeBSD equivalent of GNU coreutils and all the BSD init infrastructure and stuff. I bet this is the outward reflection of what people are seeing when they say FreeBSD has the better architecture.

I'm really curious to know if Windows and Mac are bigger or smaller than open-source operating systems. Of course a direct repository count probably wouldn't be fair because their repositories probably include their built-in desktop environments and stuff.

Discussion

pic
Editor guide
Collapse
stereoplegic profile image
Mike Bybee

Not sure about MacOS, but Windows has fluctuated between large and small kernels throughout the decades. 7 was much smaller and more stable than Vista, but ME was '98 on an extreme diet while extremely unstable.

Collapse
yujiri8 profile image
Ryan Westlund Author

Does anyone have counts (with as much info as possible about what's included)? I imagine only an Apple/ Microsoft employee would be able to have them since they're closed source.

Nvm, I was wrong. Just checked Google. Found this quora.com/How-many-lines-of-code-d...

Collapse
stereoplegic profile image
Mike Bybee

Pretty sure the Linux monolith is the biggest, though.

Collapse
aghost7 profile image
Jonathan Boudreau

IIRC, a lot of the code in the Linux tree is drivers that are actually disabled by default.

Collapse
stereoplegic profile image
Mike Bybee

Yeah. Linux supports WAY more hardware, and it can't all be modules.