qemu 交叉编译arm内核,制作文件系统及启动内核笔记
来源:互联网 发布:淘宝上zara是真的吗 编辑:程序博客网 时间:2024/04/19 05:20
Reference:
http://en.gentoo-wiki.com/wiki/QEmu
http://www.linuxeden.com/html/develop/20100820/104409.html
http://balau82.wordpress.com/2010/03/27/busybox-for-arm-on-qemu/
I use qmeu-system-arm to emulate versatilepb , so I need crosscompile tool for
arm.
========================================================
1,down load cross compile tool :gnueabi.
#wget http://www.codesourcery.com/sgpp/lite/arm/portal/package6490/public/arm-none-linux-gnueabi/arm-2010q1-202-arm-none-linux-gnueabi.bin
# chmod +x arm-2010q1-202-arm-none-linux-gnueabi.bin
# ./arm-2010q1-202-arm-none-linux-gnueabi.bin
then export your cross compile install path to PATH.such as adding the
following lines into /etc/profile
export PATH=/mnt/sdb1/eabi/code/bin:$PATH
last do:
source /etc/profile
========================================================
2, compile kernel
2.1 download kenenr org.
2.1 compile it.
#make ARCH=arm versatile_defconfig
#make ARCH=arm menuconfig
Select EABI support in Kernel Featurer
#make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- all
=========================================================================================================================================
3,use busybox to make filesystem.
3.1$ wget http://busybox.net/downloads/busybox-1.17.1.tar.bz2
3.2$ tar xjf busybox-1.17.1.tar.bz2
3.3$ cd busybox-1.17.1
3.4$ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- defconfig
3.5$ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- install
Then there will be a minimal root filesytem in busybox/_install which does not
include share library.
Since command ps and mount need /proc and /sys, so you should make proc and
sys work.
$cd busybox/_install
$mkdir proc sys dev etc etc/init.d
$vim etc/init.d/rcS
#!/bin/sh
mount -t proc none /proc
mount -t sysfs none /sys
/sbin/mdev -s
$ chmod +x _install/etc/init.d/rcS
We can now create a root filesystem image using the cpio tool, and in order to
compact the filesystem even more, we can run gzip on it to create a compressed
image:
$ cd busybox/_install
$ find . | cpio -o --format=newc > ../rootfs.img
$ cd ..
$ gzip -c rootfs.img > rootfs.img.gz
4, boot your virbutal machine.
$qemu-system-arm -M versatilepb -m 128M -kernel zImage -initrd rootfs.img.gz -append "root=/dev/ram rdinit=/sbin/init"
The cross compile tool and busybox I put them under tools.
NOTE:you should first compile your program in host machine , then add them
into the filesystem, redo the filesystem, then boot the machine,you can see
you program on virtual machine.
If you want use gdb to debug you program. see:
http://www.linuxeden.com/html/develop/20100820/104409.html
http://balau82.wordpress.com/2010/08/17/debugging-arm-programs-inside-qemu/#about
上面是我刚开始做的时候写的一些笔记。
我对文件系统做了细微的调整,主要是在dev下新建了几个节点。
#ls -l
crw-r--r-- 1 root root 5, 1 6月 8 09:53 console
brw-r--r-- 1 root root 31, 0 6月 8 09:53 mtdblock0
brw-r--r-- 1 root root 31, 1 6月 8 09:53 mtdblock1
brw-r--r-- 1 root root 31, 2 6月 8 09:53 mtdblock2
crw-r--r-- 1 root root 1, 3 6月 8 09:53 null
drwxr-xr-x 2 root root 4096 6月 9 09:10 pts
crw-r--r-- 1 root root 204, 64 6月 8 09:53 ttySAC0
然后在rcs里面改成以下设置;
#!/bin/sh
mount -t proc none /proc
mount -t sysfs none /sys
mount -t devpts none /dev/pts
/sbin/mdev -s
- qemu 交叉编译arm内核,制作文件系统及启动内核笔记
- 在qemu-system-arm模拟器启动initramfs根文件系统内核
- 嵌入式内核制作、根文件系统及内核启动流程
- 嵌入式内核制作、根文件系统及内核启动流程 .
- ARM内核及文件系统移植
- 编译内核及内核启动
- ARM交叉编译内核驱动的环境
- 交叉编译内核(ARM IXP455)
- 交叉编译Linux内核for ARM
- 交叉编译 Linux 内核 for ARM
- 交叉编译 Linux 内核 for ARM
- ubuntu 交叉编译arm linux 内核
- ARM Linux内核编译笔记
- ubuntu下使用qemu模拟ARM(三)------编译内核
- Qemu模拟运行ARM内核
- 交叉编译基于ARM架构的linux-3.6内核遇到的问题及解决方法
- 交叉编译内核及程序的心得.
- 制作initramfs根文件系统内核并用其启动最终文件系统
- cas filter 配置 之 web.xml
- CAD 删不掉的图层
- SQL优化之二
- Android面试基础
- 请使用ulld格式打印uint64_t的数据
- qemu 交叉编译arm内核,制作文件系统及启动内核笔记
- sizemode为zoom之后图片框中图片像素真实位置的确定
- 编程的无奈
- Java JDBC 理论笔记
- 在vs 2008中运行项目时报error PRJ0003 : 生成 cmd.exe 时出错”
- 优秀公司为什么会失败
- 警告"System.Configuration.ConfigurationSettings.AppSettings”已过时,解决办法
- windows中search driver的顺序
- 网络连接方式(DAS、SAN及NAS)