Mar 20, 2013

QEMUをMacOS X Mountain Lionにインストールしてみる。

先日、仕事でAndroidアプリの開発にちょっと触れたときにQEMUというCPUエミュレータの存在を知って興味を持ったので、自宅のMacで動かしてみようと思いました。

①ダウンロード

この辺りからダウンロードします。

http://wiki.qemu.org/Main_Page

今回はリリース版のqemu-1.4.0.tar.bz2というバージョンをダウンロードしました。

早速解凍します。

$ tar jxf qemu-1.4.0.tar.bz2

bz2とは珍しい。。。たまにしかみないので、tarコマンドの j オプションを忘れます。

②ビルドする

ビルドする前に、configureするのでオプションをみてみます。

$ cd qemu-1.4.0

$ ./configure —help

Usage: configure [options]

Options: [defaults in brackets after descriptions]

Standard options:

  —help                   print this message

  —prefix=PREFIX          install in PREFIX [/usr/local]

  —interp-prefix=PREFIX   where to find shared libraries, etc.

                           use %M for cpu name [/usr/gnemul/qemu-%M]

  —target-list=LIST       set target list (default: build everything)

                           Available targets: i386-softmmu x86_64-softmmu 

                           alpha-softmmu arm-softmmu cris-softmmu lm32-softmmu 

                           m68k-softmmu microblaze-softmmu microblazeel-softmmu 

                           mips-softmmu mipsel-softmmu mips64-softmmu 

                           mips64el-softmmu or32-softmmu ppc-softmmu 

                           ppcemb-softmmu ppc64-softmmu sh4-softmmu 

                           sh4eb-softmmu sparc-softmmu sparc64-softmmu 

                           s390x-softmmu xtensa-softmmu xtensaeb-softmmu 

                           unicore32-softmmu 

