UBUNTU运行arm成程序(转帖)

来源:互联网 发布:淘宝淘口令怎么打开 编辑:程序博客网 时间:2024/04/20 01:42

Ubuntu的arm魔术

不久前编译了一个arm平台的busybox,很好奇如果在x86下运行arm的程序会怎么样呢,会有什么样的出错信息呢?于是直接在我的amd cpu上运行这个arm的busybox。神奇的事情出现了,这个arm的busybox居然运行了。

这是为什么呢?

大家安装一个qemu-arm-static包就明白了。安装了这个包就可以直接运行arm的程序。这个包在内核中注册binfmt支持,能够在x86平台上运行armel二进制文件。

static qemu-arm binary that enables to use arm chroots

The static version of teh qemu-arm binary registers automatically with
the binfmt-support setup in the kernel, enabling the execution of armel
binaries on x86 hosts. The package also includes a script to generate armel
chroots.

/.
/usr
/usr/bin
/usr/bin/qemu-arm-static
/usr/bin/build-arm-chroot
/usr/share
/usr/share/binfmts
/usr/share/binfmts/arm
/usr/share/doc
/usr/share/doc/qemu-arm-static
/usr/share/doc/qemu-arm-static/copyright
/usr/share/doc/qemu-arm-static/changelog.Debian.gz
/etc
/etc/sysctl.d
/etc/sysctl.d/qemu-arm-static.sysctl.conf

 

原创粉丝点击