SlideShare uma empresa Scribd logo
1 de 31
Baixar para ler offline
Using QEMU
       for
Cross Development


  Tetsuyuki Kobayashi

     Kyoto Microcomputer Co., Ltd.   1
Let's use QEMU
                    to boost your project


               Real system : System emulator
                          =
                    Atoms : Bits

                            This is what I impress today.
                            Take advantage of 'bits'!


                                    Kyoto Microcomputer Co., Ltd.   2
”Being Digital” by Nicholas Negroponte
 http://archives.obs-us.com/obs/english/books/nn/ch01c01.htm
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)
   Twitter
       @tetsu_koba
                       Kyoto Microcomputer Co., Ltd.   3
Today's topic

   What is QEMU
   Atoms vs Bits
   QEMU is NOT good for …
   QEMU is GOOD for …
   Practices (from KMC blog)





           Kyoto Microcomputer Co., Ltd.   4
About QEMU

   http://wiki.qemu.org/
   QEMU is
    a generic and open source
    machine emulator
    and virtualizer.



                     Kyoto Microcomputer Co., Ltd.   5
QEMU is used …

   As virtualizer,
       KVM
       Xen
       VirtualBox
   Host CPU == Target CPU
       Today I don't focus on this.



                        Kyoto Microcomputer Co., Ltd.   6
QEMU is used …

   As a system emulator,
   Host CPU != Target CPU
   Many open source projects such as:
       Android
       Maemo
       Symbian
       ARM port of Open Solaris
        ...
                       Kyoto Microcomputer Co., Ltd.   7
QEMU has …

   Virtual disk.
   Many of virtual devices.
   Tiny Code Generator (TCG) to execute fast.
   Port redirector, Virtual network card.
   Bootloader to boot Linux kernel.
   gdbserver to connect gdb.
   ...

                     Kyoto Microcomputer Co., Ltd.   8
QEMU is *NOT* …

   Cycle accurate simulator (which is
    usually used for H/W development).
   So QEMU is not good for developing device
    driver which have to take account of accurate
    cycles.




                    Kyoto Microcomputer Co., Ltd.   9
License

   The whole QEMU is GPL.
   The QEMU virtual CPU core library (libqemu.a)
    is LGPL.
   TCG is BSD like license.
   Each virtual hardware has their own license.
       Check the source file.
   QEMU is a trademark of Fabrice Bellard.


                        Kyoto Microcomputer Co., Ltd.   10
Atoms vs Bits

   Developing embedded system require real
    system (= the physical board).
       Because the GOAL is there.



   System emulator is good complement for it.



   System emulator is 'bits', so free from any
    physical limitation.
   I mention QEMU for the system emulator.
                      Kyoto Microcomputer Co., Ltd.   11
How to get

   The physical board needs money to buy.
       Some special board can not buy because of dis-
        continue.



   QEMU does not need any money to get.




                       Kyoto Microcomputer Co., Ltd.     12
Footprint

   The physical board needs space to put.
       No space for a dozen of boards on your desk.



   QEMU does not need any desk space.
       (but disk space.)




                       Kyoto Microcomputer Co., Ltd.   13
Portability (in Physical)

   Bring the physical board and set it up is a work.
       The board might be crash in trouble.



   You are happy to bring QEMU in your USB key.
   Or you can transfer it via broad band network.




                       Kyoto Microcomputer Co., Ltd.   14
Duplication & Distribution

   The physical board can not be duplicate.



   You can duplicate your QEMU as many as you
    like and distribute them.
       You might ask for experts to take a look your
        problem on QEMU.




                        Kyoto Microcomputer Co., Ltd.   15
QEMU is *NOT* good for

   Performance evaluation.
   Especially SMP mode.
       SMP is simulated in single thread, not parallel.
       Deadly slow.
   Interesting session about QEMU multi core
       Japan Technical Jamboree24, Dec 2008
       CELF_JTJ24_qemu-multicore_English.pdf
       http://tree.celinuxforum.org/CelfPubWiki/JapanTechnicalJamboree24


                             Kyoto Microcomputer Co., Ltd.                  16