Advanced options (experts only):

  —source-path=PATH       path of source code [/tmp/qemu-1.4.0]

  —cross-prefix=PREFIX    use PREFIX for compile tools []

  —cc=CC                  use C compiler CC [cc]

  —host-cc=CC             use C compiler CC [cc] for code run at

                           build time

  —objcc=OBJCC            use Objective-C compiler OBJCC [clang]

  —extra-cflags=CFLAGS    append extra C compiler flags QEMU_CFLAGS

  —extra-ldflags=LDFLAGS  append extra linker flags LDFLAGS

  —make=MAKE              use specified make [make]

  —install=INSTALL        use specified install [install]

  —python=PYTHON          use specified python [python]

  —smbd=SMBD              use specified smbd [/usr/sbin/smbd]

  —static                 enable static build [no]

  —mandir=PATH            install man pages in PATH

  —datadir=PATH           install firmware in PATH/qemu

  —docdir=PATH            install documentation in PATH/qemu

  —bindir=PATH            install binaries in PATH

  —sysconfdir=PATH        install config in PATH/qemu

  —localstatedir=PATH     install local state in PATH

  —with-confsuffix=SUFFIX suffix for QEMU data inside datadir and sysconfdir [/qemu]

  —enable-debug-tcg       enable TCG debugging

  —disable-debug-tcg      disable TCG debugging (default)

  —enable-debug           enable common debug build options

  —enable-sparse          enable sparse checker

  —disable-sparse         disable sparse checker (default)

  —disable-strip          disable stripping binaries

  —disable-werror         disable compilation abort on warning

  —disable-sdl            disable SDL

  —enable-sdl             enable SDL

  —disable-virtfs         disable VirtFS

  —enable-virtfs          enable VirtFS

  —disable-vnc            disable VNC

  —enable-vnc             enable VNC

  —disable-cocoa          disable Cocoa (Mac OS X only)

  —enable-cocoa           enable Cocoa (default on Mac OS X)

  —audio-drv-list=LIST    set audio drivers list:

                           Available drivers: coreaudio sdl fmod

  —audio-card-list=LIST   set list of emulated audio cards [ac97 es1370 sb16 hda]

                           Available cards: ac97 es1370 sb16 cs4231a adlib gus hda

  —block-drv-whitelist=L  set block driver whitelist

                           (affects only QEMU, not qemu-img)

  —enable-mixemu          enable mixer emulation

  —disable-xen            disable xen backend driver support

  —enable-xen             enable xen backend driver support

  —disable-xen-pci-passthrough

  —enable-xen-pci-passthrough

  —disable-brlapi         disable BrlAPI

  —enable-brlapi          enable BrlAPI

  —disable-vnc-tls        disable TLS encryption for VNC server

  —enable-vnc-tls         enable TLS encryption for VNC server

  —disable-vnc-sasl       disable SASL encryption for VNC server

  —enable-vnc-sasl        enable SASL encryption for VNC server

  —disable-vnc-jpeg       disable JPEG lossy compression for VNC server

  —enable-vnc-jpeg        enable JPEG lossy compression for VNC server

  —disable-vnc-png        disable PNG compression for VNC server (default)

  —enable-vnc-png         enable PNG compression for VNC server

  —disable-vnc-ws         disable Websockets support for VNC server

  —enable-vnc-ws          enable Websockets support for VNC server

  —disable-curses         disable curses output

  —enable-curses          enable curses output

  —disable-curl           disable curl connectivity

  —enable-curl            enable curl connectivity

  —disable-fdt            disable fdt device tree

  —enable-fdt             enable fdt device tree

  —disable-bluez          disable bluez stack connectivity

  —enable-bluez           enable bluez stack connectivity

  —disable-slirp          disable SLIRP userspace network connectivity

  —disable-kvm            disable KVM acceleration support

  —enable-kvm             enable KVM acceleration support

  —enable-tcg-interpreter enable TCG with bytecode interpreter (TCI)

  —disable-nptl           disable usermode NPTL support

  —enable-nptl            enable usermode NPTL support

  —enable-system          enable all system emulation targets

  —disable-system         disable all system emulation targets

  —enable-user            enable supported user emulation targets

  —disable-user           disable all user emulation targets

  —enable-linux-user      enable all linux usermode emulation targets

  —disable-linux-user     disable all linux usermode emulation targets

  —enable-bsd-user        enable all BSD usermode emulation targets

  —disable-bsd-user       disable all BSD usermode emulation targets

  —enable-guest-base      enable GUEST_BASE support for usermode

                           emulation targets

  —disable-guest-base     disable GUEST_BASE support

  —enable-pie             build Position Independent Executables

  —disable-pie            do not build Position Independent Executables

  —fmod-lib               path to FMOD library

  —fmod-inc               path to FMOD includes

  —oss-lib                path to OSS library

  —enable-uname-release=R Return R for uname -r in usermode emulation

  —cpu=CPU                Build for host CPU [x86_64]

  —disable-uuid           disable uuid support

  —enable-uuid            enable uuid support

  —disable-vde            disable support for vde network

  —enable-vde             enable support for vde network

  —disable-linux-aio      disable Linux AIO support

  —enable-linux-aio       enable Linux AIO support

  —disable-cap-ng         disable libcap-ng support

  —enable-cap-ng          enable libcap-ng support

  —disable-attr           disables attr and xattr support

  —enable-attr            enable attr and xattr support

  —disable-blobs          disable installing provided firmware blobs

  —enable-docs            enable documentation build

  —disable-docs           disable documentation build

  —disable-vhost-net      disable vhost-net acceleration support

  —enable-vhost-net       enable vhost-net acceleration support

  —enable-trace-backend=B Set trace backend

                           Available backends: nop, dtrace, simple, stderr, ust

  —with-trace-file=NAME   Full PATH,NAME of file to store traces

                           Default:trace-<pid>

  —disable-spice          disable spice

  —enable-spice           enable spice

  —enable-rbd             enable building the rados block device (rbd)

  —disable-libiscsi       disable iscsi support

  —enable-libiscsi        enable iscsi support

  —disable-smartcard-nss  disable smartcard nss support

  —enable-smartcard-nss   enable smartcard nss support

  —disable-usb-redir      disable usb network redirection support

  —enable-usb-redir       enable usb network redirection support

  —disable-guest-agent    disable building of the QEMU Guest Agent

  —enable-guest-agent     enable building of the QEMU Guest Agent

  —disable-seccomp        disable seccomp support

  —enable-seccomp         enables seccomp support

  —with-coroutine=BACKEND coroutine backend. Supported options:

                           gthread, ucontext, sigaltstack, windows

  —enable-glusterfs       enable GlusterFS backend

  —disable-glusterfs      disable GlusterFS backend

  —enable-gcov            enable test coverage analysis with gcov

  —gcov=GCOV              use specified gcov [gcov]

