关于64为计算机

learn English。

这说的是什么啊,看了半天就是没看懂!!!

An introduction to 64-bit computing
介绍64位计算

Way back in the eighties, my first computer was a Commodore 64—so named because it had 64 kilobytes of memory. Today there are few applications around that could fit into such a small space, and these grow larger as time goes on. A web browser can use tens of megabytes of memory without even loading a web page. Computers are fitted with ever larger amounts of RAM to make the applications run faster, and the applications make use of this by providing an ever increasing range of features.
在我十八岁岁,我的第一台电脑是叫做“Commodore 64-so”, 因为它有64k的内存, 今天, 它有几个适合小内存的应用可以运行,随着时间的推移,越来越大,一个web浏览器在没有加载页面的时候使用几十兆的内存。电脑需要大量的内存来让应用快速执行,应用程序也利用这来提供更多的功能。

Hand in hand with the need for greater amounts of RAM is the need to access it quickly. Most home computers are fitted with 32-bit microprocessors, and these are beginning to show the strain.

hand in hand 需要更大的内存来访问更快,很多家庭电脑配备的是32为处理器,现在开始反应变慢了。

A 64-bit microprocessor is one with integer registers that hold 64 bits and which can move 64 bits of data between memory storage and a register in the CPU in a single operation. The HP® Alpha™ processor, the Apple® PowerPC G5™, and AMD® Opteron™/Intel® EM64T are examples. Those last few are unlike the Alpha in that although they were designed for 64-bit operation, they can also run programs intended for earlier 32-bit processors.
一个64位处理器是证书寄存器有64位,这样可以在单个操作中的内存和寄存器都移动64位。The HP® Alpha™ processor, the Apple® PowerPC G5™, and AMD® Opteron™/Intel® EM64T 都是这样,最后的几个Alpha尽管为64位设计,但是可以运行早期的32为程序。

This makes migrating from earlier systems much easier because generally the older software will still work. Indeed, at the moment you may well find that a brand new 64-bit computer will be sold with an operating system that was compiled for a 32-bit processor.
这样是早期系统子更容易迁移,在迁移的时候保持运行。事实上,这会你可能发现64位计算机被装上32位程序出售。

One of the interesting things about this type of processor is that a 64-bit operating system is able to run both 32-bit and 64-bit programs concurrently. Linux (meaning the GNU toolchain as well as the Linux kernel) has been ported to run on a variety of such processors.
一个有趣的事情是64位操作系统可以运行在32位和64位兼容程序,linux可以运行多种这样的程序。

If you are not lucky enough to have access to a 64-bit computer, you might be wondering about some of the implications of having a 32-bit environment alongside the 64-bit one. Read on.
如果不够幸运,不得不用一个64位计算机,你可能想知道很多关联32为环境,继续看。

Implications
关联

File system layout
文件布局

A 64-bit operating system provides libraries compiled for the newer instruction set. To run a dynamically-linked 32-bit binary application, any libraries it needs must also be available in the 32-bit instruction set. Also, any libraries those libraries are dynamically linked against need to be available in that form, right down to the C library itself (such as glibc on GNU systems).
一个64位操作系统提供新指令集的编译库。运行一个动态链接的32为二进制应用,任何lib需要在32位指令集中有效,同样,任何lib动态链接到可用的形态,一直到C lib库。

So, to run 32-bit programs on a 64-bit system, two flavors of the C library (and more libraries besides) need to be provided by the operating system, and these extra libraries need to reside somewhere in the file system. Multiple instances of a particular library, each for a different instruction set supported by the processor, is often known as multilib.
所以,在64位系统上运行32位程序,操作系统提供两种不同的Clib(很多lib被移除),这些额外的lib需要驻留在文件系统的某处,很多特殊的依赖库,依赖不同的程序指令集,被叫做multilib.

Where to put the extra libraries is a problem without an obvious solution. Different approaches are equally arbitrary. The one used in Red Hat® Enterprise Linux® and in the Filesystem Hierarchy Standard (FHS) is that the /lib/ directory (and /usr/lib/) is for 32-bit libraries, and 64-bit libraries go in /lib64/ (and /usr/lib64/). Debian uses /lib/ for 64-bit libraries, and puts 32-bit ones in /lib32/. Sorting out which directory is which is done by the dynamic loader, and thus it is transparent to the 32-bit program running on a 64-bit processor.

导入额外的包不是一个明显的解决方案。不同问题同样处理。在redhat里的FHS,lib目录(/usr/lb)目录对于32为库,64位对应/lib64(/usr/lib64),debian 使用/lib 代替64位库,使用lib32表示32位,通过动态加载的顺序排序,因此,他是容易的方法让32位程序运行在64为处理器上。

