Chinaunix首页 | 论坛 | 博客
  • 博客访问: 15357918
  • 博文数量: 2005
  • 博客积分: 11986
  • 博客等级: 上将
  • 技术积分: 22535
  • 用 户 组: 普通用户
  • 注册时间: 2007-05-17 13:56
文章分类

全部博文(2005)

文章存档

2014年(2)

2013年(2)

2012年(16)

2011年(66)

2010年(368)

2009年(743)

2008年(491)

2007年(317)

分类: 嵌入式

2009-08-05 17:04:48

如何使用qemu模拟器加载cpio独立生成的initramfs.img的2.6.30.4内核

  和如何使用qemu模拟器加载built-in进initramfs文件系统的2.6.30.4内核类似,
只是在编译内核时,不需要设置Initramfs source file文件位置,这样zImage将含有initramfs的驱动.
luther@gliethttp:/luther/works/linux-2.6.30.4$ make menuconfig
"General setup" ==>
  [*] Initial RAM filesystem and RAM disk (initramfs/initrd) support  
  () Initramfs source file(s)
然后使用cpio指令生成ramfs.img.gz
luther@gliethttp:/vobs/crosscomplie_tootls/busybox-1.14.3/_install$ find . | cpio -o -H newc | gzip > ../ramfs.img.gz

最后使用qemu虚拟器运行内核
luther@gliethttp:/luther/works/linux-2.6.30.4$ qemu -kernel arch/x86/boot/bzImage -initrd /vobs/crosscomplie_tootls/busybox-1.14.3/ramfs.img.gz /dev/null
Could not open '/dev/kqemu' - QEMU acceleration layer not activated: No such file or directory
qemu: loading initrd (0x11cd1b bytes) at 0x7ed3000  // 这是qemu加载initrd的地址
可以从log中看到
Unpacking initramfs...提示(见下图),之后就正常进入busybox的ash了[luther.gliethttp].

阅读(2413) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~