Why 32-bit drivers do not work on 64-bit

From past readings, it seems that most 32-bit drivers will not work on the 64-bit version.

At a purely conceptual level, I see that a 64-bit machine has an extra β€œroom” when using 32-bit drivers, so I’m trying to determine why they will not work most often. (me from user space)

I read this x86-64 wiki article that reads

Points and stack exits always consist of 8-byte steps, and pointers are 8 bytes wide.

I see that this may be the reason that the 32-bit driver may fail on a 64-bit basis, as it produces pop (), which outputs twice as much data as the driver expected.

What I just mentioned may be completely incompatible with the fact that I'm a guy in user space, and in this case, or otherwise, what practical examples (explanation of code or layman) about why 32-bit drivers fail, run on 64 bit?

+6
source share
4 answers

Simply put, you cannot store a 64-bit address in a 32-bit pointer. Therefore, if your code involves passing back and forth pointers to the operating system, as device drivers usually do, this will not end well.

Drivers are often associated with moving data between fiscal devices (such as a disk) and memory. The driver will be prompted to transfer the X sectors of the disk to memory at address Y.

On a 64-bit OS, Y will be a 64-bit address, so your 32-bit driver will not be able to handle this. And, of course, the problem is that the size of the passed pointer is twice as expected, therefore, if it starts it, there will probably be a stamp over all the wrong memory ...

+6
source

Remember that drivers exist to talk to hardware. What if a 32-bit driver code was loaded into a memory area that contains more than 4 gigabytes, where are the hardware registers with memory mapping ? The driver code will be written to memory, which has nothing to do with itself or the equipment that it was supposed to drive.

+4
source
Processors

x86-64 cannot run 32-bit code in privileged mode (kernel). Compatibility mode is available only for user space.

0
source

My 2 cents. Microsoft does not give rats the clutter it causes when releasing updates or patches.

Especially about Legacy hardware compatible with the x64 generation OS. I am talking here about a lot of scientific equipment, in which there are only 32-bit drivers with this equipment, which are not available and are not supported anymore, thereby leaving Labs running XP or at best 7 x86. Similarly, consumers bought biometric scanners and various medical equipment.

The x64 path was supposed to be designed to host legacy 32-bit hardware.

0
source

Source: https://habr.com/ru/post/890232/


All Articles