@wxy
This commit is contained in:
Xingyu Wang 2021-08-27 15:00:37 +08:00
parent 599eccf640
commit f60c86544b
2 changed files with 70 additions and 100 deletions

View File

@ -1,100 +0,0 @@
[#]: subject: "30 things you didn't know about the Linux kernel"
[#]: via: "https://opensource.com/article/21/8/linux-kernel"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lujun9972"
[#]: translator: "wxy"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
30 things you didn't know about the Linux kernel
======
The Linux kernel is turning 30 this year.
![30 years][1]
The Linux kernel is turning 30 this year. That's three decades of pioneering open source software, enabling users to run free software, to learn from the applications they're running, and to share what they've learned with friends. It's argued that without the Linux kernel, the luxuries of [open culture][2] and free software we enjoy today may not have surfaced when they have. It's highly improbable that the parts of Apple and Microsoft and Google that are open would be open at all without Linux as the catalyst. The impact of Linux as a phenomenon for culture, software development, and user experience cannot be overstated, and yet it all started with a kernel.
A kernel is the software that boots a computer, recognizes—and ensures communication between—all of the components attached to the computer, both inside and outside of the computer case. For code that most users never even think about, much less understand, there are a lot of surprises about the Linux kernel. In no particular order, here's one fact about the kernel for each year of its life:
1. Linux was the first operating system to feature USB 3.0 drivers. Sarah Sharp announced on 7 June 2009 that her driver for USB 3.0 devices was available, and her code was included in kernel version 2.6.31
2. The kernel marks itself as `tainted` when some event occurs that could be useful later for troubleshooting. Its not a problem to run a "tainted" kernel. Should something go wrong, one of the first troubleshooting steps is to try to reproduce the issue on a non-tainted kernel.
3. You can specify a hostname or domain name as part of the `ip=` command-line option, Linux preserves it instead of overwriting it with one proposed by DHCP or BOOTP. For instance, `ip=::::myhostname::dhcp` gets the name `myhostname`.
4. There's a version of a black-and-white, 16-color, and 224-color Tux logo during text bootup.
5. In the entertainment business, DRM is technology used to prevent access to media. However, in the Linux kernel DRM refers to Direct Rendering Manager and refers to library (libdrm) and drivers used to interface with the GPUs of video cards.
6. It's possible to patch the Linux kernel without rebooting.
7. If you compile your own kernel, you can configure your text console to have more than 80 columns.
8. The Linux kernel provides built-in FAT, exFAT, and NTFS (read and write) compatibility.
9. Drivers for Wacom tablets and many similar devices are built into the kernel.
10. Most kernel hackers use the `git send-email` to submit patches.
11. The kernel uses a documentation toolchain called [Sphinx][3], which is written in Python.
12. Hamlib provides shared libraries with a standardized API to control amateur radio equipment through your Linux computer.
13. Hardware manufacturers are encouraged to help develop the kernel in order to ensure compatibility. The hardware can thus be addressed directly without having to download a driver from the manufacturer. Drivers that are directly part of the kernel also automatically benefit from performance and security improvements in new versions of the kernel.
14. There are drivers included in the kernel for many Raspberry Pi modules (Pi Hats).
15. The band netcat released an album playable only as a [Linux kernel module.][4]
16. Inspired by netcat's album release, a module to [turn your kernel into a music player][5] has also been developed.
17. The Linux kernel features supports many CPU architectures: ARM, ARM64, IA-64, m68k, MIPS, Nios II, PA-RISC, OpenRISC, PowerPC, s390, Sparc, x86, Xtensa, and more.
18. In 2001, the Linux kernel became the first to [run the x86-64 CPU architecture in long mode][6].
19. Linux version 3.4 introduced the x32 ABI, allowing developers to compile code to run in 64-bit mode while only using 32-bit pointers and data fields.
20. The kernel supports many different file systems, including Ext2, Ext3, Ext4, JFS, XFS, GFS2, GCFS2, BtrFS, NILFS2, NFS, Overlay FS, UDF, and more.
21. The Virtual File System is a software layer in the kernel providing the filesystem interface to applications users run. It's also an abstraction for the kernel so that different filesystem implementations can coexist.
22. The Linux kernel includes a driver for a physical Braille output device.
23. For kernel version 2.6.29, the Tux logo during boot was replaced by "Tuz" to raise awareness of an aggressive cancer that was affecting the Tasmanian Devil population in Australia at the time.
24. Control Groups (cgroups) are the reason containers (the foundation technology for Docker, Podman, Kubernetes, and much more) can exist.
25. It took extensive legal action to liberate it so it could be included, but today the CIFS module is built into the kernel to enable SMB support. This allows Linux to mount Microsoft remote and cloud-based file shares.
26. It's notoriously difficult (in fact impossible, so far) for a computer to produce a truly random number. The `hw_random` framework can make use of special hardware features on your CPU or motherboard in an effort to improve random number generation.
27. _OS jitter_ is interference experienced by an application caused by conflicts in how background processes are scheduled, and how the system handles asynchronous events (such as interrupts.) Binding tasks to sets of CPUs defined by the kernel, using cgroups, and SMP IRQ affinity are options that the kernel provides programmers for reducing OS jitter. Issues like these are discussed in detail in the kernel documentation, helping programmers targeting Linux can write smarter code.
28. The `make menuconfig` command allows you to use a GUI to configure a kernel before compiling. The `Kconfig` language defines kernel config options.
29. For essential Linux servers, a _watchdog_ system can be implemented to monitor the health of the server. Between health checks, the watchdog daemon writes data to a special watchdog kernel device, preventing a system reset. Should a watchdog fail to log success, the system is reset. Many implementations of watchdog hardware exist, and they're vital for remote mission critical computers (such as those sent to Mars.)
30. Although it was developed on Earth, there's a copy of the Linux kernel on the planet Mars.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/8/linux-kernel
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/kernel-30.png?itok=xmwX2pCQ (30 years)
[2]: https://opensource.com/article/18/1/creative-commons-real-world
[3]: https://opensource.com/article/19/11/document-python-sphinx
[4]: https://github.com/usrbinnc/netcat-cpi-kernel-module
[5]: https://github.com/FlaviaR/Netcat-Music-Kernel-Expansion
[6]: http://www.x86-64.org/pipermail/announce/2001-June/000020.html

View File

@ -0,0 +1,70 @@
[#]: subject: "30 things you didn't know about the Linux kernel"
[#]: via: "https://opensource.com/article/21/8/linux-kernel"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lujun9972"
[#]: translator: "wxy"
[#]: reviewer: "wxy"
[#]: publisher: " "
[#]: url: " "
关于 Linux 内核的 30 件你不知道的事
======
> Linux 内核今年 30 岁了。
![](https://img.linux.net.cn/data/attachment/album/202108/27/150006o152rdghq0zqr02f.jpg)
Linux 内核今年 30 岁了。这开创性的开源软件的三个十年,让用户能够运行自由软件,让他们能从运行的应用程序中学习,让他们能与朋友分享他们所学到的知识。有人认为,如果没有 Linux 内核,我们如今所享受的 [开源文化][2] 和自由软件的累累硕果,可能就不会应时而出现。如果没有 Linux 作为催化剂苹果、微软和谷歌所开源的那些就不可能开源。Linux 作为一种现象,对开源文化、软件开发和用户体验的影响,是怎么强调都不为过的,但所有这一切,都滥觞于一个 Linux 内核。
Linux 内核是启动计算机、并识别和确保计算机内外所连接的所有组件之间通信的软件。这些对于大多数用户从未想过更不用说能理解的代码Linux 内核有很多令人惊讶的地方。以下是 Linux 内核在其三十年生命中每一年的一件事。顺序无关。
1. Linux 是第一个具有 USB 3.0 驱动的操作系统。Sarah Sharp 在 2009 年 6 月 7 日宣布她的 USB 3.0 设备的驱动程序可以使用了,她的代码被包含在内核 2.6.31 版本中。
2. 当某些事件发生时,内核会将自己标记为“受污染”,这在以后的故障排除中可能有用。运行一个“被污染”的内核并不是什么问题。但如果出现错误,首先要做的是在一个没有被污染的内核上重现该问题。
3. 你可以指定一个主机名或域名作为 `ip=` 内核命令行选项的一部分Linux 会保留它,而不是用 DHCP 或 BOOTP 提供的主机名或域名来覆盖它。例如,`ip=::::myhostname::dhcp` 设置主机名 `myhostname`
4. 在文本启动过程中可以选择显示黑白的、16 色的或 224 色的 Tux 徽标之一。
5. 在娱乐业中DRM 是一种用来防止访问媒介的技术。然而,在 Linux 内核中DRM 指的是<ruby>直接渲染管理器<rt>Direct Rendering Manager</rt></ruby>,它指的是用于与对接显卡的 GPU 的库(`libdrm`)和驱动程序。
6. 能够在不重启的情况下给 Linux 内核打补丁。
7. 如果你自己编译内核,你可以将文本控制台配置为超过 80 列宽。
8. Linux 内核提供了内置的 FAT、exFAT 和 NTFS读和写支持。
9. Wacom 平板电脑和许多类似设备的驱动程序都内置在内核中。
10. 大多数内核高手使用 `git send-email` 来提交补丁。
11. 内核使用一个叫做 [Sphinx][3] 的文档工具链,它是用 Python 编写的。
12. Hamlib 提供了具有标准化 API 的共享库,可以通过你的 Linux 电脑控制业余无线电设备。
13. 我们鼓励硬件制造商帮助开发 Linux 内核,以确保兼容性。这样就可以直接处理硬件,而不必从制造商那里下载驱动程序。直接成为内核一部分的驱动程序也会自动从新版本内核的性能和安全改进中受益。
14. 内核中包含了许多树莓派模块Pi Hats的驱动程序。
15. netcat 乐队发布了一张只能作为 [Linux 内核模块][4] 播放的专辑。
16. 受 netcat 发布专辑的启发,人们又开发了一个 [把你的内核变成一个音乐播放器][5] 的模块。
17. Linux 内核的功能支持许多 CPU 架构ARM、ARM64、IA-64、 m68k、MIPS、Nios II、PA-RISC、OpenRISC、PowerPC、s390、 Sparc、x86、Xtensa 等等。
18. 2001 年Linux 内核成为第一个 [以长模式运行的 x86-64 CPU 架构][6]。
19. Linux 3.4 版引入了 x32 ABI允许开发者编译在 64 位模式下运行的代码,而同时只使用 32 位指针和数据段。
20. 内核支持许多不同的文件系统,包括 Ext2、Ext3、Ext4、JFS、XFS、GFS2、GCFS2、BtrFS、NILFS2、NFS、Overlay FS、UDF 等等。
21. <ruby>虚拟文件系统<rt>Virtual File System</rt></ruby>VFS是 Linux 内核中的一个软件层,为用户运行的应用程序提供文件系统接口。它也是内核的一个抽象层,以便不同的文件系统实现可以共存。
22. Linux 内核包括一个实体的盲文输出设备的驱动程序。
23. 在 2.6.29 版本的内核中,启动时的 Tux 徽标被替换为 “Tuz”以提高人们对当时影响澳大利亚的<ruby>塔斯马尼亚魔鬼<rt>Tasmanian Devil</rt></ruby>(即袋獾)种群的一种侵袭性癌症的认识。
24. <ruby>控制组<rt>Control Groups</rt></ruby>cgroups是容器Docker、Podman、Kubernetes 等的基础技术)能够存在的原因。
25. 曾经花了大量的法律行动来解放 CIFS以便将其纳入内核中而今天CIFS 模块已被内置于内核,以实现对 SMB 的支持。这使得 Linux 可以挂载微软的远程共享和基于云的文件共享。
26. 对于计算机来说,产生一个真正的随机数是出了名的困难(事实上,到目前为止是不可能的)。`hw_random` 框架可以利用你的 CPU 或主板上的特殊硬件功能,尽量改进随机数的生成。
27. _操作系统抖动_ 是应用程序遇到的干扰,它是由后台进程的调度方式和系统处理异步事件(如中断)的方式的冲突引起的。像这些问题在内核文档中都有详细的讨论,可以帮助面向 Linux 开发的程序员写出更聪明的代码。
28. `make menuconfig` 命令可以让你在编译前使用 GUI 来配置内核。`Kconfig` 语言定义了内核配置选项。
29. 对于基本的 Linux 服务器,可以实施一个 _看门狗_ 系统来监控服务器的健康状况。在健康检查间隔中,`watchdog` 守护进程将数据写入一个特殊的 `watchdog` 内核设备,以防止系统重置。如果看门狗不能成功记录,系统就会被重置。有许多看门狗硬件的实现,它们对远程任务关键型计算机(如发送到火星上的计算机)至关重要。
30. 在火星上有一个 Linux 内核的副本,虽然它是在地球上开发的。
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/8/linux-kernel
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[wxy](https://github.com/wxy)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/kernel-30.png?itok=xmwX2pCQ (30 years)
[2]: https://opensource.com/article/18/1/creative-commons-real-world
[3]: https://opensource.com/article/19/11/document-python-sphinx
[4]: https://github.com/usrbinnc/netcat-cpi-kernel-module
[5]: https://github.com/FlaviaR/Netcat-Music-Kernel-Expansion
[6]: http://www.x86-64.org/pipermail/announce/2001-June/000020.html