NOTE: The object files are built at the place where configure is launched

なるほど、なんだかいっぱいオプションがありますね。

あとでじっくりみることにして、今はとりあえずデフォルトでいきます。

$ ./configure 

〜略〜

gcov              gcov

gcov enabled      no

特にエラーもなくうまくいったようです。

そのままmakeします。

$ make

〜略〜

(cd /tmp/qemu-1.4.0/pixman; autoreconf -v —install)

autoreconf: Entering directory `.’

autoreconf: configure.ac: not using Gettext

autoreconf: running: aclocal 

configure.ac:67: error: ‘AM_CONFIG_HEADER’: this macro is obsolete.

    You should use the ‘AC_CONFIG_HEADERS’ macro instead.

/usr/local/Cellar/automake/1.13.1/share/aclocal-1.13/obsolete-err.m4:14: AM_CONFIG_HEADER is expanded from…

configure.ac:67: the top level

autom4te: /usr/bin/m4 failed with exit status: 1

aclocal: error: echo failed with exit status: 1

autoreconf: aclocal failed with exit status: 1

make: *** [/tmp/qemu-1.4.0/pixman/configure] Error 1

エラーでこけました。

AM_CONFIG_HEADERじゃなくてAC_CONFIG_HEADERSを使うべきだと言っているようです。該当のソースを修正します。

$ vi pixman/configure.ac

67行目をコメントアウトして、こんな感じに直しました。

 67 # AM_CONFIG_HEADER(config.h)

 68 AC_CONFIG_HEADERS(config.h)  

再びmakeします。

$ make

〜略〜

  CC    unicore32-softmmu/target-unicore32/ucf64_helper.o

  CC    unicore32-softmmu/target-unicore32/softmmu.o

  LINK  unicore32-softmmu/qemu-system-unicore32

最後までうまくビルドできたようです。

③インストール

インストールします。

$ sudo make install

〜略〜

libtool: unknown option character `-’ in: —quiet

Usage: libtool -static [-] file […] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT]

Usage: libtool -dynamic [-] file […] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table <filename>] [-seg_addr_table_filename <file_system_path>] [-all_load] [-noall_load]

make: *** [install] Error 1

なんと、installでこけましたw

libtoolあたりに問題があるようです。

$ vi config-host.mak

78行目をコメントアウトしてこんな感じで修正しました。

 78 # LIBTOOL=libtool

 79 LIBTOOL=glibtool   

再びインストールします。

$ sudo make install

〜略〜

install -m 755 qemu-system-unicore32 “/usr/local/bin”

strip “/usr/local/bin/qemu-system-unicore32”

最後までインストールできたようです。

MacOS X Mountain Lion環境では、一部のファイルを修正する必要がありましたが、いちおうインストールできたようです。

これからちょっと触ってみようと思います。

Mar 6, 2013

SmartTriggerを買いました。

デジイチ用のリモコンです。

