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
A good follow up would be comparing just the kernel trees, comparing # of drivers, etc..