Comparison of BSD source trees

A while back I felt the need to get involved in something ‘hard’ and new for me so I delved head first into NetBSD. I covered why in detail in the ‘mental waterboarding’ post, but as a knee jerk reaction, picked NetBSD for portability and because I thought it was smallest of the big three.

I excitedly posted on the mailing list and unsurprisingly got zero response. Naturally, as soon as I publicly announced this I got busy with IRL stuff, job changes, etc etc and didn’t ever do much.

Fast forward to today and my situation is improved again and I’ve got the urge to get back to it and decided to actually do some homework and do some ballpark comparisons of the BSDs!

I compared the following source trees, excluding ports/pkgs. This will be a comparison of kernel and base userspaces provided for:

After cloning each from the github mirrors because installing CVS in 2019 is stupid, I started with raw size on disk:

➜  bsd_code_compares du -h -d1 .     
2.7G ./freebsd_src
5.7G ./netbsd_src
2.0G ./openbsd_src
 10G .

NetBSD is actually the biggest on disk. I would have expected FreeBSD.

Now for code comparisons. I used cloc in the root of the directory, with no filetype filter, so there is a bit of false positives, so take as a rough idea

OS files blank comment code
OpenBSD 53591 2622788 3365778 14912018
NetBSD 123385 6329344 8430136 34842316
FreeBSD 52867 2850675 4186693 17083775

A good follow up would be comparing just the kernel trees, comparing # of drivers, etc..

April 1, 2019


Previous:Diskpart/etcher errors - Wiping a removable/SDcard on win10
Next:Github activity