リモコン自体はボタンが二つだけという非常にシンプルな構成で、心もとない感じがします。

実はこれiPhoneからBluetoothで接続してiPhoneのアプリから操作ができます。

・リモート撮影

・ジャンプ撮影

・タイマー撮影

・タイムラプス

の4種類があります。

リモート撮影はホールド機能があったりするので連射も手放しで行えます。

タイマー撮影はいわゆるセルフタイマーですが、iPhone側で残り時間が見えたりするので便利です。

ジャンプ撮影はiPhoneの加速度センサーを使ってシャッターを切る機能です。

タイムラプス撮影もできます。デジイチでタイムラプス撮影したら4K動画にすることも夢じゃありません。

リモコン本体は単4電池1本(別売り)で動作します。

このSmartTriggerで一番惚れ込んだところは、リモコンとカメラを接続するためのケーブルが別になっているところです。

ほとんどのリモコンはリモコン本体にケーブルが内蔵されているため、自分の使用しているカメラにあわせてリモコンも買う必要がありました。

だけど、SmartTriggerはケーブルが別売りのためもしカメラ本体を別メーカーのカメラに買い替えたとしてもケーブル(1000円程度)を買うだけでリモコンが安心して使い回せます。

すばらしいです。

Feb 14, 2013

PhoneCleanというソフトでiPhoneの不要データが削除できるという記事をみたので試してみた。

スキャン結果、不要ファイルはみつかりませんでした。

ぼくのiPhoneはムダがなかったようです。

Feb 10, 2013
マメスキマー3の汚水タンクを実験器具のフラスコにしました。
コルク栓にチューブ用に5.5mmの穴と空気抜きの穴をあけて完成。

マメスキマー3は試験管ぽい形状なので見た目の相性も良い感じです。

マメスキマー3の汚水タンクを実験器具のフラスコにしました。

コルク栓にチューブ用に5.5mmの穴と空気抜きの穴をあけて完成。

マメスキマー3は試験管ぽい形状なので見た目の相性も良い感じです。

Feb 6, 2013

tumblrで Shift + R のショートカットで即時リブログができるようになったっていろいろなところでみたけど、実際のところできませんでした。

それでいろいろ調べてみると、 alt + リブログアイコン で即時リブログができるということがわかりました。

r だけだとリブログアイコンクリックと同じ動作をするので、試しに alt + r してみたら即時リブログができました。

ちょっと押しづらい。。。

Jan 27, 2013

Cookoo watchを数日使った感想

・普通の腕時計としては問題なし。

・スマートな機能はあまり期待しない方が良い。

・SMSの通知機能は未実装、iOSがAPIを公開しない限り実装の予定なし。

・Facebookのノーティフィケーションの通知はしてくれる。

・リマインダは通知されなかったり、かなり遅れて通知されたりすることがある。もちろん時間通りに通知されることもある。

・アプリの初回アップデートで音楽の再生や一時停止機能が追加されたけど、使い方がよくわからない。音楽再生中にCOMMANDボタンを押すと一時停止され、もう一度COMMANDボタンを押すと再生される。ただし、しばらく音楽再生してない状態でCOMMAND押しても再生されなくて、COMMANDボタンの短押しに設定した機能が働く。(音楽再生中は短押しに割り当てた機能が使えないということかな)

・バックライトがあるけど、文字盤の時刻の所が光らないので時間が読みづらい。(秒針、分針、時針と通知しか光らない)

・携帯電波が悪いところ、GPS電波が悪いところにいるとiPhoneのバッテリー消費が爆発的に加速する。そういう場所にいる間はiPhoneとのコネクションを切った方が良いです。

ざっとこんなところです。

なんだか散々に見えますが、ぼくの場合は普段使いのノーマル腕時計の買い替えとして購入したので、「腕時計として問題なし」なら全然OKです。価格もそのぐらいの金額では買えますし。

