NetBSD
2010-11-11 09:10:07 阿炯

NetBSD是一个免费的,具有高度移植性的 UNIX-like 操作系统,是现行可移植平台最多的操作系统,可以在许多平台上执行,从 64bit alpha 服务器到手持设备和嵌入式设备。NetBSD计划的口号是:"Of course it runs NetBSD"。它设计简洁,代码规范,拥有众多先进特性,使得它在业界和学术界广受好评。由于简洁的设计和先进的特征,使得它在生产和研究方面都有卓越的表现,而且它也有受使用者支持的完整的源代码。许多程序都可以很容易地通过NetBSD Packages Collection获得。

NetBSD 自 386BSD 派生而来,是第一个开源的 BSD 继承者。它开发活跃,可运行于许多平台:大型服务器系统、桌面系统和手持设备,并常用于嵌入式系统。NetBSD 项目专注代码清晰、审慎设计以及不同计算机架构间的可移植性。其源代码基于低限制性的BSD开源许可协议,允许任何人在保留版权声明和许可证的前提下使用、修改、重分发甚至用作一些商业用途(其各部分源码的授权条款基于不同的 BSD 许可变体,且有所不同)。


NetBSD is a free, fast, secure, and highly portable Unix-like Open Source operating system. It is available for a wide range of platforms, from large-scale servers and powerful desktop systems to handheld and embedded devices. Its clean design and advanced features make it excellent for use in both production and research environments, and the source code is freely available under a business-friendly license. NetBSD is developed and supported by a large and vivid international community. Many applications are readily available through pkgsrc, the NetBSD Packages Collection.

NetBSD 如同他的姊妹 FreeBSD 都是从加州柏克莱大学的 4.3BSD via the Networking/2 及 386BSD 为基础发展。The project began as a result of frustration within the 386BSD developer community with the pace and direction of the operating system's development. NetBSD 的四位发起人:Chris Demetriou、Theo de Raadt、Adam Glass以及 Charles Hannum 觉得开放的发展模式会有助于 NetBSD 计划的进行,他们的目的在于发展一套跨平台、高品质、以 BSD 为基础的作业系统。

历史
NetBSD 的第一个版本是NetBSD (0.8),可以追溯到1993年,它是从美国加州伯克利分校研发的一版Unix操作系统4.3BSD Lite以及第一个面向Intel 386 CPU设计的BSD(BSD = Berkeley Software Distribution):386BSD系统的基础上发展起来的。在随后的几年中,柏克莱小组将基于4.4BSD Lite(Berkeley小组的最后一个发布)版本的修补工作成果集成到了这个系统当中,Unix的BSD发展分支在这个操作系统的发展上起到了举足轻重的作用并且对它产生了重大的影响。NetBSD从Unix的BSD发展分支中沿用了很多的工具,思想以及改进手法(比如vi编辑器、C Shell、作业控制、Berkeley快速文件系统、可靠信号、对虚存的支持、TCP/IP应用工具、仅做些简单的举例) 这些基本上已经成为了所有类Unix环境的标准。这些传统的研究和开发方法与工具在现今的免费和商业性BSD系统当中得以保存,尤其是在NetBSD中。

NetBSD原始代码的版本库创建于1993年3月21日,并于1993年四月发行了第一个版本:NetBSD 0.8。同年9月,NetBSD发布0.9版,包含了许多修正与功能的加强,惟仅限于台式机上运行。1994年10月,NetBSD发布1.0版,这个版本是NetBSD一个提供多平台的版本。

特色
NetBSD 应用在广大的硬件平台范围而且是非常易于移植的,可能是世界上最容易移植的操作系统。NetBSD 核心和应用程序的完整原始码在所支持的平台上都是有效的,具体请看官方网站的说明。
基本特色有:
可移植性(超过 20 种平台被支持)
程序代码的品质与正确度高
稳定性
研究与革新


上述的特性也带来了间接的优势。举例来说,如果只在单一平台上工作,可能认为你的兴趣并不在可移植性方面,但是可移植性早已是程序代码的品质特性之一:没有良好的撰写和组织的基础,要同时支持许多平台是不可能 的,而且高品质的程序代码是任何完善且稳定的软件系统的基础,不用担心只有少数人能理解它。由于着重于架构性与品质性的问题,这有助于增进 NetBSD 程序代码的潜力和驱动程序的品质。

