{"id":225,"date":"2013-12-13T06:23:05","date_gmt":"2013-12-12T21:23:05","guid":{"rendered":"http:\/\/blog.ymyzk.com\/?p=225"},"modified":"2016-10-08T18:39:32","modified_gmt":"2016-10-08T09:39:32","slug":"raspberry-pi-qemu","status":"publish","type":"post","link":"https:\/\/blog.ymyzk.com\/2013\/12\/raspberry-pi-qemu\/","title":{"rendered":"Raspberry Pi \u3092 QEMU \u3067\u30a8\u30df\u30e5\u30ec\u30fc\u30c8\u3059\u308b\u65b9\u6cd5 (2015\u5e747\u6708\u66f4\u65b0)"},"content":{"rendered":"
Raspberry Pi \u3092 QEMU \u3067\u30a8\u30df\u30e5\u30ec\u30fc\u30c8\u3059\u308b\u65b9\u6cd5\u3067\u3059. \u3053\u308c\u306b\u3088\u308a\u5b9f\u6a5f\u3092\u7528\u3044\u305a\u306b\u30c6\u30b9\u30c8\u3092\u884c\u3046\u3053\u3068\u304c\u51fa\u6765\u307e\u3059. \u30c6\u30b9\u30c8\u306b\u7528\u3044\u305f\u30db\u30b9\u30c8OS\u306e\u74b0\u5883\u306f Debian 8 jessie amd64 \u3067\u3059. \u307e\u305f, \u4ee5\u4e0b\u306e\u74b0\u5883\u3067\u540c\u69d8\u306e\u624b\u9806\u3067\u52d5\u4f5c\u3067\u304d\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u3044\u307e\u3059.<\/p>\n QEMU \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304a\u304d\u307e\u3059. Debian \u306e\u5834\u5408\u306f apt \u3067, OS X \u306e\u5834\u5408\u306f Homebrew \u306a\u3069\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u307e\u3059.<\/p>\n \u4ee5\u4e0b\u3092\u5b9f\u884c\u3057\u3066\u5fc5\u8981\u306aCPU\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u308b\u304b\u30c1\u30a7\u30c3\u30af\u3057\u307e\u3059. arm1176 \u304c\u8868\u793a\u3055\u308c\u308c\u3070OK\u3067\u3059. \u65b0\u3057\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u306e QEMU \u3067\u306f\u660e\u793a\u7684\u306b machine \u3092\u6307\u5b9a\u3057\u3066, \u78ba\u8a8d\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059.<\/p>\n \u9069\u5f53\u306a\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3057, http:\/\/www.raspberrypi.org\/downloads<\/a> \u304b\u3089 Raspbian \u306e\u30a4\u30e1\u30fc\u30b8\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u5c55\u958b\u3057\u307e\u3059. \u4ee5\u4e0b\u3092\u5b9f\u884c\u3057\u3066, \u521d\u56de\u8d77\u52d5\u3092\u884c\u3044\u307e\u3059.<\/p>\n \/etc\/ld.so.preload \u3092\u7de8\u96c6\u3057\u307e\u3059. \u30a8\u30c7\u30a3\u30bf\u306b\u306f nano \u306e\u307b\u304b\u306b vi \u3082\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u308b\u306e\u3067\u597d\u307f\u306e\u3082\u306e\u3092\u5229\u7528\u3057\u3066\u304f\u3060\u3055\u3044.<\/p>\n \u4ee5\u4e0b\u306e\u3088\u3046\u306b, 1\u884c\u76ee\u3092\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3057\u3066\u4fdd\u5b58\u3057, \u30d5\u30a1\u30a4\u30eb\u3092\u9589\u3058\u307e\u3059.<\/p>\n QEMU \u306b\u3088\u308b\u30a8\u30df\u30e5\u30ec\u30fc\u30b7\u30e7\u30f3\u3067\u306f\u30c7\u30a3\u30b9\u30af\u3092 \/dev\/sda \u3068\u3057\u3066\u8a8d\u8b58\u3057\u307e\u3059\u304c, \u5b9f\u6a5f\u3067\u306f \/dev\/mmcblk0 \u3068\u3057\u3066\u8a8d\u8b58\u3055\u308c\u308b\u305f\u3081\u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u30ea\u30f3\u30af\u3092\u5f35\u308b\u8a2d\u5b9a\u3067\u3059. \u7d42\u4e86\u3057\u307e\u3059.<\/p>\n \u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u8d77\u52d5\u3057\u307e\u3059.<\/p>\n \u30e6\u30fc\u30b6\u30fc: pi, \u30d1\u30b9\u30ef\u30fc\u30c9: raspberry \u3067\u30ed\u30b0\u30a4\u30f3\u3057, X \u3092\u8d77\u52d5\u3059\u308b\u3053\u3068\u3082\u51fa\u6765\u307e\u3059.<\/a><\/p>\n QEMU \u8d77\u52d5\u6642\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u3064\u3044\u3066\u306e\u8aac\u660e\u3092\u307e\u3068\u3081\u3066\u304a\u304d\u307e\u3059.<\/p>\n \u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u30ab\u30fc\u30cd\u30eb\u30a4\u30e1\u30fc\u30b8 kernel-qemu \u3092\u5229\u7528\u3059\u308b.<\/p>\n ARM1176 CPU\u3092\u30a8\u30df\u30e5\u30ec\u30fc\u30c8\u3059\u308b. Raspberry Pi \u306f Broadcom BCM2835 \u3092\u642d\u8f09\u3057\u3066\u304a\u308a, \u3053\u308c\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30d7\u30ed\u30bb\u30c3\u30b5\u306f ARM1176JZ-F \u3068\u306a\u3063\u3066\u3044\u308b.<\/p>\n RAM\u306e\u5bb9\u91cf\u3092256MB\u306b\u3059\u308b. 256MB\u3088\u308a\u5927\u304d\u3044\u5024\u3092\u8a2d\u5b9a\u3059\u308b\u3068\u8d77\u52d5\u3057\u306a\u3044\u6a21\u69d8.<\/p>\n \u30a8\u30df\u30e5\u30ec\u30fc\u30c8\u3059\u308b\u30de\u30b7\u30f3\u306e\u7a2e\u985e\u3092\u8a2d\u5b9a\u3059\u308b. versatilepb \u306f ARM Versatile Platform Board<\/p>\n \u518d\u8d77\u52d5\u305b\u305a\u306b\u7d42\u4e86\u3059\u308b.<\/p>\n \u30b2\u30b9\u30c8\u306e\u4eee\u60f3\u30b7\u30ea\u30a2\u30eb\u30dd\u30fc\u30c8\u3092\u30db\u30b9\u30c8\u306e\u6a19\u6e96\u5165\u51fa\u529b\u306b\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3059\u308b.<\/p>\n \u30ab\u30fc\u30cd\u30eb\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3.<\/p>\n \u30cf\u30fc\u30c9\u30c7\u30a3\u30b9\u30af0\u3068\u3057\u3066, 2014-09-09-wheezy-raspbian.img \u3092\u7528\u3044\u308b.<\/p>\n \u305d\u306e\u307e\u307e\u306e\u30a4\u30e1\u30fc\u30b8\u3067\u306f\u30c7\u30a3\u30b9\u30af\u306e\u7a7a\u304d\u5bb9\u91cf\u304c\u5c11\u306a\u3044\u305f\u3081, \u5fc5\u8981\u306b\u5fdc\u3058\u3066\u30c7\u30a3\u30b9\u30af\u30a4\u30e1\u30fc\u30b8\u3092\u62e1\u5f35\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059. \u8a73\u3057\u304f\u306f Raspberry Pi \u306e\u30a4\u30e1\u30fc\u30b8\u30d5\u30a1\u30a4\u30eb\u3092\u62e1\u5f35\u3059\u308b<\/a> \u3092\u53c2\u8003\u306b\u3057\u3066\u304f\u3060\u3055\u3044.<\/p>\n \u52dd\u624b\u306b\u4e2d\u56fd\u8a9e\u8a33\u3055\u308c\u305f\u3082\u306e\u304c\u3053\u3061\u3089<\/a>\u306b\u3042\u308a\u307e\u3059. (Chinese version is available here<\/a>.)<\/p>\n Raspberry Pi \u3092 QEMU \u3067\u30a8\u30df\u30e5\u30ec\u30fc\u30c8\u3059\u308b\u65b9\u6cd5\u3067\u3059. \u3053\u308c\u306b\u3088\u308a\u5b9f\u6a5f\u3092\u7528\u3044\u305a\u306b\u30c6\u30b9\u30c8\u3092\u884c\u3046\u3053\u3068\u304c\u51fa\u6765\u307e\u3059.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[16,32,35,34],"_links":{"self":[{"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/posts\/225"}],"collection":[{"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/comments?post=225"}],"version-history":[{"count":33,"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/posts\/225\/revisions"}],"predecessor-version":[{"id":1531,"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/posts\/225\/revisions\/1531"}],"wp:attachment":[{"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/media?parent=225"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/categories?post=225"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/tags?post=225"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}
\n<\/a>
\n<\/p>\n\u74b0\u5883<\/h2>\n
\n\u30a8\u30df\u30e5\u30ec\u30fc\u30bf\u306f QEMU 2.1.0 \u3092\u4f7f\u7528\u3057, \u30b2\u30b9\u30c8OS\u306b\u306f, Raspberry Pi\u7528\u306b\u6700\u9069\u5316\u3055\u308c\u305f Debian \u306e Raspbian (2014-09-09) \u3092\u7528\u3044\u307e\u3059.<\/p>\n\n
QEMU \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n
\r\nsudo aptitude install qemu\r\n<\/pre>\n
\r\nbrew install qemu\r\n<\/pre>\n
\narm1176 \u304c\u8868\u793a\u3055\u308c\u306a\u3044\u5834\u5408\u306f, QEMU \u3092\u30d3\u30eb\u30c9\u3059\u308b\u304b, \u4ed6\u306e\u30d0\u30a4\u30ca\u30ea\u3092\u63a2\u3059\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059.<\/p>\n\r\nqemu-system-arm -cpu '?' | grep arm1176\r\n<\/pre>\n
\r\nqemu-system-arm -M versatilepb -cpu '?' | grep arm1176\r\n<\/pre>\n
\u30a4\u30e1\u30fc\u30b8\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/h2>\n
\n\u540c\u3058\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b http:\/\/xecdesign.com\/downloads\/linux-qemu\/kernel-qemu<\/a><\/del> https:\/\/www.dropbox.com\/s\/g8u93xblz1v1ly0\/kernel-qemu<\/a> \u307e\u305f\u306f https:\/\/github.com\/dhruvvyas90\/qemu-rpi-kernel<\/a> \u304b\u3089\u30ab\u30fc\u30cd\u30eb\u30a4\u30e1\u30fc\u30b8\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u307e\u3059.<\/p>\n\u521d\u56de\u8d77\u52d5<\/h2>\n
\r\nqemu-system-arm -kernel kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=\/dev\/sda2 panic=1 rootfstype=ext4 rw init=\/bin\/bash" -hda 2014-09-09-wheezy-raspbian.img\r\n<\/pre>\n
\r\nnano \/etc\/ld.so.preload\r\n<\/pre>\n
\r\n#\/usr\/lib\/arm-linux-gnueabihf\/libcofi_rpi.so\r\n<\/pre>\n
\u6b21\u306e\u624b\u9806\u306f\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3059.<\/del> \u3053\u306e\u4f5c\u696d\u3082\u6700\u8fd1\u306e Raspbian \u3067\u306f\u5fc5\u9808\u306b\u306a\u308a\u307e\u3057\u305f. \u8a2d\u5b9a\u3057\u306a\u3044\u5834\u5408\u6b21\u306e\u30b9\u30c6\u30c3\u30d7\u306e\u8d77\u52d5\u3067\u5931\u6557\u3057\u307e\u3059.<\/p>\n
\n\/etc\/udev\/rules.d\/90-qemu.rules \u3092\u4f5c\u6210\u3057\u3066\u4ee5\u4e0b\u3092\u8a18\u5165\u3057\u307e\u3059.<\/p>\n\r\nKERNEL=="sda", SYMLINK+="mmcblk0"\r\nKERNEL=="sda?", SYMLINK+="mmcblk0p%n"\r\nKERNEL=="sda2", SYMLINK+="root"\r\n<\/pre>\n
\r\nexit\r\n<\/pre>\n
\u8d77\u52d5<\/h2>\n
\r\nqemu-system-arm -kernel kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=\/dev\/sda2 panic=1 rootfstype=ext4 rw" -hda 2014-09-09-wheezy-raspbian.img\r\n<\/pre>\n
\u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u3064\u3044\u3066<\/h2>\n
-kernel kernel-qemu<\/h3>\n
-cpu arm1176<\/h3>\n
-m 256<\/h3>\n
-M versatilepb<\/h3>\n
-no-reboot<\/h3>\n
-serial stdio<\/h3>\n
-append “root=\/dev\/sda2 panic=1 rootfstype=ext4 rw”<\/h3>\n
-hda 2014-09-09-wheezy-raspbian.img<\/h3>\n
\u305d\u306e\u4ed6<\/h2>\n
\u53c2\u8003<\/h2>\n
\n
\u305d\u306e\u4ed6<\/h2>\n
\u66f4\u65b0\u5c65\u6b74<\/h2>\n
\n