QEMU is *NOT* good for

   developing a device driver for a
    *NEW* device.
       Before, you need the accurate virtual device for the
        device.
       You have to develop a device driver with REAL
        device at first. Then you can develop virtual device
        with the device driver.




                        Kyoto Microcomputer Co., Ltd.          17
QEMU is *NOT* good for

   Compiling a huge mount of source
    code.
       Too slow for compiling.
       It takes more than one night to compile Linux
        kernel.




                        Kyoto Microcomputer Co., Ltd.   18
QEMU is GOOD for

   Learning.
       Even if you tweak too much to break, you lose
        nothing.
       Not only for beginners. Experts may examine the
        latest Linux kernel except for x86/x86_64, using
        QEMU.




                       Kyoto Microcomputer Co., Ltd.       19
QEMU is GOOD for

   Developing applications.
       without the real system.
       Android SDK is a perfect example.
   also good for designers to evaluate UI.




                        Kyoto Microcomputer Co., Ltd.   20
QEMU is GOOD for

   Testing.
       Fault injection by the virtual device.
       You can duplicate as many as you like and test
        them in parallel.
       Still need testing on real system.




                         Kyoto Microcomputer Co., Ltd.   21
Practice #1

       Following blog pages are written in Japanese. Try
        machine translation such as Google. It will work.
   Building QEMU from source archive
       QEMU requires zlib and SDL to build.
       http://blog.kmckk.com/archives/2223793.html
   Net-installing Debian on QEMU
       Don't use obsolete installer.
       http://blog.kmckk.com/archives/2233167.html

                       Kyoto Microcomputer Co., Ltd.        22
Practice #2

   Rebuilding kernel from Debian source package
       Get the source package and extract and patch it on
        ARM QEMU.
       Do compiling on PC Linux.
       QEMU system emulator is too slow to compile
        kernel.
       http://blog.kmckk.com/archives/2237994.html
Practice #3

   How to setup NFS server for QEMU
       Need ”insecure” option for NFS because QEMU
        redirect NFS port.
       http://blog.kmckk.com/archives/2257952.html




                       Kyoto Microcomputer Co., Ltd.   24
Practice #4

   Booting Debian in NFS root on ARM QEMU
       Booting from NFS root is good for early-stage
        developing.
                   You can read/write target file system any time.
                   You can boot kernel before implementing storage
                     device.
                   You don't have to care about size of storage.
       http://blog.kmckk.com/archives/2257962.html
Practice #5

   Build latest kernel in kernel.org and try SMP
    mode
       Finally the latest kernel successfully ran.
       versatile_defconfig remains old. It need updated.
       You can try another virtual board easily on QEMU.
       SMP implementation of QEMU is just simple and
        can not run fast.
       http://blog.kmckk.com/archives/2333826.html
Practice #6

   Try ARM Ubuntu using QEMU
       Ubuntu 9.04 is built for ARMv5TE.
       Ubuntu 9.10, ARMv6.
       Ubuntu 10.04, ARMv7 Thumb2.
       Debian, ARMv4T
       Rootstock script is nice and easy to build Ubuntu
        root file system.
       http://blog.kmckk.com/archives/2339128.html
Practice #7

   Using debugger with QEMU
       Dive into QEMU itself using gdb.
       Connect gdb to target machine of QEMU.
       Debug both the target and QEMU itself using 2
        gdbs.
       Another debugger for QEMU.
       http://blog.kmckk.com/archives/2363473.html
Other topics

   TCG and QEMU internals
       http://blog.kmckk.com/archives/2067157.html
       http://blog.kmckk.com/archives/2067178.html
       http://blog.kmckk.com/archives/2067210.html
   Using user mode emulation of QEMU + binfmt
    + chroot to self-build
       http://blog.kmckk.com/archives/2342452.html



                       Kyoto Microcomputer Co., Ltd.   29
Q&A

   & Demo




      Thank you for listening!
      Any comments to blogs are welcome.
                 Kyoto Microcomputer Co., Ltd.   30
One more thing ...




KMC PARTNER debugger for QEMU
Breaking at do_execve in linux kernel running on Android emulator.


                    Kyoto Microcomputer Co., Ltd.                    31

Mais conteúdo relacionado