经由区分这些 NetBSD 特性的差异,我们可得知它是无法满足于只在某些方 面能得以实行的情况。某些系统似乎有着如此的设计哲学:"如果它能运作,它便是良好的"。而就 NetBSD 方面来说,它可以描写成“除非它是对的,不然它将无法工作”。想想看,有多少重量级和"有特色" 的程序在今日早已被伤心地丢弃了;所以你将了解为什么 NetBSD 要避免这种浪费成本的情形发生。

目标使用者
在 NetBSD 网站上有着如此叙述:"NetBSD 项目提供了一个可以免费自由散布的系统,不论是专家,玩家和研究者都可以随心所欲的使用它"。要补充的是如果想要学习 Unix,NetBSD 是一个蛮理想的系统,主要是因为它所坚持的标准(此项目的目标之一)以及在有专有作业系统的硬件平台上,能执行得和它们一样好;我们可以说"想要学习和使用 Unix,你不需要购买昂贵的硬件;你可以再利用在你仓库里堆放的老旧 PC 或 Mac"。当然,如果你需要在种种不同的平台上执行,NetBSD 可能是你最佳的(唯一的)选择。

哲学
与同时代的很多操作系统不同的是, NetBSD安装程序充分体现了占用空间小的特性,它坚持生产出一个稳定的完整的不冗余的基系统。在执行安装后你得到的是一个完整的可运行系统,但是还缺少很多应用程序,比如举例说,浏览器(NetBSD与其它的操作系统相反,不将浏览器作为一系统的一个组成部分):你有决定安装什么样的程序在你的机器上的自由,包安装的方式也使得你安装新的程序非常地便捷。

这种途径的另一个优势就是基系统的运行可以独立与这些附加的包;如果想升级你的Perl的版本,根本没必要去担心这样会破坏你系统的一些其他部分。当安装NetBSD时,不会发现有巨大的应用程序的预打包:现在可能认为这是个缺点,但是如果开始理解了在这个现象之后的理念就会感到这样提供给人很大的自由度。当安装这些软件集合时(其他认为你设计好的)会发现你的硬盘里存储了大量的程序,但这些中的大部分你都不会用到(甚至根本不知道它是什么),这只能浪费空间(或许使系统稳定性减弱):这些可是典型的BSD用户所不希望的。

即使开始了解NetBSD,还总是会有一些东西使你感到迷惑,极端一致性,系统的逻辑结构以及对细节的关注:什么事情都不会发生的很偶然,任何事情都在预料之中。是的,这就是质量,在我看来,这就是NetBSD与其他操作系统特性上的最大差别。

我们可以花上数天去争论操作系统相对的优点(有些人就喜欢这么做),但是如果不去认真的尝试就不能做出真正的判断。我深信我的观点,因为我在我的邮件列表当中看到很多次:如果你尝试着使用NetBSD,你就会被它在复杂性与高效性之间的完美的平衡所征服;所有的问题都有不止一种解决方案:NetBSD不会满足于寻求“一种”解决方案,而总是尽力去发掘最简便,最一流的方法。NetBSD是一种能使你用你自己的方式去做你的工作的工具。在这个意义上他就是一个可供选择的工具;就像用钢笔一样:你努力的去学如何去用他,但一旦你学会了你就可以忘记所有与这钢笔有关的事情,去尽情的写尽情的画。

可移植性

作为该项目的口号("Of course it runs NetBSD")表明,NetBSD已移植到了大量的32和64位体系结构。从VAX小型机Pocket PC掌上电脑,甚至还支持Dreamcast游戏机。从2009年起,NetBSD支持57个硬件平台(横跨15个不同的处理器架构)。NetBSD的发行版比任何单一的GNU/Linux发行版支持更多的平台,这些平台的内核和用户空间都是由中央统一管理的CVS源代码树。不像其他的内核,如μCLinux,NetBSD内核在任何给定的目标架构需要MMU的存在。


About NetBSD

Clean design
NetBSD focuses on clean design and well architected solutions. Because of this NetBSD may support certain 'exciting' features later than other systems, but as time progresses the NetBSD codebase is getting even stronger and easier to manage, while other systems that value features over code quality are finding increasing problems with code management and conflicts.

NetBSD supports a massive range of hardware platforms from a single source tree, including simultaneous release across all platforms, and continues to attract users and experienced developers despite lack of media exposure and commercial backing - all thanks to attention to code quality.

BSD Licence
While NetBSD uses the GNU toolchain (compiler, assembler, etc), and certain other GNU tools, the entire kernel and the core of the userland utilities are shipped under a BSD licence. This allows companies to develop products based on NetBSD without the requirement to make changes public (as with the GPL). While the NetBSD Project encourages companies and individuals to feed back changes to the tree, we respect their right to make that decision themselves.