32-bit (compat) libraries     64-bit (native) libraries
Fedora Core     /lib/, /usr/lib/     /lib64/, /usr/lib64/
Debian     /lib32/, /usr/lib32/     /lib/, /usr/lib/

You might wonder where that 32-bit program should be placed in the file system, and whether there should be a similar scheme for the /bin/ directory as there is for /lib/. However, there is generally no need for that. Binary programs provided by the operating system only need to be compiled for the 64-bit instruction set as a rule. Binary programs installed by third party packages will have different names to those provided by the operating system. Aside from this, third party packages often install their files into /usr/local/ or /opt/.
你可能想知道32位程序要放在那里,书否有一个/bin/lib/这样的目录,然而,通常是不需要的,二进制程序包含在操作系统中只需要编译成64位的指令集,二进制程序安装第三方包时需要不同的名字,除此之外,第三方包需要安装到他们的目录/usr/local /opt

Plug-ins
插件

The ability to run software compiled for older processors on newer ones is certainly useful but things are not always so simple. Not all applications are provided in the form of standalone programs—some are provided as plug-ins to other applications. One such example is the Macromedia® Flash™ plug-in for web browsers. Currently this plug-in is available for Linux but only for 32-bit Intel-compatible processors.
能够运行遍历在老的处理器上,在新的处理器上一定是有用的,但是通常不简单,不是所有的应用都独立的提供给其他应用程序插件,一个例子是 Macromedia® Flash™ web插件,当前插件可以用在linux,但是只能运行在32位intel处理器上。

A web browser plug-in is a library that gets dynamically loaded by the web browser program. It is not currently possible in Linux for a 64-bit program to dynamically load a 32-bit library. This means that the 64-bit Mozilla Firefox in Fedora Core (for example) cannot use the Macromedia Flash plug-in at all.
一个web浏览器插件获取动态加载web程序,他现在还不能运行在64位程序上,加载32位库,这意味着64位firefox不能使用 Macromedia Flash插件。

One work-around is to uninstall the 64-bit Mozilla Firefox package and install the equivalent package from the 32-bit Fedora Core distribution. The result is that the web browser is a 32-bit application, and this makes it possible to load 32-bit plug-ins such as Flash. It does, however, make it impossible to use any 64-bit plug-ins.
一个应急措施是卸载64位firefox,安装32为环境的代码,结果就是web浏览器是32为的,这让它可以加载32位的插件Flash,它可以,然而,把它使用到任何64位插件上。

Scripts and interpreters
脚本和解析器

Programs that are written in interpreted languages rather than being compiled like C have a somewhat easier time of it in this multilib environment. There are still complications even for them.
程序用解释性语言比用编译性语言C在多包情况下容易一些,它任然有一些麻烦的地方。

Shell scripts may even be affected by the architecture they are running on. It may be that a shell script will take different courses of action depending on the output of the uname command. This command uses the uname system call to ask the kernel about various aspects of the system hardware.
shell脚本可能在运行的结构上会受到影响,一个shell脚本会有不同的执行路线,使用不同命令。这个命令使用uname 系统调用,问内核关于系统硬件的版本。

The behavior of the uname command can be adjusted using the setarch command. On an AMD64 machine, for instance, uname -m displays x86_64, but setarch i686 uname -m displays i686. This command comes from the setarch RPM package.
uname的行为可以用setarch命令,在AMD64机器,比如:uname -m 展示x86_64,但是setarch i686 uname 0m 显示i686,这个命令来自RPM。

Additional complications
附加的麻烦

There are packaging issues which have been overcome to make Red Hat Enterprise Linux capable of installing a package in both 32-bit and 64-bit forms at the same time. Packages can be split into two groups: those that will, and those that will not, be installed in both 32-bit and 64-bit variants on the same system. Those that will be installed twice are known as multilib packages, and they have to meet certain requirements for things to work properly. Multilib packages tend to be system libraries such as glibc, zlib, and gtk2.
一个啊安装问题,是克服了Red Hat Enterprise Linux 可以同时安装32和64位的安装包,库会分成两个组,那将会同时安装32和64位系统,这些包会安装两次,他会要有特殊的要求才能工作,Multilib 包正在变成系统库,想glibc, zlib, and gtk2.

To install two instances of the same RPM package, certain rules are followed to avoid conflicts. For compiled programs—but not for libraries—the 64-bit version is installed and the 32-bit version is discarded. All other types of files must be exactly the same in both the 32-bit and the 64-bit package.
对于安装两个相同的RPM包,首要的是要避免冲突,编译程序,但是不对应64位版本,32位版本默认是丢弃的,所有其他的文件必须完全相同。

原文地址:https://www.cnblogs.com/wanself/p/2755822.html