Mais procurados

仮想化環境におけるパケットフォワーディング
仮想化環境におけるパケットフォワーディング仮想化環境におけるパケットフォワーディング
仮想化環境におけるパケットフォワーディング
Takuya ASADA
 

Mais procurados (20)

System Device Tree and Lopper: Concrete Examples - ELC NA 2022
System Device Tree and Lopper: Concrete Examples - ELC NA 2022System Device Tree and Lopper: Concrete Examples - ELC NA 2022
System Device Tree and Lopper: Concrete Examples - ELC NA 2022
 
Java 17直前!オレ流OpenJDK「の」開発環境(Open Source Conference 2021 Online/Kyoto 発表資料)
Java 17直前!オレ流OpenJDK「の」開発環境(Open Source Conference 2021 Online/Kyoto 発表資料)Java 17直前!オレ流OpenJDK「の」開発環境(Open Source Conference 2021 Online/Kyoto 発表資料)
Java 17直前!オレ流OpenJDK「の」開発環境(Open Source Conference 2021 Online/Kyoto 発表資料)
 
Browsing Linux Kernel Source
Browsing Linux Kernel SourceBrowsing Linux Kernel Source
Browsing Linux Kernel Source
 
HKG15-311: OP-TEE for Beginners and Porting Review
HKG15-311: OP-TEE for Beginners and Porting ReviewHKG15-311: OP-TEE for Beginners and Porting Review
HKG15-311: OP-TEE for Beginners and Porting Review
 
Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device drivers
 
Lcu14 107- op-tee on ar mv8
Lcu14 107- op-tee on ar mv8Lcu14 107- op-tee on ar mv8
Lcu14 107- op-tee on ar mv8
 
QEMU - Binary Translation
QEMU - Binary Translation QEMU - Binary Translation
QEMU - Binary Translation
 
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM SystemsXPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems
 
[KubeCon NA 2020] containerd: Rootless Containers 2020
[KubeCon NA 2020] containerd: Rootless Containers 2020[KubeCon NA 2020] containerd: Rootless Containers 2020
[KubeCon NA 2020] containerd: Rootless Containers 2020
 
Podman rootless containers
Podman rootless containersPodman rootless containers
Podman rootless containers
 
20分でわかるgVisor入門
20分でわかるgVisor入門20分でわかるgVisor入門
20分でわかるgVisor入門
 
大規模環境のOpenStack アップグレードの考え方と実施のコツ
大規模環境のOpenStackアップグレードの考え方と実施のコツ大規模環境のOpenStackアップグレードの考え方と実施のコツ
大規模環境のOpenStack アップグレードの考え方と実施のコツ
 
OPTEE on QEMU - Build Tutorial
OPTEE on QEMU - Build TutorialOPTEE on QEMU - Build Tutorial
OPTEE on QEMU - Build Tutorial
 
GPU仮想化最前線 - KVMGTとvirtio-gpu -
GPU仮想化最前線 - KVMGTとvirtio-gpu -GPU仮想化最前線 - KVMGTとvirtio-gpu -
GPU仮想化最前線 - KVMGTとvirtio-gpu -
 
Quickboot on i.MX6
Quickboot on i.MX6Quickboot on i.MX6
Quickboot on i.MX6
 
Embedded Linux on ARM
Embedded Linux on ARMEmbedded Linux on ARM
Embedded Linux on ARM
 
仮想化環境におけるパケットフォワーディング
仮想化環境におけるパケットフォワーディング仮想化環境におけるパケットフォワーディング
仮想化環境におけるパケットフォワーディング
 
Run Qt on Linux embedded systems using Yocto
Run Qt on Linux embedded systems using YoctoRun Qt on Linux embedded systems using Yocto
Run Qt on Linux embedded systems using Yocto
 
Bootloaders
BootloadersBootloaders
Bootloaders
 
GraalVMを3つの主機能から眺めてみよう(Oracle Groundbreakers APAC Virtual Tour 2020 講演資料)
GraalVMを3つの主機能から眺めてみよう(Oracle Groundbreakers APAC Virtual Tour 2020 講演資料)GraalVMを3つの主機能から眺めてみよう(Oracle Groundbreakers APAC Virtual Tour 2020 講演資料)
GraalVMを3つの主機能から眺めてみよう(Oracle Groundbreakers APAC Virtual Tour 2020 講演資料)
 

