32/64位应用程序,操作系统和处理器之间有什么关系? [英] What's the relation between 32/64-bit application, OS and processor?

查看:249
本文介绍了32/64位应用程序,操作系统和处理器之间有什么关系?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经搜索了这些主题,但是不确定我是否正确理解了它们之间的关系.我总结了以下几点,请纠正/补充.

I've googled these topics, but not sure if I understood their relations correctly. I summed up the following points, please correct/complement.

  • 32位或64位处理器意味着该处理器可以一次处理32/64位.使用32位或64位处理器表示基础寄存器,地址总线或数据总线也具有相同的大小.

  • 32-bit or 64-bit processor means the processor can process 32/64 bits at once. Using 32-bit or 64-bit processor indicates the underlying registers, address buses, or data buses are also of the same size.

为了在32/64位处理器上工作,我们有32/64位操作系统

In order to work on 32/64-bit processor, we have 32/64-bit OS

为了在32/64位操作系统中工作,我们开发了32/64位应用程序

In order to work in 32/64-bit OS, we develop 32/64-bit application

可以在64位OS中运行32位应用程序,也可以在32位OS中运行64位应用程序( LinuxPAE64 )

It is possible to run 32-bit application in 64-bit OS, as well as 64-bit application in 32-bit OS(LinuxPAE64)

无法在32位处理器上运行64位应用程序/操作系统

It is not possible to run 64-bit application/OS on 32-bit processor

此外,我还有两个与记忆有关的问题.

Also, I've got two questions relates to memory.

  1. 处理器的内存映射布局似乎与处理器的指令大小无关.例如,大多数Intel Core 2系统(64位)的内存映射都非常接近下图. 为什么 64位处理器没有选择更大范围的内存映射?

  1. The layout of the memory map of a processor seems independent of the processor's instruction size. For example, most Intel Core 2 systems(64-bit) have a memory map pretty close to picture shown below. Why the 64-bit processor does not choose a wider range of memory map?

什么将64位操作系统限制为使用(2 ^ 64-设备/总线地址)大小的RAM?

What limits a 64-bit OS to use up to (2^64 - device/bus addresses) size of RAM?

推荐答案

有很多不同类型的处理器(ARM,MIPS,x86等).

There are many different kinds of processors out there (ARM, MIPS, x86, …).

我只能谈论x86(32位)/x86-64(64位).

I can just talk about x86(32bit)/x86-64(64bit).

位数主要是指寄存器的大小.对于x86,虚拟地址空间限制为32位(4GiB).这意味着32位应用程序(假定它在32位CPU上运行的应用程序)一次只能看到4GiB.

The bit count refers mainly to the register size. For x86 the virtual address space is restricted to 32-bit (4GiB). That means a 32-bit application (an app that assumes it runs on a 32-bit CPU) can only see 4GiB at once.

对于x86-64,所有虚拟地址的大小均为64位.但是,通过要求所有不受支持的位与最高支持的位具有相同的值,CPU可以自由地不支持所有64位.操作系统必须查询支持的位数. (我的Core i5在这里支持48位)

For x86-64 all virtual addresses are 64-bit in size. But CPUs are free not to support all 64-bits, by requiring all unsupported bits to have be the same value as the most significant supported bit. The OS has to query the number of supported bits. (my Core i5 supports 48-bits here)

x86的物理地址空间(即CPU实际可以处理的内存量)最初为32位.但是自奔腾1以来,CPU支持物理地址扩展(PAE),从而允许多达36位的(64GiB) RAM. (操作系统必须启用扩展程序)

The physical address space, i.e. the amount of memory that can actually be handled by the CPU, is for x86 in the first place 32bit in size. But since about Pentium 1, CPUs support an Pyisical Address Extension (PAE) allowing up to 36-bit (64GiB) of RAM. (The OS has to enable the extension)

目前,x86-64将物理地址空间限制为52位(4PiB).在这里,CPU再一次免费支持更少的位. (我的Core i5在这里支持36位)

For now x86-64 restricts physical address space to 52-bit (4PiB). Where here again CPUs a free to support less bits. (my Core i5 supports 36-bit here)

由于x86和x86-64都使用相同的操作码,但含义稍有不同,因此32位应用程序不能仅在64位CPU(64位模式/长模式)上运行.

Since both x86 and x86-64 use the same opcodes with slightly different meanings, a 32-bit application can not just run on a 64-bit CPU (in 64-bit mode/long mode).

但是x86-64具有所谓的兼容模式(长模式的子模式),它允许它执行32位应用程序. (操作系统必须切换模式.)

But x86-64 has a so called compatibility mode, (a sub-mode of long mode), that allows it execute 32-bit apps. (The OS has to switch the mode.)

处理器未选择内存映射.这是mainbord& BIOS,并且可以部分由OS进行配置.产生主力&的原因BIOS制造商将所有内容保留在地址空间的较低4GiB中,与32位OS兼容. (出于与旧16位DOS应用程序兼容的原因,默认情况下,即使x86-64 CPU也默认禁用对物理地址空间的每个第二MiB的访问)

The memory map is not chosen by the processor. It is the responsibility of the mainbord & BIOS, and can partly be configured by the OS. The reason for the mainbord & BIOS manufactures to keep all the stuff in the lower 4GiB of address space, is compatibility with 32-bit OSes. (For compatibility reasons with old 16-bit-DOS-apps, even x86-64 CPUs by default disable accesses to every 2nd MiB of physical address space)

如前所述,x86-64根据规范将物理地址空间限制为52位.更远的是受CPU实现限制的地址空间,甚至受mainbord实现限制的地址空间. (这样做是为了减少实施成本).因此,无法寻址2⁶⁴RAM.

As a mentioned x86-64 restricts the physical address space to 52-bit by specification. Farther is the address space restricted by CPU implementation and even farther by mainbord implementation. (All that is done to reduce implementation costs). So there is no way to address 2⁶⁴ of RAM.

这篇关于32/64位应用程序,操作系统和处理器之间有什么关系?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