Full source availability
NetBSD makes the full source available, both the source code and the full CVS repository. Since everything is in the same source tree, you can always access any version of all files. We were not the first BSD to make a CVS repository available, but we were the only one to meticulously check every file and remove only those revisions that contained tainted USL code, rather than discarding every revision before an arbitrary date.

Security
NetBSD has the least number of security bugs reported in any public forums (such as bugtraq). We believe in security without the hype. We do manual code audits and add extended checking capabilities to our toolchain. Retrieval of kernel data is geared towards a sysctl based approach, as opposed to the traditional Unix based kmem access, which requires full access to the whole system, and is often exploited.

Mature and stable
The BSD codebase can be traced back to the early 80s at UC Berkeley, and has been open to public scrutiny ever since. NetBSD continues this tradition and works ever harder to promote clean design and functionality over hype. NetBSD is being used at NASA's Numerical Aerospace Simulation facility for a reason. Their main platforms are Alpha systems with lots of RAM and diskspace (terabyte and up), and they need a good, stable, codebase on which they can build custom projects. NetBSD was also the first free OS to make a y2k statement. See our testimonials for more success stories!

Hype free
Probably the only thing you won't get with NetBSD is the media hype. You'll need to get that somewhere else.

Networking
Packet filtering and Network Address Translation (NAT)

NetBSD ships with an in-kernel packet filtering engine, allowing filtering of traffic based on interface, protocol, port, tos, ttl, source, destination and many other factors. Keeping this inside the kernel permits higher performance.

Network Address Translation can permit a local network of machines to use one set of addresses internally, and a different set (or even single IP address) externally. This can be used for security or simple convenience reasons, and also includes a transparent FTP proxy. Again this is all kept inside the kernel for higher performance.

IPv6
NetBSD was the first free OS to provide a leading edge standards conforming IPv6 implementation, and we continue to work with the KAME project to track changes to the specification. NetBSD was also the first free operating system to ship with NFS via IPv6, for both client and server part.

Network File System (NFS)
NetBSD provides complete in-kernel NFS client and server support, interoperable with other systems, for both NFS2 and NFS3 protocols. This includes support for swapping over NFS, and no arbitrary limits on the size of swap partitions. Client side file creation is correctly implemented as an atomic operation - on systems without this dot locking is not reliable.

NetBSD also supports the following network protocols:
* Appletalk - atalk(4)
* ISO - iso(4)
* TCP/IP (IPv4) - ip(4)
* TCP/IP (IPv6) - ip6(4)

NetBSD also ships with many standard networking daemons, with built-in tcp wrappers support where appropriate, including bootparamd(8), bootpd(8), dhcpd(8), ftpd(8), identd(8), mopd(8), named(8), postfix(1), rarpd(8), rbootd(8), sshd(8), tftpd(8), and xntpd(8).

Wireless networking
NetBSD supports a long list of IEEE 802.11 based wireless networking devices, see an(4), ath(4), atu(4), atw(4), awi(4), cnw(4), ral(4), ray(4), rtw(4), rum(4), wi(4), wpi(4), and zyd(4).

Portability and supported platforms

Multi-platform support
NetBSD is designed to take advantage of the latest high end hardware available in Alpha, PowerPC, and PC systems, while still retaining support for older architectures. This is all done from the same source tree and is only possible due to the emphasis on correct design and clean code. It also makes NetBSD an ideal codebase to port to new machines and embedded platforms, such as mips, ARM and Super-H based handheld Windows CE devices.

NetBSD on Embedded Systems
The NetBSD Operating System is highly portable and many of the supported hardware platforms are suited for embedded applications. Read more about NetBSD on Embedded Systems

Storage
Hardware and software RAID
In addition to many standalone SCSI RAID devices, NetBSD supports a variety of RAID controllers and a complete software RAID 0, 1, 4, 5, and 6 system in RAIDframe. (More details)

High performance PCI IDE
Many recent PCI IDE controllers support high speed DMA transfers. NetBSD is one of the few systems to take advantage of these features 'out of the box'. Due to NetBSD's clean design the same drivers and features are available on alpha, i386, macppc and sparc64.

SCSIPI subsystem - combined SCSI and ATAPI
NetBSD implements a unified SCSIPI subsystem, avoiding code duplication and allowing a common userland SCSI and ATAPI interface for many devices. As a direct result of this, when ATAPI CD-R units became available
existing tools such as sysutils/cdrtools worked with them without any need for modification.

