搭建linux on qemu开发环境
2014-10-12 12:30
309 查看
0. 安装qemu | |
参考文档1- linux上安装qemu,并配置: | |
https://github.com/prife/documents/blob/master/qemu_mini2440_install.txt | |
参考文档2:配置linux上各项服务 | |
https://github.com/prife/documents/blob/master/ubuntu_mini2440.txt | |
1. 下载linux源码,生成linux内核 | |
prife@smart:~/projects/git$ git clone git://repo.or.cz/linux-2.6/mini2440.git mini2440-kernel | |
prife@smart:~/projects/git/mini2440-kernel$ make mini2440_defconfig ARCH=arm | |
prife@smart:~/projects/git/mini2440-kernel$ make -j4 ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- uImage | |
编译开始 17:09 | |
结束时间 17:12 | |
"mkimage" command not found - U-Boot images will not be built | |
Image arch/arm/boot/uImage is ready | |
mkimage位于 uboot/tools/目录下 | |
2. 启动linux内核 | |
创建如下启动脚本 | |
#!/bin/bash | |
export KK='/home/prife/projects/git/mini2440-kernel/arch/arm/boot/uImage' | |
/home/prife/projects/git/mini2440-qemu/arm-softmmu/qemu-system-arm \ | |
-M mini2440 -kernel $KK -mtdblock u-boot.nand -serial stdio \ | |
-net nic,vlan=0 -net tap,vlan=0,ifname=tap0 \ | |
-usb -usbdevice keyboard -usbdevice mouse | |
#-show-cursor | |
此时会就会引导进入uboot控制台,输入bootm,即可启动linux内核映像。 | |
不过此时我们还缺乏根文件系统。 | |
3. 配置根文件系统 | |
1) NFS做根文件系统 | |
下载rootfs软件包 | |
http://code.google.com/p/learningmini2440/downloads/detail?name=rootfs_qtopia_qt4-20100816.tar.gz&can=2&q= | |
解压之后。修改etc/init.d/rcS文件,将下面两行注释掉 | |
#/sbin/ifconfig lo 127.0.0.1 | |
#/etc/init.d/ifconfig-eth0 | |
启动uboot后,在控制台配置启动参数 | |
set bootargs noinitrd root=/dev/nfs rw nfsroot=121.49.118.29:/home/prife/rootfs ip=121.49.118.28:121.49.118.29::255.255.255.0 console=ttySAC0,115200 | |
然后执行 | |
saveenv保存参数 | |
之后每次启动都不用再次输入,只要在uboot中输入 | |
bootm | |
即可启动图形界面了。 | |
说明:启动之后可能会看到如下信息: | |
Warning: unable to open an initial console. | |
好吧,这说明rootfs还缺点东西。先把qemu关了 | |
在rootfs目录下,进入dev目录,手动创建如下节点: | |
$ sudo mknod -m 660 null c 1 3 | |
$ sudo mknod -m 660 console c 5 1 | |
然后重启qemu。就可以看到如下启动信息: | |
... | |
... | |
host=121.49.118.28, domain=, nis-domain=(none), | |
bootserver=121.49.118.29, rootserver=121.49.118.29, rootpath= | |
Looking up port of RPC 100003/2 on 121.49.118.29 | |
Looking up port of RPC 100005/1 on 121.49.118.29 | |
VFS: Mounted root (nfs filesystem) on device 0:13. | |
Freeing init memory: 128K | |
mount: mounting none on /proc/bus/usb failed: No such file or directory | |
[30/Sep/2012:22:55:43 +0000] boa: server version Boa/0.94.13 | |
[30/Sep/2012:22:55:43 +0000] boa: server built Jul 26 2010 at 15:58:29. | |
[30/Sep/2012:22:55:43 +0000] boa: starting server pid=759, port 80 | |
open device leds: No such file or directory | |
Please press Enter to activate this console. | |
[root@FriendlyARM /]# ls | |
_new. etc linuxrc opt sbin usr | |
bin home mnt proc sys var | |
dev lib netbsd.elf root tmp www | |
[root@FriendlyARM /]# | |
2) SD做根文件系统 | |
参考文献: | |
http://www.cnblogs.com/jinmu190/archive/2011/03/21/1990698.html | |
http://blog.csdn.net/star2523/article/details/7562210 |
相关文章推荐
- Python development on ubuntu linux (在ubuntu中搭建Python开发环境)
- 深入体验bash on windows!在windows上搭建原生的linux开发环境环境
- 用qemu搭建CentOS 6 for colinux虚拟系统——《Windows下搭建CentOS 6开发环境之一》
- 深入体验bash on windows,在windows上搭建原生的linux开发环境,酷!
- Setting up a EDK II build environment on Windows and Linux:搭建Windows和Linux开发环境[2.2]
- QEMU搭建Linux开发环境(1)
- Setting up a EDK II build environment on Windows and Linux:搭建Windows和Linux开发环境[2.2]
- bochs使用(linux下搭建操作系统开发环境)(zt)
- linux开发环境的快速搭建
- 搭建Ruby on Rails开发环境
- Step-by-Step搭建Linux下的java开发环境
- Linux下开发环境的搭建
- Windows下ruby on rails开发环境的搭建
- linux下php+mysql开发环境搭建笔记
- MicroWindows开发环境在PC Linux上的搭建
- 搭建Ruby on Rails开发环境(http://dev.yesky.com/327/2600827.shtml)
- 搭建基于Linux的Informix数据库开发环境
- Linux上搭建C/C++IDE开发环境
- Linux下开发环境的搭建
- 搭建Ruby on Rails开发环境