软件从x86移植到arm需要做什么?

I know that lately Microsoft is trying to help ARM getting into the Windows laptop market (and I personally think it’s good idea), but that so far most of the software available on Windows is designed only for x86 architecture, so any arm-based windows machine right now runs most of its programs inside an emulator.
What I don’t understand is why porting those applications into arm architecture would be so demanding. I guess most of them are written in C or C++, and only a few of them have parts written directly in assembly, so why isn’t it as simple as running a compiler? I’m studying C right now and I know some stuff can work differently depending on the machine you run the program into, and we’ve been taught to avoid writing machine dependent code if possible. But for the most part it looks like you can write a program in C and compile it for any machine supported by the compiler without too many worries (except for machines with strongly limited resources of course).
So where is the problem that prevents companies from porting their software into arm architecture? Is it about some optimization problems, or is it because of some behaviours that may change when compiling for another architecture, requiring many efforts in debugging?

目前微软在尝试为windows laptop支持ARM,现在windows的方案是在x86里运行ARM的模拟器。
我不是很懂移植到ARM需要做什么工作,我感觉现在很多软件都是用C/C++写的,只有少数是汇编写的,所以是不是只要换个编译器就可以构建出ARM的软件了?
所以,目前把软件一直到ARM的难点在哪里?

Most c or c++ programs written for windows “just” need to be recompiled and tested on the new plafrom, as the compiler takes care of making the executable match the instruction set. As long as your compiler is able to target ARM, you can do this. So far, so good. However, virtually all real-world programs depend on vendor or open source libraries that would also have to be compiled on ARM. If even one of these libraries is not available on ARM, your software won’t work. If it’s an open souce library, you can try to rebuild it. if it’s a closed-source library, you’re stuck.

Programs written in languages that depend upon a runtime (e.g. Java, Python) to execute their bytecode or other intermediate language representation need that rumtime to have been ported to ARM in the same way that any other c or c++ program was. I don’t know the status of this. A google search indicated Java was ported.

If your compiler, all libraries, and runtimes all support ARM, it still takes time and money. At that point, you need to decide whether the returns are worth it.

windows的大多数软件只是需要重新编译并在新平台上测试就可以了,因为编译器会为代码寻找对应架构的指令集并翻译。你只需要只要把编译器换成目标平台ARM的编译器。然而,软件存在依赖的问题,假如说软件所依赖的上游软件/库没有转向ARM平台,或者他是闭源的,即使你把当前软件重新在ARM上编译,也没办法运行。

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Debian是一个流行的开源操作系统,最初是为x86架构设计的。但是,由于ARM处理器广泛应用在嵌入式设备和移动设备中,因此进行将Debian移植ARM架构的工作。 在移植Debian到ARM上时,首先需要考虑处理器架构的差异。ARM架构与x86架构在指令集和硬件设计上存在显著区别,因此必须对Debian进行相应的修改和适配。 移植Debian到ARM的第一步是选择合适的硬件平台。ARM处理器有很多型号和系列,因此需要根据目标设备的特性和需求来选择合适的ARM处理器。选择正确的硬件平台可以确保Debian在ARM上的性能和兼容性。 接下来,需要进行内核的移植工作。ARM架构使用不同的内核代码和驱动程序,需要对Debian内核进行修改和重新编译。这包括修改内核参数,加载适当的驱动程序和模块,以确保Debian可以正确地运行在ARM设备上。 此外,Debian的软件包也需要相应地移植和适配。由于ARMx86缺少二进制兼容性,Debian软件需要重新编译为适用于ARM架构的可执行文件。这通常需要修改软件包的配置和脚本,以确保它可以正确地在ARM上工作。 移植Debian到ARM的过程需要花费一定的时间和精力,并且需要开发人员具备相应的技能和知识。然而,一旦成功完成移植,Debian在ARM设备上将能够提供强大的功能和稳定性,使用户能够在各种嵌入式设备和移动设备上使用Debian操作系统。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值