Destaque

ADB(Android Debug Bridge): How it works?
ADB(Android Debug Bridge): How it works?ADB(Android Debug Bridge): How it works?
ADB(Android Debug Bridge): How it works?
Tetsuyuki Kobayashi
 

Destaque (11)

From printk to QEMU: Xen/Linux Kernel debugging
From printk to QEMU: Xen/Linux Kernel debuggingFrom printk to QEMU: Xen/Linux Kernel debugging
From printk to QEMU: Xen/Linux Kernel debugging
 
Android ipm 20110409
Android ipm 20110409Android ipm 20110409
Android ipm 20110409
 
Tricky implementation of Go ARM soft float
Tricky implementation of Go ARM soft floatTricky implementation of Go ARM soft float
Tricky implementation of Go ARM soft float
 
Android On Ubuntu for developer
Android On Ubuntu for developerAndroid On Ubuntu for developer
Android On Ubuntu for developer
 
Logging system of Android
Logging system of AndroidLogging system of Android
Logging system of Android
 
Froyo DalvikVM JIT
Froyo DalvikVM JITFroyo DalvikVM JIT
Froyo DalvikVM JIT
 
Reusing your existing software on Android
Reusing your existing software on AndroidReusing your existing software on Android
Reusing your existing software on Android
 
Tips of Malloc & Free
Tips of Malloc & FreeTips of Malloc & Free
Tips of Malloc & Free
 
Logging system of Android
Logging system of AndroidLogging system of Android
Logging system of Android
 
Basic of virtual memory of Linux
Basic of virtual memory of LinuxBasic of virtual memory of Linux
Basic of virtual memory of Linux
 
ADB(Android Debug Bridge): How it works?
ADB(Android Debug Bridge): How it works?ADB(Android Debug Bridge): How it works?
ADB(Android Debug Bridge): How it works?
 

Semelhante a Using QEMU for cross development

Semelhante a Using QEMU for cross development (20)

Improving User Experience with Ubiquitous QuickBoot
 Improving User Experience with Ubiquitous QuickBoot Improving User Experience with Ubiquitous QuickBoot
Improving User Experience with Ubiquitous QuickBoot
 
Improving MeeGo boot-up time
Improving MeeGo boot-up timeImproving MeeGo boot-up time
Improving MeeGo boot-up time
 
The Andc Cluster
The Andc ClusterThe Andc Cluster
The Andc Cluster
 
SFO15-202: Towards Multi-Threaded Tiny Code Generator (TCG) in QEMU
SFO15-202: Towards Multi-Threaded Tiny Code Generator (TCG) in QEMUSFO15-202: Towards Multi-Threaded Tiny Code Generator (TCG) in QEMU
SFO15-202: Towards Multi-Threaded Tiny Code Generator (TCG) in QEMU
 
MIPS-X
MIPS-XMIPS-X
MIPS-X
 
”Bare-Metal Container" presented at HPCC2016
”Bare-Metal Container" presented at HPCC2016”Bare-Metal Container" presented at HPCC2016
”Bare-Metal Container" presented at HPCC2016
 
Status of AEM for Intel and AMD
Status of AEM for Intel and AMDStatus of AEM for Intel and AMD
Status of AEM for Intel and AMD
 
The Yocto Project
The Yocto ProjectThe Yocto Project
The Yocto Project
 
Getting started with LinuxBoot Firmware on AArch64 Server
Getting started with LinuxBoot Firmware on AArch64 Server Getting started with LinuxBoot Firmware on AArch64 Server
Getting started with LinuxBoot Firmware on AArch64 Server
 
Reducing boot time in embedded Linux
Reducing boot time in embedded LinuxReducing boot time in embedded Linux
Reducing boot time in embedded Linux
 
Tweaking Google TV emulator
Tweaking Google TV emulatorTweaking Google TV emulator
Tweaking Google TV emulator
 
Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101
 
Reducing the boot time of Linux devices
Reducing the boot time of Linux devicesReducing the boot time of Linux devices
Reducing the boot time of Linux devices
 
