ASCII.jp Windows 11 has also improved the ARM version

ASCII.jp Windows 11 has also improved the ARM version

Windows 11 also has an ARM version.At first I was making a noise when Windows 10, but I have never seen a person who actually used it except for ARM.However, I bought Surface Pro X because it was a job.A preview version came to this machine on Windows Insider Program's Beta Channel.The ARM version of Windows 11 has been enhanced, and has a X64 code binary conversion function that was only provided in the preview version for Windows 10.This time, I will explain the situation of the ARM version of Windows 11, including this area.

Windows 11 also supports ARM processors

Arm processor arrangement again

The story is a bit confusing, so I'll organize the terms a little first.The first is about the ARM processor.Intel and AMD CPUs are distinguished by the name of "generation" and "microar kitecha", but in the ARM processor, the architecture has a version number.However, the number was organized from Armv7.For PC -related, just consider subsequent architectures.The XSCALE that Intel once "handed over" from DEC and sold it off without going well is the ARMV5 generation.Android initially supported this generation, but now only ARMV7 or later.

Simply put, ARMV7 is 32 -bit architecture and ARMV8 is 64bit architecture.At present, there is an architecture called ARMV9, but it can be considered as enhanced ARMV8-A, and at least the difference between both Windows 10 and Windows 11 is not a problem.

ARMV8 contains an Armv7 instruction set and an execution environment, which is called AARCH32.

This 32 -bit instruction set is called the A32 instruction set.In the era of ARMV7, there was no call called AARCH32 or A32 instruction set, and was called ARM architecture.When the 64 -bit environment came out in ARMV8, a different A64 instruction set from ARMV7 was introduced, and a register was added to define it as AARCH64.At this time, the 32 -bit execution environment up to ARMV7 was called AARCH32.For this reason, the original definition of ARMV7 was not called AARCH32, but the story is troublesome, so use the ARMV7 called AARCH32 and A32.

ARMV8 supports both AARCH32/A32 and Aarch64/A64.This is the same as AMD and Intel CPUs have both 32 -bit mode and 64 -bit mode.What I want to clarify here is that it has a different instruction set called A32 and A64.In general, if one CPU has a different instruction set, the program will be made using either instruction set.Switching the mode in the middle of the program is not impossible as a hardware, but switching in mode is often a privileged order or setting the execution environment, so mode in one program.It is normal that the OS does not allow to switch.So, in general, the application is made with only one instruction set.

ASCII.jp Windows 11ではARM版も改良が進んだ

The OS determines basic rules such as procedures to call APIs.This is called ABI (Application Binary Interface).In hardware, programs can have a variety of structures, but the application program cannot be displayed on the screen unless you use the API provided by the OS, unless you read the file.

The ABI stipulates the rules for calling API (called Calling Conference), the boundary (alignment) when placing data and programs in memory, and how to use the stack when calling API.For example, there are rules such as which register to be placed on the argument when passing an argument using a register to speed up, and what to put in the stack.In addition, there are various rules, such as a registered register that has a unique role in some general -purpose registers and must be stored.

However, when writing applications in high -end languages such as C and C ++ for this ABI, the developer does not need to worry too much because the compiler will process it.However, when writing a program in the assembler, the developer must write a program in accordance with the ABI.

The ABI defined by Microsoft for Windows 10 for the Arm version is called the ARM64 ABI.This is a Windows -specific ABI.The ARM processor also operates Linux, and Android and Chromebook use ARM processors.However, the ABI is different from Microsoft's ARM64 ABI.However, the ARM64 ABI was based on ABI defined by ARM.

On the other hand, some ABIs are defined for conventional AMD and Intel CPU.These are called the X86 ABI or the X64 ABI.The ARM64 ABI has different parts depending on the X64 ABI for the same 64 -bit, Calling Conference, algorithm for alignment, and stack use.In many cases, the ABI is optimized for each CPU, so if the architecture is different, it is usually different.

Windows and code type

In general, application programs are created using a specific CPU architecture instruction set in accordance with this ABI.Here, this is called "code type".The Windows code type is as shown in the table below.

The 64 -bit version Windows can execute X86 and X64 code.On the other hand, the ARM version Windows 10 can convert the conventional X86 code to the A64 instruction set by "binary conversion", but of course the ARM64 code can be executed.

According to Microsoft's documentation, the ARM version Windows 10 is made of ARM64.However, the X86 / X64 code has a different ABI from ARM64.This means that the alignment, Calling Convenition, and the use of stacks are different.Even if the X86 / X64 code can be converted to an A64 instruction set program by binary conversion, it cannot be converted to the ABI.It is unknown what algorithms and codes are compatible with ABI.To convert this, it is necessary to know the meaning of the program.

However, the converted X86 / X64 code should be a stack or alignment, etc. in conjunction with the X86 / X64 ABI at the moment when the API is called, so it is mechanically converted to ARM64.It is possible.In software, small programs that make these conversion are sometimes called "stubs".Probably, in the ARM version of Windows, a stub was placed before entering the API, and it was thought that the ARM64 ABI was compliant and called the API.Since the Windows API is in the DLL, the API call is the same as the DLL call.

The ARM version of Windows 10 cannot load the X86 code components (DLL) for which the application incorporates the expansion of hooks and express.These cannot be inserted because they are not API calls, the module on the Windows side complies with the ARM64 ABI, and the X86 code converted to binary is compliant with the X86 ABI, so it does not work correctly.is.This is because the ARM version of Windows 10 did not work well with ATOK and some Explorer extensions.

Furthermore, although the ARM version Windows 10 is limited to X86, the third party's response has not progressed much.One of the reasons is that there are types of applications that are difficult to create ARM64 versions.It is an application written on a part of the code using the X86 / X64 assembler.Since this is a completely X86 / X64 order, it is necessary to rewrite it with the A64 instruction.However, it is not an easy task because the CPU architecture is different.