64-bit file systems
NetBSD has shipped with 64-bit file systems since the 1.0 release in October 1994. Under NetBSD berkeley fast file systems can be up to 4TB (4096GB) in size, on both 64- and 32-bit machines. Files and user file quotas can also reach terabytes. Many other systems limit filesize to 4GB on 32-bit machines.

An ffs can have up to 2^31 fragment blocks - the maximum file system size is dependent on the fragment size:
Frag size:fs size
512 bytes:1 TB
1kB:2 TB
2kB:4 TB

Large IDE disks
NetBSD fully supports IDE disks of over 34GB in size, including booting from partitions beyond 8GB (where the BIOS permits). Starting with release 1.6, NetBSD can also use 48-bit logical block addresses (ATA-6 Expanded Addressing) in order to access disks with sizes greater than 137GB.

Soft Updates on FFS for high performance and reliability
Soft Updates permit metadata writes to be ordered to achieve close to asynchronous disk performance without risk of metadata corruption. This significantly improves the performance of FFS file systems.

Many file system types
NetBSD can handle and manipulate many different file systems, which is useful for both data exchange and binary compatibility. Systems can also optionally mount file systems writing with opposing byte ordering. Note that unlike some other systems NetBSD imposes metadata write ordering, allowing fsync(2) to be used to avoid important data loss in the event of power failure, even on ext2fs.

* ffs (Berkeley Fast File System) - both the latest 64-bit FFS, including soft updates, and the older 32-bit FFS used by some vendors (SunOS, Ultrix, etc).
* lfs (Log-structured File System) - LFS is designed to allow safe asynchronous file creation, fast file writes without intervening head seek and near-instantaneous crash recovery. This is a more completely log structured form of 'Journaled' file systems such as IRIX's XFS, Reiserfs, Microsoft's NTFS, IBM's JFS, and similar file systems in Netware and Unixware. (More details).
* tmpfs (an efficient memory file system)
* iso9660 (Standard CD file system, supports Rockridge and Joliet extensions).
* msdosfs (Windows, MS-DOS, and Atari TOS) - including long filenames, FAT32 and VFAT.
* ntfs (Windows NT native file system)
* ext2fs (Linux extended file system).
* ados (AmigaDOS file system).
* filecorefs (Acorn RISC OS file system).

NetBSD also has a range of virtual file system types, including:
* kernfs - access kernel information
* nullfs - for loopback mounts
* portal - portal daemon file system
* procfs - access process information
* umapfs - automatically remap uids and gids
* unionfs - attaches a directory in such a way that the contents of both directory trees remain visible. This can be used to mount a writable file system over a CD-ROM.

Userspace filesystem support
Starting with version 4.0, NetBSD provides the puffs(3) framework for creating file systems as userspace servers. This opens a myriad of possibilities, like developing new filesystems in userspace for comfortable testing, or representing userspace functionality as a filesystem (such as a SSH filesystem). NetBSD 5.0 will also include the refuse library, which provides a FUSE-like interface. With refuse, many FUSE filesystems can run on top of puffs(3).

Disk encryption
NetBSD provides transparent disk encryption through the cgd(4) driver. cgd(4) acts as a logical device that is layered on top of another block device, such as a physical disk partition or a vnd(4) pseudo device. cgd(4) currently supports the AES, 3DES, and Blowfish ciphers in CBC mode.

An extensive introduction to cgd(4) is included in the NetBSD Guide.

Kernel debugging

OS emulation
NetBSD's unique binary compatibility protects users' investment in existing applications by in kernel support for non-native binaries (for the same processor) to run transparently. Systems include:
* BSD/OS (i386)
* Darwin (macppc)
* FreeBSD (i386)
* HP-UX (m68k)
* IRIX (sgimips)
* Linux (i386, m68k, alpha, powerpc, mips, arm)
* OSF1/Digitial UNIX/Tru64 (alpha)
* SCO/iBCS2 (i386)
* Solaris and SVR4 (sparc, sparc64, i386, m68k)
* SunOS 4 (sparc, sparc64, m68k)
* ULTRIX (mips, vax)

USB (Universal serial bus) and 64-bit clean

NetBSD版本更新录(202x)

官方主页:http://www.netbsd.org/

该文章最后由 阿炯 于 2022-08-13 07:37:15 更新,目前是第 2 版。