ChromePad - Chromium OS for ThinkPad
ChromePad - Chromium OS for ThinkPadChromePad - Chromium OS for ThinkPad
ChromePad - Chromium OS for ThinkPad
 
TI TechDays 2010: swiftBoot
TI TechDays 2010: swiftBootTI TechDays 2010: swiftBoot
TI TechDays 2010: swiftBoot
 
ChromePad - Chromium OS ThinkPad X220
ChromePad - Chromium OS ThinkPad X220ChromePad - Chromium OS ThinkPad X220
ChromePad - Chromium OS ThinkPad X220
 
Krenel Based Virtual Machine In Centos7
Krenel Based Virtual Machine In Centos7Krenel Based Virtual Machine In Centos7
Krenel Based Virtual Machine In Centos7
 
BeagleBone Black Booting Process
BeagleBone Black Booting ProcessBeagleBone Black Booting Process
BeagleBone Black Booting Process
 
Containerize your Blackbox tests
Containerize your Blackbox testsContainerize your Blackbox tests
Containerize your Blackbox tests
 
Custum GNU/Linux Kali distribution
Custum GNU/Linux Kali distribution Custum GNU/Linux Kali distribution
Custum GNU/Linux Kali distribution
 

Mais de Tetsuyuki Kobayashi

Simple and efficient way to get the last log using MMAP
Simple and efficient way to get the last log using MMAPSimple and efficient way to get the last log using MMAP
Simple and efficient way to get the last log using MMAP
Tetsuyuki Kobayashi
 

Mais de Tetsuyuki Kobayashi (18)

some topic of ffmpeg
some topic of ffmpeg some topic of ffmpeg
some topic of ffmpeg
 
New VIdeo CODEC AV1
New VIdeo CODEC AV1 New VIdeo CODEC AV1
New VIdeo CODEC AV1
 
Try new transport protocol SRT (ver. 2)
Try new transport protocol SRT  (ver. 2)Try new transport protocol SRT  (ver. 2)
Try new transport protocol SRT (ver. 2)
 
Try new transport protocol SRT
Try new transport protocol SRTTry new transport protocol SRT
Try new transport protocol SRT
 
Raspberry Pi Zero とカメラモジュールで作るライブ配信実験機
Raspberry Pi Zero とカメラモジュールで作るライブ配信実験機Raspberry Pi Zero とカメラモジュールで作るライブ配信実験機
Raspberry Pi Zero とカメラモジュールで作るライブ配信実験機
 
WebOS Open Source Edition を試してみた
WebOS Open Source Edition を試してみたWebOS Open Source Edition を試してみた
WebOS Open Source Edition を試してみた
 
Linuxのユーザーランドをinitから全てまるごとgolangで書く
Linuxのユーザーランドをinitから全てまるごとgolangで書くLinuxのユーザーランドをinitから全てまるごとgolangで書く
Linuxのユーザーランドをinitから全てまるごとgolangで書く
 
組み込みLinuxでのGolangのススメ(Go con版)
組み込みLinuxでのGolangのススメ(Go con版)組み込みLinuxでのGolangのススメ(Go con版)
組み込みLinuxでのGolangのススメ(Go con版)
 
組み込みLinuxでのGolangのススメ
組み込みLinuxでのGolangのススメ組み込みLinuxでのGolangのススメ
組み込みLinuxでのGolangのススメ
 
ARM 64bit has come!
ARM 64bit has come!ARM 64bit has come!
ARM 64bit has come!
 
Virtual memory 20070222-en
Virtual memory 20070222-enVirtual memory 20070222-en
Virtual memory 20070222-en
 
Simple and efficient way to get the last log using MMAP
Simple and efficient way to get the last log using MMAPSimple and efficient way to get the last log using MMAP
Simple and efficient way to get the last log using MMAP
 
Patch101
Patch101Patch101
Patch101
 
Inter-process communication of Android
Inter-process communication of AndroidInter-process communication of Android
Inter-process communication of Android
 
Android is NOT just 'Java on Linux'
Android is NOT just 'Java on Linux'Android is NOT just 'Java on Linux'
Android is NOT just 'Java on Linux'
 
