Version Numbering

Before digging into programming, we should comment on the version numbering scheme used in Linux and which versions are covered by this book. 在深入编程之前,我们应该评论一下 Linux 中使用的版本编号方案以及本书涵盖了哪些版本。

First of all, note that every software package used in a Linux system has its own release number, and there are often interdependencies across them: you need a particular version of one package to run a particular version of another package. The creators of Linux distributions usually handle the messy problem of matching packages, and the user who installs from a prepackaged distribution doesn't need to deal with version numbers. Those who replace and upgrade system software, on the other hand, are on their own in this regard. Fortunately, almost all modern distributions support the upgrade of single packages by checking interpackage dependencies; the distribution's package manager generally does not allow an upgrade until the dependencies are satisfied. 首先,请注意,Linux 系统中使用的每个软件包都有自己的版本号,并且它们之间通常存在相互依赖关系:您需要一个软件包的特定版本来运行另一个软件包的特定版本。 Linux 发行版的创建者通常会处理匹配包的混乱问题,而从预打包发行版安装的用户不需要处理版本号。 另一方面,那些更换和升级系统软件的人在这方面是靠自己的。 幸运的是,几乎所有现代发行版都支持通过检查包间依赖关系来升级单个包; 在满足依赖关系之前,发行版的包管理器通常不允许升级

To run the examples we introduce during the discussion, you won't need particular versions of any tool beyond what the 2.6 kernel requires; any recent Linux distribution can be used to run our examples. We won't detail specific requirements, because the file Documentation/Changes in your kernel sources is the best source of such information if you experience any problems. 要运行我们在讨论中介绍的示例,除了 2.6 内核需要之外,您不需要任何工具的特定版本; 任何最近的 Linux 发行版都可以用来运行我们的示例。 我们不会详细说明具体要求,因为如果您遇到任何问题,内核源代码中的文件 Documentation/Changes 是此类信息的最佳来源。

As far as the kernel is concerned, the even-numbered kernel versions (i.e., 2.6.x) are the stable ones that are intended for general distribution. The odd versions (such as 2.7.x), on the contrary, are development snapshots and are quite ephemeral; the latest of them represents the current status of development, but becomes obsolete in a few days or so. 就内核而言,偶数内核版本(即 2.6.x)是用于一般分发的稳定版本。 相反,奇怪的版本(例如 2.7.x)是开发快照并且非常短暂; 其中最新的代表了当前的开发状态,但在几天左右就会过时。

This book covers Version 2.6 of the kernel. Our focus has been to show all the features available to device driver writers in 2.6.10, the current version at the time we are writing. This edition of the book does not cover prior versions of the kernel. For those of you who are interested, the second edition covered Versions 2.0 through 2.4 in detail. That edition is still available online at Linux Device Drivers, Second Edition [LWN.net].本书涵盖了 2.6 版内核。 我们的重点是展示 2.6.10 中设备驱动程序编写者可用的所有功能,这是我们编写时的当前版本。 本书的这个版本不包括内核的早期版本。 对于那些感兴趣的人,第二版详细介绍了 2.0 2.4 版本。 该版本仍可通过 http://lwn.net/Kernel/LDD2/ 在线获得。

Kernel programmers should be aware that the development process changed with 2.6. The 2.6 series is now accepting changes that previously would have been considered too large for a "stable" kernel. Among other things, that means that internal kernel programming interfaces can change, thus potentially obsoleting parts of this book; for this reason, the sample code accompanying the text is known to work with 2.6.10, but some modules don't compile under earlier versions. Programmers wanting to keep up with kernel programming changes are encouraged to join the mailing lists and to make use of the web sites listed in the bibliography. There is also a web page maintained at API changes in the 2.6 kernel series [LWN.net], which contains information about API changes that have happened since this book was published. 内核程序员应该知道,2.6 的开发过程发生了变化。 2.6 系列现在接受以前被认为对于“稳定”内核来说太大的更改。 除此之外,这意味着内部内核编程接口可能会发生变化,因此可能会导致本书的某些部分过时; 出于这个原因,已知文本随附的示例代码可用于 2.6.10,但某些模块无法在早期版本下编译。 鼓励希望跟上内核编程变化的程序员加入邮件列表并使用参考书目中列出的网站。 http://lwn.net/Articles/2.6-kernel-api/ 还维护了一个网页,其中包含有关自本书出版以来发生的 API 更改的信息。

This text doesn't talk specifically about odd-numbered kernel versions. General users never have a reason to run development kernels. Developers experimenting with new features, however, want to be running the latest development release. They usually keep upgrading to the most recent version to pick up bug fixes and new implementations of features. Note, however, that there's no guarantee on experimental kernels,[2] and nobody helps you if you have problems due to a bug in a noncurrent odd-numbered kernel. Those who run odd-numbered versions of the kernel are usually skilled enough to dig in the code without the need for a textbook, which is another reason why we don't talk about development kernels here. 本文没有专门讨论奇数内核版本。 一般用户永远没有理由运行开发内核。 然而,尝试新功能的开发人员希望运行最新的开发版本。 他们通常会不断升级到最新版本以获取错误修复和新功能的实现。 但是请注意,实验内核无法保证,[2] 如果您因非当前奇数内核中的错误而遇到问题,没有人可以帮助您。 那些运行奇数版本内核的人通常足够熟练,可以在不需要教科书的情况下挖掘代码,这也是我们在这里不讨论开发内核的另一个原因。

Another feature of Linux is that it is a platform-independent operating system, not just "a Unix clone for PC clones" anymore: it currently supports some 20 architectures. This book is platform independent as far as possible, and all the code samples have been tested on at least the x86 and x86-64 platforms. Because the code has been tested on both 32-bit and 64-bit processors, it should compile and run on all other platforms. As you might expect, the code samples that rely on particular hardware don't work on all the supported platforms, but this is always stated in the source code. Linux 的另一个特点是它是一个独立于平台的操作系统,而不仅仅是“PC 克隆的 Unix 克隆”:它目前支持大约 20 种架构。 本书尽可能独立于平台,所有代码示例都至少在 x86 x86-64 平台上进行了测试。 因为代码已经在 32 位和 64 位处理器上测试过了,它应该可以在所有其他平台上编译和运行。 正如您所料,依赖于特定硬件的代码示例并不适用于所有受支持的平台,但这始终在源代码中说明。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

mounter625

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值