Sunday 10 January 2010

Запуск 32 битного ПО на 64 битном Линуксе

32-bit chroot

The AMD64 processor is able to quickly switch between 32-bit and 64-bit modes on the fly, thus small static 32-bit applications should work perfectly on a 64-bit system without any modification to either the system or the application. Alas, most modern applications dynamically link to one or more libraries and it is essential that applications link to libraries of their own type or the program will fail.

One easy way to obtain this is to install a 32-bit system, complete with all libraries and applications but without a kernel, into a chroot. A chroot is a software device that creates a "jail" on the host's file system and applications running inside the jail cannot see out off it.

Creating and running a 32-bit chroot is clearly explained in the Debian AMD64 How-to linked below. It is relatively easy to do but like the dual boot and virtual machine solutions it requires a lot of disk space and is a lot of effort if you only need one 32-bit application.

и еще:

32-bit compatibility
Compatibility to 32-bit code has been a crucial goal in the design. First of all it allows to run unmodified 32-bit code inside a 64-bit environment. Syscalls are used to switch between both worlds.

The processor zero-extends all 32-bit addresses to 64-bit. Applications use the lower 4 GB of the address space. However, physically that can be mapped anywhere. The kernel manages the compat layer for all applications, meaning it resolves bitness differences, structure layouts and invokes the right library version (/lib{32,64}/

Speaking of libraries - each library has to be present twice, once for 32-bit and once for 64-bit, which also includes all dependent ones down to the lowest.

With the Linux compat layer it is even possible to run an entire and unmodified 32-bit Linux installation with a 64-bit kernel.

(с) и

No comments :

Post a Comment

Note: only a member of this blog may post a comment.