Init of Android
Init of AndroidInit of Android
Init of Android
 
Let's play with Goldfish
Let's play with GoldfishLet's play with Goldfish
Let's play with Goldfish
 
Opensource Android
Opensource AndroidOpensource Android
Opensource Android
 

Último

Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
UK Journal
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
FIDO Alliance
 

Último (20)

Your enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jYour enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4j
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & Ireland
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream Processing
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The InsideCollecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 

Using QEMU for cross development

  • 1. Using QEMU for Cross Development Tetsuyuki Kobayashi Kyoto Microcomputer Co., Ltd. 1
  • 2. Let's use QEMU to boost your project Real system : System emulator = Atoms : Bits This is what I impress today. Take advantage of 'bits'! Kyoto Microcomputer Co., Ltd. 2 ”Being Digital” by Nicholas Negroponte http://archives.obs-us.com/obs/english/books/nn/ch01c01.htm
  • 3. 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)  Twitter  @tetsu_koba Kyoto Microcomputer Co., Ltd. 3
  • 4. Today's topic  What is QEMU  Atoms vs Bits  QEMU is NOT good for …  QEMU is GOOD for …  Practices (from KMC blog)  Kyoto Microcomputer Co., Ltd. 4
  • 5. About QEMU  http://wiki.qemu.org/  QEMU is a generic and open source machine emulator and virtualizer. Kyoto Microcomputer Co., Ltd. 5
  • 6. QEMU is used …  As virtualizer,  KVM  Xen  VirtualBox  Host CPU == Target CPU  Today I don't focus on this. Kyoto Microcomputer Co., Ltd. 6
  • 7. QEMU is used …  As a system emulator,  Host CPU != Target CPU  Many open source projects such as:  Android  Maemo  Symbian  ARM port of Open Solaris  ... Kyoto Microcomputer Co., Ltd. 7
  • 8. QEMU has …  Virtual disk.  Many of virtual devices.  Tiny Code Generator (TCG) to execute fast.  Port redirector, Virtual network card.  Bootloader to boot Linux kernel.  gdbserver to connect gdb.  ... Kyoto Microcomputer Co., Ltd. 8
  • 9. QEMU is *NOT* …  Cycle accurate simulator (which is usually used for H/W development).  So QEMU is not good for developing device driver which have to take account of accurate cycles. Kyoto Microcomputer Co., Ltd. 9
  • 10. License  The whole QEMU is GPL.  The QEMU virtual CPU core library (libqemu.a) is LGPL.  TCG is BSD like license.  Each virtual hardware has their own license.  Check the source file.  QEMU is a trademark of Fabrice Bellard. Kyoto Microcomputer Co., Ltd. 10
  • 11. Atoms vs Bits  Developing embedded system require real system (= the physical board).  Because the GOAL is there.   System emulator is good complement for it.   System emulator is 'bits', so free from any physical limitation.  I mention QEMU for the system emulator. Kyoto Microcomputer Co., Ltd. 11
  • 12. How to get  The physical board needs money to buy.  Some special board can not buy because of dis- continue.   QEMU does not need any money to get. Kyoto Microcomputer Co., Ltd. 12
  • 13. Footprint  The physical board needs space to put.  No space for a dozen of boards on your desk.   QEMU does not need any desk space.  (but disk space.) Kyoto Microcomputer Co., Ltd. 13
  • 14. Portability (in Physical)  Bring the physical board and set it up is a work.  The board might be crash in trouble.   You are happy to bring QEMU in your USB key.  Or you can transfer it via broad band network. Kyoto Microcomputer Co., Ltd. 14
  • 15. Duplication & Distribution  The physical board can not be duplicate.   You can duplicate your QEMU as many as you like and distribute them.  You might ask for experts to take a look your problem on QEMU. Kyoto Microcomputer Co., Ltd. 15
  • 16. QEMU is *NOT* good for  Performance evaluation.  Especially SMP mode.  SMP is simulated in single thread, not parallel.  Deadly slow.  Interesting session about QEMU multi core  Japan Technical Jamboree24, Dec 2008  CELF_JTJ24_qemu-multicore_English.pdf  http://tree.celinuxforum.org/CelfPubWiki/JapanTechnicalJamboree24 Kyoto Microcomputer Co., Ltd. 16
  • 17. QEMU is *NOT* good for  developing a device driver for a *NEW* device.  Before, you need the accurate virtual device for the device.  You have to develop a device driver with REAL device at first. Then you can develop virtual device with the device driver. Kyoto Microcomputer Co., Ltd. 17
  • 18. QEMU is *NOT* good for  Compiling a huge mount of source code.  Too slow for compiling.  It takes more than one night to compile Linux kernel. Kyoto Microcomputer Co., Ltd. 18
  • 19. QEMU is GOOD for  Learning.  Even if you tweak too much to break, you lose nothing.  Not only for beginners. Experts may examine the latest Linux kernel except for x86/x86_64, using QEMU. Kyoto Microcomputer Co., Ltd. 19
  • 20. QEMU is GOOD for  Developing applications.  without the real system.  Android SDK is a perfect example.  also good for designers to evaluate UI. Kyoto Microcomputer Co., Ltd. 20
  • 21. QEMU is GOOD for  Testing.  Fault injection by the virtual device.  You can duplicate as many as you like and test them in parallel.  Still need testing on real system. Kyoto Microcomputer Co., Ltd. 21
  • 22. Practice #1  Following blog pages are written in Japanese. Try machine translation such as Google. It will work.  Building QEMU from source archive  QEMU requires zlib and SDL to build.  http://blog.kmckk.com/archives/2223793.html  Net-installing Debian on QEMU  Don't use obsolete installer.  http://blog.kmckk.com/archives/2233167.html Kyoto Microcomputer Co., Ltd. 22
  • 23. Practice #2  Rebuilding kernel from Debian source package  Get the source package and extract and patch it on ARM QEMU.  Do compiling on PC Linux.  QEMU system emulator is too slow to compile kernel.  http://blog.kmckk.com/archives/2237994.html
  • 24. Practice #3  How to setup NFS server for QEMU  Need ”insecure” option for NFS because QEMU redirect NFS port.  http://blog.kmckk.com/archives/2257952.html Kyoto Microcomputer Co., Ltd. 24
  • 25. Practice #4  Booting Debian in NFS root on ARM QEMU  Booting from NFS root is good for early-stage developing.  You can read/write target file system any time.  You can boot kernel before implementing storage device.  You don't have to care about size of storage.  http://blog.kmckk.com/archives/2257962.html
  • 26. Practice #5  Build latest kernel in kernel.org and try SMP mode  Finally the latest kernel successfully ran.  versatile_defconfig remains old. It need updated.  You can try another virtual board easily on QEMU.  SMP implementation of QEMU is just simple and can not run fast.  http://blog.kmckk.com/archives/2333826.html
  • 27. Practice #6  Try ARM Ubuntu using QEMU  Ubuntu 9.04 is built for ARMv5TE.  Ubuntu 9.10, ARMv6.  Ubuntu 10.04, ARMv7 Thumb2.  Debian, ARMv4T  Rootstock script is nice and easy to build Ubuntu root file system.  http://blog.kmckk.com/archives/2339128.html
  • 28. Practice #7  Using debugger with QEMU  Dive into QEMU itself using gdb.  Connect gdb to target machine of QEMU.  Debug both the target and QEMU itself using 2 gdbs.  Another debugger for QEMU.  http://blog.kmckk.com/archives/2363473.html
  • 29. Other topics  TCG and QEMU internals  http://blog.kmckk.com/archives/2067157.html  http://blog.kmckk.com/archives/2067178.html  http://blog.kmckk.com/archives/2067210.html  Using user mode emulation of QEMU + binfmt + chroot to self-build  http://blog.kmckk.com/archives/2342452.html Kyoto Microcomputer Co., Ltd. 29
  • 30. Q&A  & Demo Thank you for listening! Any comments to blogs are welcome. Kyoto Microcomputer Co., Ltd. 30
  • 31. One more thing ... KMC PARTNER debugger for QEMU Breaking at do_execve in linux kernel running on Android emulator. Kyoto Microcomputer Co., Ltd. 31