逆に、最近のスマートウォッチは機能を詰め込みすぎてバッテーリ消費が激しくて下手したら2日に1回充電しないといけないようなものまであるみたいで、「それって時計としてどうなの?」って思ったりするのでCookoo watchはぼくにとってちょうど良い感じです。

Cookoo watchは、まだ実際どの程度電池がもつかはわかりませんが、前にみた記事では1年となっていました。もちろん使い方次第だと思いますが。

Jan 27, 2013
天気がよかったのでビーチに行きました。
写真はゾウリイシというサンゴの骨です。

天気がよかったのでビーチに行きました。

写真はゾウリイシというサンゴの骨です。

Jan 23, 2013

cookoo watchが届きました。

箱は鳥の巣箱として再利用できるらしいです。

Jan 21, 2013
ちょっと鉄が溶かしたくなったのでググってみたら、Google先生が融点を即答してくれました。
いつのまにこんな機能が。

ちょっと鉄が溶かしたくなったのでググってみたら、Google先生が融点を即答してくれました。

いつのまにこんな機能が。

Jan 18, 2013

MacBook Air修理

去年購入したMacBook Airがいろいろと不調でした。

具体的には、不特定なあるタイミングで使用中のアプリケーションが異常終了するというもの。ただ、アプリケーションが異常終了するだけならよくあることなのですが、一度異常終了が起こったらアプリケーションを再起動してもすぐ異常終了を繰り返すようになり、最終的にはFinderなどのコアなソフトまで落ちてマウスカーソル以外の操作を受け付けなくなったりしました。

電源を長押しして強制終了してから再起動すると、またしばらくは安定します。しかし、使っていくと同じ現象が繰り返します。

ちょうどMacBook Air購入後すぐにMountain Lionが発売され、すぐにアップグレードしたので「Mountain Lion不安定すぎ」などと思っていました。

そして、なにかのきっかけでメモリの診断ソフトを使ってみると、メモリに故障の可能性。。。

Apple Hardware Test を実行すると、実行する前にエラーコードが発生して診断できず。。。

これは故障だ!ってことで、Appleのサポートへ連絡しました。

いままでの経緯を話すと、故障の可能性が考えられるので修理工場での診察を提案していただきました。

Appleの修理工場を使うか、Appleの正規プロバイダを使うかということになり、正規プロバイダについてきいてみるとうちの近所にあったので、正規プロバイダを利用することにしました。

ちょうど、その日は正規プロバイダの休業日だったため、メールフォームから修理の申し込みを行って返信を待ちました。

そして、2営業日後に連絡がきました。。。

1営業日目なら、ぼくがちょうど休日だったので持ち込みしようかと思っていましたが、早く修理にだすには仕事の関係上郵送するしかなくなります。郵送については片道分の送料はこちらが負担らしい。。。さらに、MacBook Airの修理なのにリカバリー用のDVDを添付してくださいとある。。。

その他、細かい点で個人的にいろいろ不信感を抱いたので、正規プロバイダはやめてAppleに修理をお願いすることにしました。

Appleに連絡すると、すぐにクロネコの荷物回収を手配してもらい、翌日には回収してもらいました。もちろん送料はApple持ちです。

送付するのはMacBook Air本体のみで、電源アダプタなどの添付も不要でした。さらに梱包も回収業者がやってくれるので、回収の人にMacBook Airを渡すだけでOKでした。

荷物回収から2日後の午前中に工場へ到着した旨のメールがあり、なんとその10時間後には修理が完了して発送したとの連絡がありました。

早い。

そんなこんなで、無事にAirがもどってきました。

修理内容はロジックボードの交換でした。

快適すぎます。PCの起動時間がだいぶ早くなりました。たぶん故障のせいでメモリ回りがおかしくなってて遅くなってたのかなぁ。

しかし、故障しててもなんとなく動き続けるタイプの故障ってやっかいだと思いました。

Navigate
« To the past Page 1 of 7
About