在 Reddit 看到一個評論,非常贊,轉帖一下。

https://www.reddit.com/r/BSD/comments/7x0d5t/under_which_circumstances_is_netbsd_a_better/?

www.reddit.com

  1. FreeBSD 的硬體驅動更多,SMP 支持比較好,但不如 DragonFlyBSD;
  2. NetBSD 的 Xen 支持最好;SMP 支持比較好,不如 FreeBSD,NetBSD 的網路協議棧的 SMP 支持還不夠;代碼容易移植;發明了偉大的 pkgsrc;
  3. OpenBSD 的 SMP 支持非常差,內核代碼大多單線程的,性能最差的 BSD;對新硬體支持很差;代碼許可證要求很嚴格,因此缺一些固件,沒有 ZFS;OpenBSD 正式支持 13 種硬體架構,NetBSD 7 種,FreeBSD 6 種,DragonFly 1 種
  4. DragonFlyBSD 的 SMP 支持最好,但還不成熟;
  5. 安全性上 FreeBSD/NetBSD/OpenBSD 半斤八兩,OpenBSD 稍優,都比 Linux 強一個數量級,參考 Are all BSDs created equally?

所以結論是:生產伺服器正經用 Linux 或者 FreeBSD,玩家或者嵌入式用 NetBSD,安全妄想狂用 OpenBSD,牛人用 DragonFlyBSD。

從 Github 上 FreeBSD, NetBSD, OpenBSD, DragonFlyBSD, torvalds 的源碼分析的
截止 2019-02-23 的活躍度.

1. 五年來提交者人數: git shortlog --no-merges -s --since=2014-01-01 | sort -k1,1 -n | wc -l
2. 五年來提交超過 100 次的提交者人數: git shortlog --no-merges -s --since=2014-01-01 | sort -k1,1 -n | perl -ane print if $F[0]>=100 | wc -l
3. 五年來平均每月提交次數: git log --no-merges --since=2014-01-01 --format=%aI %an | sed -e s/-..T.*// | sort -r | uniq -c | perl -lane $a+=$F[0]; ++$n; END {print int($a/$n)}
4. 五年來平均每月提交者人數: git log --no-merges --since=2014-01-01 --format=%aI %an | sed -e s/-..T.* / / | sort -r | uniq -c | perl -lane print $F[1] if $F[0]>0 | uniq -c | perl -lane $a+=$F[0]; ++$n; END {print int($a/$n)}

No. Linux FreeBSD OpenBSD NetBSD DragonFlyBSD
1 11252 353 169 166 56
2 713 98 62 49 12
3 3539 973 794 680 150
4 570 87 58 46 9

TL;DR -- NetBSD is just as good as any other BSD for a basic desktop or server. Its only when you get into specific use cases or niches that one may be better over the other. And even then, things have changed so much over the years that descriptions like those in the OP are no longer accurate.

I hate posts like these -- they repeat dogma about the BSDs that is decades out of date (these stereotypes are from the 90s). Below is a list of things that FreeBSD, NetBSD, and OpenBSD do well or dont do well. Things have changed a lot over the years.

NetBSD

  • Its third-party software respositories are as large as, if not larger than, FreeBSDs. NetBSD created the pkg_src framework for managing and installing packages, which has been adopted by a number of other operating systems.
  • It has great documentation - just as good as FreeBSD or OpenBSDs (they all are good honestly, but none are perfect).
  • Dont trust its "portability." Only a handful of its ported architectures are supported, most architectures have been abandoned or are maintained "organically."
  • Its easily portable. You can cross-compile NetBSD from any architecture to any other architecture (in theory and mostly in practice). Developing a new arm-board or creating new custom hardware? NetBSD is probably easier to port than your other options.
  • Its just as secure as OpenBSD. NetBSD is also "secure by default" like OpenBSD because NetBSDs base install only has the bare minimum up and running. Like OpenBSD, NetBSD does not come with a bunch of extraneous network servers running with the default install. Just like OpenBSD, if you start running a lot of network accessible third-party software (web servers, mail servers, etc.), you start compromising the security of your system. There is only so much the operating system can do in that instance.
  • Its a great research operating system if you want to tinker with new ideas. The code is really clean and portable, so a lot of entities use it as a testbed for new concepts or ideas (e.g., rump kernels, Lua scripting in kernel, Kauth, etc.)
  • NetBSD has binary compatibility with Linux just like FreeBSD (and like OpenBSD used to). However, it is also maintained just as poorly as FreeBSDs.
  • NetBSD is actively working to bring their older ZFS implementation up to date.
  • If youre a big user of Xen for virtualization, NetBSD is a Tier 1 supported platform and one of the first operating systems to implement Xen.

FreeBSD - I love this operating system, but its hardly "the best"

  • FreeBSD has much better third-party driver support than the other BSDs. For example, Nvidia, Realtek, and other vendors provide FreeBSD specific drivers on a regular basis. They dont do that for the other BSDs.
  • FreeBSD tends to get new features sooner than the other BSDs (because they have more developers and sponsors). This only matters if you actually need the new features that are implemented.
  • FreeBSDs multi-processor performance is far better than OpenBSDs. I dont know how it compares to NetBSD. But they all lag behind DragonFlyBSDs scalability.
  • FreeBSD is equally "secure by default" as only an SSH server is enabled with the default install, assuming you choose to enable it as part of the installation.
  • FreeBSDs linux emulation is poorly maintained. The kernel API is woefully out of date.
  • FreeBSDs port of PF is divergant from OpenBSDs. FreeBSDs pf is SMP optimized (OpenBSDs is still single-threaded), but FreeBSD uses a much older version of PFs syntax. The result is that you cant use OpenBSD guides on FreeBSD anymore.

OpenBSD

  • Performance is generally worst of the BSDs. Most of the kernel code is still single-threaded or only crudely multi-threaded. Given the direction of todays processors is more cores because of thermal limits from increasing clock speeds, this is a big deal long term.
  • They dont support basic features like TRIM for SSD (its 2018 - really guys?!).
  • They have a lot of cool security ideas, but Im only sold on some of them. Good things they do is remove old code thats unmaintained (e.g. linux compatibility, lots of cruft in OpenSSL, etc.), minimize the number of network services enabled in the default installation (but everyone does this), and constantly audit their code to replace unsafe functions (e.g., gets(), strcpy(), etc.) with safer functions (e.g., strncpy()). They also tend to be the first to implement new security paradigms (e.g., WX bit support). However, other stuff they do I remain unconvinced about (e.g., their pledge() framework).
  • I would argue that their support for a variety of architectures is far better than the other BSDs. OpenBSD has "Tier 1" support for 13 different architectures, while NetBSD has support for 7, FreeBSD supports 6, and DragonFlyBSD supports 1.
  • My limited experience has also been that while OpenBSD has less support for third-party hardware, mainly because of OpenBSDs strict requirement for open-source licensed drivers and a refusal to allow driver BLOBs into the code, the hardware they do support is supported better.

DragonFlyBSD -- The unsung hero of the BSDs.

  • I dont know much about them, but their claim to fame is performance - specifically multiprocessor scalability. They forked from FreeBSD 4.x to implement a message-passing framework in-kernel (think MACH but without the system call overhead) to allow for SMP processing while FreeBSD pursued a fine-grained lock approach. The data over the last few years is showing that DragonFlys approach was the better one.
  • They have a really small team. So while the code quality is good and releases are regular, it takes a while for new features to become production ready.

推薦閱讀:

相关文章