Welcome 微信登录

首页 / 操作系统 / Linux / Ubuntu 模拟ARM开发环境

为了简化开发和测试过程,Ubuntu从9.10开始提供静态的ARM虚拟功能,可以直接在PC机上建立ARM机器的chroot环境,既可以编译,也可以测试程序。相比于交叉编译而言,这种方法虽然编译速度较慢,但配置方便,还具备直接调试的功能。先安装Ubuntu提供的ARM虚拟程序:sudo apt-get install qemu-arm-static debootstrap接着,使用build-arm-chroot命令建立chroot系统:build-arm-chroot karmic eabi-chroot国内用户可以考虑使用srt.cn的镜像以加快速度:build-arm-chroot karmic eabi-chroot http://ubuntu.srt.cn/ubuntu-ports/建立chroot环境的脚本:#!/bin/bash
DROOT=eabi-chroot的完整路径
mount --bind /dev $DROOT/dev
mount --bind /proc $DROOT/proc
mount --bind /sys $DROOT/sys
mount --bind /dev/pts $DROOT/dev/pts
cp /etc/resolv.conf $DROOT/etc/resolv.conf
chroot $DROOTchroot成功后,就进入了模拟arm开发环境。 使用    uname -a可以观察到架构的变化。此后,新建或修改/etc/apt/sources.list, 在/etc/apt/sources.list中添加如下内容: deb http://ports.ubuntu.com/ lucid main restricted universe multiverse
deb-src http://ports.ubuntu.com/ lucid main restricted universe multiverse 然后在终端输入  apt-get update更新之后,就可以按需装软件、开发程序了。 在更新时出现如下错误信息:
E: Internal Error, Could not perform immediate configuration (2) on mountall。解决办法:
#mountall
# dpkg --force-all -i /var/cache/apt/archives/mount_2.XX.X-0ubuntu1_i386.deb
# apt-get -f install
# apt-get -V dist-upgrade 在终端输入:exit 退出模拟arm开发环境。然后按顺序卸载刚才挂载的目录。 建立退出chroot环境脚本: #!/bin/bash
#exit the ubuntu arm
#umount the directory of eabi-chrootDROOT=/eabi-chroot
umount -l $DROOT/dev/pts
umount -l $DROOT/sys
umount -l $DROOT/proc
umount -l $DROOT/devLinux文件系统启动流程笔记整理Source Insight建工程之Kernel相关资讯      Ubuntu教程 
  • Ubuntu教程 - 使用Ubuntu拷贝CD和  (12/18/2013 14:38:16)
  • 让Ubuntu 12.10支持RAR和7Z文件解  (11/15/2012 18:51:50)
  • Windows 7硬盘安装Ubuntu 12.10图  (11/03/2012 19:22:47)
  • 完美安装Ubuntu 12.10最新AMD显卡  (11/27/2012 08:17:47)
  • Win 7硬盘安装Ubuntu 12.10  (11/05/2012 13:30:34)
  • 虚拟机上Ubuntu 11.10升级到12.04  (10/12/2012 20:00:38)
本文评论 查看全部评论 (0)
表情: 姓名: 字数