Linux如何同时支持32位和64位?或者这是 glibc 中处理的东西?

发布于 2024-08-06 04:10:38 字数 219 浏览 3 评论 0原文

Linux 如何同时支持 32 位和 64 位?或者这是 glibc 中处理的东西?

我运行 CentOS 5.3,它是“64 位”版本;尽管我为 64 位和 32 位构建了东西。据我所知,Windows 应该有一个 32 位模拟器。 Linux 也做同样的事情吗?是在用户空间还是内核空间?

如果 libc 处理它,它是否有点像模拟器说,我将链接 32 位应用程序,但与内核对话 64 位?

How is Linux simultaneously 32bit and 64bit? Or is that something handled in glibc?

I run CentOS 5.3 and it is a "64 bit" version; although I build things for 64 bit and 32 bit. From what I think I know, Windows supposedly has a 32bit emulator. Does Linux do the same thing? Is it in userspace or kernel space?

If libc handles it, is it kind of like a emulator that says, I'll link with 32 bit apps, but speak 64 bit to the kernel?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

橙幽之幻 2024-08-13 04:10:38

CPU可以执行64位和32位指令,内核可以在模式之间切换。唯一的限制是您无法将 32 位程序链接到 64 位库,因此您必须同时安装 32 位和 64 位版本的 libc 等。

The cpu can execute both 64 and 32bit instructions and the kernel can switch between modes. The only limitation is that you cannot link 32bit programs against 64bit libraries so you must have both 32 and 64bit versions of libc, etc. installed.

撞了怀 2024-08-13 04:10:38

没有什么可以阻止 CPU 从 64 位切换到 32 位。它只是切换。

您可以拥有 64 位内核并运行 32 位应用程序。您甚至可以拥有 32 位内核并运行 64 位应用程序 (Mac os x)。

但是,您需要它们使用的库也是 32 位或 64 位,这就是为什么您可能会在 Linux 上看到 64 位或 32 位库的名为 lib64 或 lib32 的文件。

Nothing is stopping the cpu from switching from 64bit to 32bit. It just switches.

You can have a 64 bit kernel, and run 32bit apps. You can even have a 32bit kernel and run 64bit apps(Mac os x).

However you need the libaries they use to also be 32bit or or 64bit, which is why you might see files called lib64 or lib32 on linux for the 64bit or 32bit libaries.

瑕疵 2024-08-13 04:10:38

由于 x86_64 处理器是基于 x86 技术设计的,因此它们仍然能够支持 32 位程序,而无需任何硬件模拟,就像在 PowerPC 或 Sparc 环境中运行 x86 程序所需的那样。在 Linux 中,您所需要做的就是安装运行 32 位软件所需的软件库。

Because x86_64 processors are designed over x86 technology, they are still able to support 32-bit programs without any hardware emulation, like what you would need to run x86 programs in a PowerPC or Sparc environment. In Linux, all you need to do is install the necessary software libraries to run the 32-bit software.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文