2. Who am I?
20+ years involved in embedded systems
10 years in real time OS, such as iTRON
10 years in embedded Java Virtual Machine
Now GCC, Linux, QEMU, Android, …
Blogs
http://d.hatena.ne.jp/embedded/ (Personal)
http://blog.kmckk.com/ (Corporate)
http://kobablog.wordpress.com/(English)
Twitter
@tetsu_koba
2
3. Today's topic
Google TV add-on
What is KVM?
Tweaking Google TV emulator
Why NDK doesn't work?
How to run it on Windows 7
3
4. Google TV add-on
Add-on for Android SDK to
develop Google TV apps.
http://code.google.com/tv/android/docs/gtv_addon.html
Existing Java apps can run on it,
but need modification for TV UI.
Display Guidelines, UI Control
Guidelines
4
5. From FAQ, Google TV version 2 is ...
Android 3.1.
NDK is not currently supported
Chrome 11 (OTA upgradeable)
Flash 10.1
Native client app support is not
currently available.
continue to support the h.264 video
codec for the HTML5 <video> tag. 5
6. Google TV emulator
Target CPU is x86 (ATOM)
KVM required
It means only Linux
Windows and Mac is currently
not supported
Open GL rendering by software
Not accelerated by GPU
6
7. What is KVM?
Kernel Based Virtual Machine
Host OS: x86 Linux, with Intel VT
or AMD-V
Guest CPU must be the same as
host CPU
used with QEMU
http://www.linux-kvm.org/page/Main_Page
7
8. How it works
Usual QEMU
emulates all instructions.
MMU is emulated by software,
too.
QEMU + KVM
mostly executed by real CPU.
hooks only I/O instructions.
8
9. Setup KVM
On Ubuntu
$ sudo apt-get install kvm
On Ubuntu 10.04
$ sudo chmod a+rw /dev/kvm
(On Ubuntu 11.04 it worked
without this)
See also
9
http://code.google.com/tv/android/docs/gtv_emulator.html
10. Comparison by boot up time
Ubuntu 10.04 KVM Off
52
Ubuntu 10.04 KVM On 32
Ubuntu 11.04 KVM Off
52
Ubuntu 11.04 KVM On
17
0 10 20 30 40 50 60
(Smaller is better)
KVM is tuning up. Newer version is faster! 10
11. Tweaking Google TV emulator
Why NDK doesn't work?
How to run it on Windows 7
11
12. NDK for x86
NDKr6 supports x86
You can build x86 emulator and
Android image from AOSP source
code
NDK for x86 works fine in this
environment
12
13. But it doesn't work in Google TV.
Why?
Google TV runtime is different
from Android.
Dynamic linker and libc is not
bionic's, it seems to be glibc's.
NDK r6 assumes bionic runtime.
13
16. How to run Google TV emulator
on Windows7
Yes, KVM is tightly coupled with
Linux.
But without KVM, does it work on
Windows or Mac?
16
17. Elements of Google TV emulator
(1) Emulator executable (using
QEMU + KVM)
(2) Image of target Linux kernel
(3) Images of target file system
(4) Skin image files
AVD files configure (1)-(4).
Only (1) depends on host OS. 17
18. Let's try
Android SDK for windows already
have emulator-x86.exe
Copy the reset files from Linux
$SDK/add-ons/addon_google_tv_google_inc_12
$HOMEPATH/.android/avd/<avd>.ini
$HOMEPATH/.android/avd/<avd>.avd
Correct file path in each *.ini files
18
19. Start Google TV emulator on
Windows
Start the emulator with the copied
avd from command prompt
emulator -avd <avd>
It worked!
But too slow to use!
I understand how emulator works!
19
20. Resources
Previous Google TV session by @kisima
http://d.hatena.ne.jp/machaut/20110213/1297613974
KVM session at 1st KernelVM 探検隊
http://www.slideshare.net/ozax86/linux-kvm
How to build emulator-x86
http://d.hatena.ne.jp/embedded/20110710/p1
How to build linux kernel for emulator-x86
http://blog.kmckk.com/archives/3882660.html
20
21. Demo / Q & A
Thank you for listening!
Any comments to blogs are welcome.
@tetsu_koba
21