V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
clowwindy
V2EX  ›  Linux

在模拟器里把Raspberry Pi的官方镜像跑起来了

  •  
  •   clowwindy · 2012-03-11 11:47:49 +08:00 · 4665 次点击
    这是一个创建于 4419 天前的主题,其中的信息可能已经有所发展或是发生改变。
    机器5月才能到,等的时间里就弄个模拟器玩玩吧



    Host是ubuntu 10.10 64bit

    模拟器是QEMU,直接编译的1.0版
    $ qemu-system-arm -version
    QEMU emulator version 1.0, Copyright (c) 2003-2008 Fabrice Bellard

    可以参照下面文章编译新版QEMU
    http://www.cnx-software.com/2011/10/18/raspberry-pi-emulator-in-ubuntu-with-qemu/

    内核的编译也是参照了上面这篇文章
    只需要编译内核,不需搞debian系统镜像
    menuconfig的时候要Y一下File System里的ext4

    去官网下载debian版镜像,解压
    http://www.raspberrypi.org/downloads

    假设内核文件是zImage,镜像是debian6-17-02-2012.img

    用这个命令可以启动:

    sudo qemu-system-arm -kernel zImage -M versatilepb -net none -cpu arm1176 -hda debian6-17-02-2012.img -m 256 -append "root=/dev/sda2"

    一开始没有加-net none,启动过程中dhclient的时候QEMU直接crash掉-_-||,于是加上了这个参数绕开这个bug

    用户名和密码是pi/suse
    sudo init 5 就能进入图形界面

    不过目前还没有网络,于是搜了一下,参照下面的文章弄了一个网桥,总算能上网了

    http://www.daemonforums.org/showthread.php?t=6645
    http://www.linuxquestions.org/questions/slackware-14/qemu-and-vde-help-744146/

    概括起来就是:

    sudo apt-get install uml-utilities
    sudo tunctl -t tap1 -u 用户名
    sudo chown root.users /dev/net/tun
    sudo chmod g+rw /dev/net/tun
    sudo brctl addbr br0
    sudo ifconfig eth0 0.0.0.0 promisc
    sudo brctl addif br0 eth0
    sudo dhclient br0
    sudo qemu-system-arm -kernel zImage -M versatilepb -net nic -net tap,ifname=tap1 -cpu arm1176 -hda debian6-17-02-2012.img -m 256 -append "root=/dev/sda2"

    然后apt-get install ttf-wqy-microhei什么的就不用说了
    最后打开V2EX :D

    8 条回复    1970-01-01 08:00:00 +08:00
    lxalex
        1
    lxalex  
       2012-03-11 12:53:10 +08:00
    @clowwindy,求教楼主是怎么买的RasPi
    clowwindy
        2
    clowwindy  
    OP
       2012-03-11 13:15:47 +08:00
    @lxalex
    我是在element 14上预订的,当天收到电话通知说因为货源紧张,5月份才能到货,问我还要不要预订,我说要,他就给我预留了一台
    lxalex
        3
    lxalex  
       2012-03-11 15:25:13 +08:00
    @clowwindy,没有在国外买过东西,不知道运费,关税是怎么计算的,大概会有多少,还是学生,预算有限。
    clowwindy
        4
    clowwindy  
    OP
       2012-03-11 16:04:20 +08:00
    @lxalex 300多,这个网站有国内的子网站
    iloveayu
        5
    iloveayu  
       2012-03-11 16:35:58 +08:00
    @lxalex @clowwindy 哈哈我也是在这里下单,收到邮件通知也预订了,当时价格是235 税是40 运费30 现在机器好像涨价了...
    lxalex
        6
    lxalex  
       2012-03-11 16:39:11 +08:00
    @clowwindy 了解了,谢谢
    lxalex
        7
    lxalex  
       2012-03-11 16:49:40 +08:00
    @iloveayu 现在要294+了
    fucker
        8
    fucker  
       2012-03-12 01:01:04 +08:00
    @lxalex 刚下了订单,也不知道什么时候才能到手。294.82
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1004 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 22:06 · PVG 06:06 · LAX 15:06 · JFK 18:06
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.