SlideShare a Scribd company logo
Linux Virtualization Goes
         Mobile

   Jim Huang ( 黃敬群 ) <jserv @ 0xlab.org>
                               Aug 15, 2009
                                  COSCUP
關於講者

宅色夫
宅色夫




                 自由軟體
                 ARM SoC
                   環保
                  Android


 搜尋結果洽好是本議程的提綱
昔有凱撒

我來,我見,我征服
I came, I saw, I conquered!
今有宅色夫

 我宅,我色,我舒服
I home, I suck, I comforted!
虛擬化兩大重點

我來,我見,我                 征服     Exec. Env. #1           Exec. Env. #2           Exec. Env. #3




I came, I saw, I conquered
                                                                                                    Main OS




                        舒服
                              Modified Guest OS      Modified Guest OS        Modified Guest OS



我宅,我色,我                       Virtual Hardware        Virtual Hardware         Virtual Hardware
                                                                                                  Para Modified
                                                                                                     Drivers
                                                  Virtual Machine Monitor


I home, I suck, I comforted                                      Hypervisor



                                                                  Hardware




             儘可能「征服」硬體 ( 充分使用系統資源 )
             軟體予以「舒服」 ( 提高使用比例與感受 )
Virtualization 技術很熱門,
但不是新玩意
Hypervisor: 早在 1967 年,即提出隔離
   Application 與 Hardware 的途徑
Virtualization 技術里程碑
                           1998                               2006
                                               2004
                 1972                                                                      2009
      1967                              2003                               2007
                                                      2005



                                                                                   2008

                         VMware              Trango            AMD-V
                          (x86)                               Virtual PC               Intel→ WindRiver
                VM/370 - 1st
             commercial product          Xen                 Open Kernel Labs
                                  VirtualLogix VLX                 OKL4
                                                                         Citrix→ Xen
                                              Intel VT-x, Intel VT-i
      CP-40                                                                 RedHat → KVM
 st
1 Full Virtualization                          NICTA L4 Microkernel +
                                               Qualcomm                     Sun → VirtualBox
   Hypervisor                                                               vmware→ Trango
                                                                            (VMware MVP)
Spam and virus      User tolerance for
                                 infected email
                                                     email downtime is
                                 account for over
                                 70% of all email    less than 30
                                 sent today          minutes


                            Security                Services



                                        Virtualization 技術的轉變:
                                        Embedded/Mobile


[2006] Toshiba W47T CDMA Phone

[2007] 3G phones from HTC, LG,                      Mobile
[2008] Samsung SPH-m800

[2008] Instinct™ and HTC Dream (G1) with Android

Source: Open Kernel Labs.

                  走入消費性
                  電子產品
那英《征服》
「就這樣被你征服 切斷了所有退路
 我的心情是堅固 我的決定是糊塗
 就這樣被你征服 喝下你藏好的毒
 我的劇情已落幕 我的愛恨已入土」
那英《征服》
「就這樣被你征服 切斷了所有退路
 我的心情是堅固 我的決定是糊塗
 就這樣被你征服 喝下你藏好的毒
 我的劇情已落幕 我的愛恨已入土」

 [ 佳句偶得 ]
切斷了所有退路 → Virtualization 的概念
喝下你藏好的毒 → Virtualization 的實做途徑
Virtual Machines
VM 允許在單一實體的機器上,運作多個
虛擬執行單元

App     App        App                  App        App
                                                         Xen
 Guest OS             Guest OS            Guest OS
  (Linux)             (NetBSD)            (Windows)
                                                         VMWare
      VM                 VM                   VM

      Virtual Machine Monitor (VMM) / Hypervisor
                                                         KVM

                      Hardware
                                                         QEMU
                                                         OKL4( 本議程探討對象 )


      切斷了所有退路 → Virtualization 的概念
      喝下你藏好的毒 → Virtualization 的實做途徑
• Hardware Virtualization                      • OS Virtualization
     VMM/Hypervisor Technology                     Virtualizes access to OS
     Virtualizes access to hardware                Single, standard OS kernel is
                                                     running per box
     Host OS and each guest has full OS –
      standard or special                           Connects natively to underlying
                                                     hardware
     VMware, Microsoft Virtual Server, XEN,
      Parallels                                     Virtuozzo, Sun Solaris Containers




         針對 Embedded/Mobile ,
        僅探討 Hardeware Virtualization



              切斷了所有退路 → Virtualization 的概念
              喝下你藏好的毒 → Virtualization 的實做途徑
A        A                    A        A        A        A     A




      OS              OS            OS                OS             OS



                           Virtualization Layer


                                Hardware


               What                                        Why

Abstraction                              提昇系統資源使用率
Partitioning                             提高安全性與平衡資源使用
Division/sharing                         縮短系統反應時間
Hypervisor                               God!
Full Virtualization




x86 硬體支援的多種保護模式
Paravirtualization
通用的作業系統中, user process 並非真的被隔離
1) 每個 process 對應到                                                              Address
                                                                              location in
   kernel memory ,而 kernel         Kernel mapping
                                                                               physical
                                                                               memory
   位址為所有 process 所共                                       Page Table
                                                      for kernel mapping
   享                               User mapping


2) 在 kernel mode                                               .
                                                               .
   中, kernel 可存取到任何                                            .
   page table ,當然包含                 Page Directory
                                                               .

   user process 的對應表
3) copy_from, copy_to                    page

                                                                           Address
                                                                           location
                                                                              in
                                         page                              physical
                                                        Page Table         memory
                                                     for user mapping


                                                           .
                             CR3
                                                           .
                                                           .
                                                           .
trapping kernel / user interactions
                          Trusted Process                                                               Kernel Space
                                                                           addr 2




               Linux Kernel       Interrupt Handler                   seal



                                                                                                      User Space
                                                                                                        of Process


                                                                                         data
                                unseal                                         addr 1
         Interposition                   TSC            Isolation
                                seal
                                            
    Hypervisor
                                                                                        Virtual Addr.




       Fast IPC 成為
    Embedded Hypervisor
        成敗的關鍵
等等,小小的手機跑什麼虛擬化?
Mobile/Consumer Electronics 生態改變
  隱藏的災難                 需要更彈性的設計




 大量引入客製化
                         難以預料的
 與 open source   產品設計
                          安全要求
     軟體




  component?             Executives?




                 Component 相互隔離
                 依據需求組合 Component
                 有彈性的組合與迴避複雜的授權爭議
LOVER = Linux Optimized for
                           Virtualization,
                       Embedded, and Realtime
                                 (OSDC.tw 2007)




OKLabs → OKL4 → L4 microkernel
WindRiver → Wind microkernel
TRANGO (now VMware MVP)
VirtualLogix VLX → Sun Microsystems Chorus
VMware MVP 讓你舒服!
               (video demo)




同時在Nokia N810 Tablet上執行WinCE與Android
Component 相互隔離
依據需求組合 Component
有彈性的組合與迴避複雜的授權爭議




         成本效益
         Time-to-Market
         (OKL4)
OKL4 introduces virtualization technology.
        OKL4 introduces virtualization technology.




 Qualcomm specific components:
 Qualcomm specific components:
OpenMAX, Qcamera, GPS, QCRIL
OpenMAX, Qcamera, GPS, QCRIL




                                                Android on
                                                Android on
                                            Qualcomm Platform
                                            Qualcomm Platform
                                                     (Source: QCT)
                                                      (Source: QCT)
Linux Virtualization Goes Mobile
Mobile/Consumer Electronics 生態改變
       隱藏的災難                     需要更彈性的設計




      大量引入客製化
                                    難以預料的
      與 open source    產品設計
                                     安全要求
          軟體




      component?                    Executives?




安全性
安全性
Mobile/Consumer Electronics 生態改變
         隱藏的災難                     需要更彈性的設計




        大量引入客製化
                                      難以預料的
        與 open source    產品設計
                                       安全要求
            軟體




        component?




複雜的授權
複雜的授權
Mobile/Consumer Electronics 生態改變
              隱藏的災難                     需要更彈性的設計




             大量引入客製化
                                            難以預料的
             與 open source    產品設計
                                             安全要求
                 軟體




             component?


                                               OKL4 on Openmoko demo
                                               OKL4 on Openmoko demo


                                      Smaller TCB
                                      Fault isolation
                                      Control access using caps
                                      Improves separation of trusted and
特製的 Driver
特製的 Driver                                    un-trusted subsystems
讓你舒服


   OKL4 特色:
   OKL4 特色:
  緊繃 (capability)
  緊繃 (capability)
 有彈性 (component)
 有彈性 (component)
 身手矯健 (Fast IPC)
 身手矯健 (Fast IPC)
 嬌小可愛 (10k LoC)      虛擬化
                     虛擬化
 嬌小可愛 (10k LoC)
 蘿莉 (10 years dev)
 蘿莉 (10 years dev)
免授權金 (BSD License)
免授權金 (BSD License)
隨時等你來開 .... 發
隨時等你來開 .... 發
OK:Linux
OK:Android
OK:Symbian
OK:Windows
Virtualization Goes Mobile
我來,我見,我征服                     切斷了所有退路 → Virtualization 的概念
                              喝下你藏好的毒 → Virtualization 的實做途徑
I came, I saw, I conquered

                               隱藏的災難                   需要更彈性的設計
我宅,我色,我舒服
I home, I suck, I comforted


                              大量引入客製化
                                                          難以預料的
                              與 open source   產品設計
                                                           安全要求
                                  軟體




                              component?                  Executives?
整體運算模式的轉變、多元的消費性電子產品設計需求
安全性要求、與 open source 軟體銜接、引入專屬技術
         與功能導向的運算
參考資料
• The Motorola Evoke QA4: A Case Study in Mobile Virtualization,
    Gernot Heiser, Open Kernel Labs, Inc.
• Embedded VMM for Portable Virtual Machines, Naveen Kalla,
    Patrice Guelah, and Scott R. Armstrong
• VMX Framework Performance and Power Management White
    Paper, VirtualMetrix, Inc.
• OKL4: http://en.wikipedia.org/wiki/OKL4
• OKLabs: http://www.ok-labs.com/
• L4HQ → L4 Community: http://l4hq.org/

More Related Content

PDF
軟體又熱又平又擠:淺談開放原始碼軟體衝擊下的新思維
PDF
開放原始碼作為新事業: 台灣本土經驗談 (COSCUP 2011)
PDF
Open Source from Legend, Business, to Ecosystem
PDF
Revise the Historical Development about C/UNIX
PDF
ARM and SoC Traning Part II - System
PDF
Develop Your Own Operating System
PDF
Ezilla
PDF
How A Compiler Works: GNU Toolchain
軟體又熱又平又擠:淺談開放原始碼軟體衝擊下的新思維
開放原始碼作為新事業: 台灣本土經驗談 (COSCUP 2011)
Open Source from Legend, Business, to Ecosystem
Revise the Historical Development about C/UNIX
ARM and SoC Traning Part II - System
Develop Your Own Operating System
Ezilla
How A Compiler Works: GNU Toolchain

What's hot (10)

PDF
Summer Project: Microkernel (2013)
PDF
Taiwanese Experience in IT
PDF
Symantec system recovery 2011產品技術訓練
PDF
Symantec System Recovery 2011_0320
PPTX
Unity台北場優化分享 II
PDF
Symantec Backup Exec 2012 產品介紹_0320
PPTX
Ssr2011 for 三心二益
PDF
Double take 6.0 實機體驗營
PDF
Tiny6410um hw-20101026
PDF
Symantec Backup Exec 2012 產品技術訓練
Summer Project: Microkernel (2013)
Taiwanese Experience in IT
Symantec system recovery 2011產品技術訓練
Symantec System Recovery 2011_0320
Unity台北場優化分享 II
Symantec Backup Exec 2012 產品介紹_0320
Ssr2011 for 三心二益
Double take 6.0 實機體驗營
Tiny6410um hw-20101026
Symantec Backup Exec 2012 產品技術訓練
Ad

Similar to Linux Virtualization Goes Mobile (20)

PDF
BAS010_虛擬化基礎_v190330
PPT
BAS010_虛擬化基礎_v190330 (View online)
PDF
BAS010_虛擬化基礎_v190325-Draft
PPT
WIN2003 - 介紹 V Mware, 並實地操作
DOC
X86平台三种不同的虚拟化之路
PPT
关于服务器虚拟化的测试汇报
PDF
从网格计算到云计算
PPTX
雲端運算期中分組報告
PPT
Hyper V Final
PDF
Leverage virtualization in software test
PPTX
Acronis iomega文件备份和虚拟机数据保护方案
PDF
系統程式 -- 第 9 章
PPTX
Windows Azure Virtual Machine Services for Developers
PDF
Cloud Computing for Bioinformatics
KEY
淺談雲端運算
PDF
Bob Liang Intro
DOC
VMware如何使用,最好用的虚拟机,VMware有哪些功能?关于虚拟机V...
PPTX
Hp桌面虚拟化解决方案
PDF
BAS011_VMware資料中心虛擬化-基礎_v190418
PPT
An overview of virtual machine architectures
BAS010_虛擬化基礎_v190330
BAS010_虛擬化基礎_v190330 (View online)
BAS010_虛擬化基礎_v190325-Draft
WIN2003 - 介紹 V Mware, 並實地操作
X86平台三种不同的虚拟化之路
关于服务器虚拟化的测试汇报
从网格计算到云计算
雲端運算期中分組報告
Hyper V Final
Leverage virtualization in software test
Acronis iomega文件备份和虚拟机数据保护方案
系統程式 -- 第 9 章
Windows Azure Virtual Machine Services for Developers
Cloud Computing for Bioinformatics
淺談雲端運算
Bob Liang Intro
VMware如何使用,最好用的虚拟机,VMware有哪些功能?关于虚拟机V...
Hp桌面虚拟化解决方案
BAS011_VMware資料中心虛擬化-基礎_v190418
An overview of virtual machine architectures
Ad

More from National Cheng Kung University (20)

PDF
PyPy's approach to construct domain-specific language runtime
PDF
Making Linux do Hard Real-time
PDF
2016 年春季嵌入式作業系統課程說明
PDF
Interpreter, Compiler, JIT from scratch
PDF
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明
PDF
Construct an Efficient and Secure Microkernel for IoT
PDF
The Internals of "Hello World" Program
PDF
Virtual Machine Constructions for Dummies
PDF
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明
PDF
從線上售票看作業系統設計議題
PDF
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明
PDF
Xvisor: embedded and lightweight hypervisor
PDF
Making Linux do Hard Real-time
PDF
Implement Runtime Environments for HSA using LLVM
PDF
Priority Inversion on Mars
PDF
Develop Your Own Operating Systems using Cheap ARM Boards
PDF
Lecture notice about Embedded Operating System Design and Implementation
PDF
Explore Android Internals
PDF
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學
PDF
F9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
PyPy's approach to construct domain-specific language runtime
Making Linux do Hard Real-time
2016 年春季嵌入式作業系統課程說明
Interpreter, Compiler, JIT from scratch
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明
Construct an Efficient and Secure Microkernel for IoT
The Internals of "Hello World" Program
Virtual Machine Constructions for Dummies
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明
從線上售票看作業系統設計議題
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明
Xvisor: embedded and lightweight hypervisor
Making Linux do Hard Real-time
Implement Runtime Environments for HSA using LLVM
Priority Inversion on Mars
Develop Your Own Operating Systems using Cheap ARM Boards
Lecture notice about Embedded Operating System Design and Implementation
Explore Android Internals
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學
F9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems

Linux Virtualization Goes Mobile

  • 1. Linux Virtualization Goes Mobile Jim Huang ( 黃敬群 ) <jserv @ 0xlab.org> Aug 15, 2009 COSCUP
  • 3. 宅色夫 自由軟體 ARM SoC 環保 Android 搜尋結果洽好是本議程的提綱
  • 6. 虛擬化兩大重點 我來,我見,我 征服 Exec. Env. #1 Exec. Env. #2 Exec. Env. #3 I came, I saw, I conquered Main OS 舒服 Modified Guest OS Modified Guest OS Modified Guest OS 我宅,我色,我 Virtual Hardware Virtual Hardware Virtual Hardware Para Modified Drivers Virtual Machine Monitor I home, I suck, I comforted Hypervisor Hardware 儘可能「征服」硬體 ( 充分使用系統資源 ) 軟體予以「舒服」 ( 提高使用比例與感受 )
  • 8. Hypervisor: 早在 1967 年,即提出隔離 Application 與 Hardware 的途徑
  • 9. Virtualization 技術里程碑 1998 2006 2004 1972 2009 1967 2003 2007 2005 2008 VMware Trango AMD-V (x86) Virtual PC Intel→ WindRiver VM/370 - 1st commercial product Xen Open Kernel Labs VirtualLogix VLX OKL4 Citrix→ Xen Intel VT-x, Intel VT-i CP-40 RedHat → KVM st 1 Full Virtualization NICTA L4 Microkernel + Qualcomm Sun → VirtualBox Hypervisor vmware→ Trango (VMware MVP)
  • 10. Spam and virus User tolerance for infected email email downtime is account for over 70% of all email less than 30 sent today minutes Security Services Virtualization 技術的轉變: Embedded/Mobile [2006] Toshiba W47T CDMA Phone [2007] 3G phones from HTC, LG, Mobile [2008] Samsung SPH-m800 [2008] Instinct™ and HTC Dream (G1) with Android Source: Open Kernel Labs. 走入消費性 電子產品
  • 12. 那英《征服》 「就這樣被你征服 切斷了所有退路 我的心情是堅固 我的決定是糊塗 就這樣被你征服 喝下你藏好的毒 我的劇情已落幕 我的愛恨已入土」 [ 佳句偶得 ] 切斷了所有退路 → Virtualization 的概念 喝下你藏好的毒 → Virtualization 的實做途徑
  • 13. Virtual Machines VM 允許在單一實體的機器上,運作多個 虛擬執行單元 App App App App App Xen Guest OS Guest OS Guest OS (Linux) (NetBSD) (Windows) VMWare VM VM VM Virtual Machine Monitor (VMM) / Hypervisor KVM Hardware QEMU OKL4( 本議程探討對象 ) 切斷了所有退路 → Virtualization 的概念 喝下你藏好的毒 → Virtualization 的實做途徑
  • 14. • Hardware Virtualization • OS Virtualization  VMM/Hypervisor Technology  Virtualizes access to OS  Virtualizes access to hardware  Single, standard OS kernel is running per box  Host OS and each guest has full OS – standard or special  Connects natively to underlying hardware  VMware, Microsoft Virtual Server, XEN, Parallels  Virtuozzo, Sun Solaris Containers 針對 Embedded/Mobile , 僅探討 Hardeware Virtualization 切斷了所有退路 → Virtualization 的概念 喝下你藏好的毒 → Virtualization 的實做途徑
  • 15. A A A A A A A OS OS OS OS OS Virtualization Layer Hardware What Why Abstraction 提昇系統資源使用率 Partitioning 提高安全性與平衡資源使用 Division/sharing 縮短系統反應時間 Hypervisor God!
  • 18. 通用的作業系統中, user process 並非真的被隔離 1) 每個 process 對應到 Address location in kernel memory ,而 kernel Kernel mapping physical memory 位址為所有 process 所共 Page Table for kernel mapping 享 User mapping 2) 在 kernel mode . . 中, kernel 可存取到任何 . page table ,當然包含 Page Directory . user process 的對應表 3) copy_from, copy_to page Address location in page physical Page Table memory for user mapping . CR3 . . .
  • 19. trapping kernel / user interactions Trusted Process Kernel Space addr 2   Linux Kernel Interrupt Handler seal   User Space of Process   data unseal addr 1 Interposition TSC Isolation  seal  Hypervisor Virtual Addr. Fast IPC 成為 Embedded Hypervisor 成敗的關鍵
  • 21. Mobile/Consumer Electronics 生態改變 隱藏的災難 需要更彈性的設計 大量引入客製化 難以預料的 與 open source 產品設計 安全要求 軟體 component? Executives? Component 相互隔離 依據需求組合 Component 有彈性的組合與迴避複雜的授權爭議
  • 22. LOVER = Linux Optimized for Virtualization, Embedded, and Realtime (OSDC.tw 2007) OKLabs → OKL4 → L4 microkernel WindRiver → Wind microkernel TRANGO (now VMware MVP) VirtualLogix VLX → Sun Microsystems Chorus
  • 23. VMware MVP 讓你舒服! (video demo) 同時在Nokia N810 Tablet上執行WinCE與Android
  • 25. OKL4 introduces virtualization technology. OKL4 introduces virtualization technology. Qualcomm specific components: Qualcomm specific components: OpenMAX, Qcamera, GPS, QCRIL OpenMAX, Qcamera, GPS, QCRIL Android on Android on Qualcomm Platform Qualcomm Platform (Source: QCT) (Source: QCT)
  • 27. Mobile/Consumer Electronics 生態改變 隱藏的災難 需要更彈性的設計 大量引入客製化 難以預料的 與 open source 產品設計 安全要求 軟體 component? Executives? 安全性 安全性
  • 28. Mobile/Consumer Electronics 生態改變 隱藏的災難 需要更彈性的設計 大量引入客製化 難以預料的 與 open source 產品設計 安全要求 軟體 component? 複雜的授權 複雜的授權
  • 29. Mobile/Consumer Electronics 生態改變 隱藏的災難 需要更彈性的設計 大量引入客製化 難以預料的 與 open source 產品設計 安全要求 軟體 component? OKL4 on Openmoko demo OKL4 on Openmoko demo Smaller TCB Fault isolation Control access using caps Improves separation of trusted and 特製的 Driver 特製的 Driver un-trusted subsystems
  • 30. 讓你舒服 OKL4 特色: OKL4 特色: 緊繃 (capability) 緊繃 (capability) 有彈性 (component) 有彈性 (component) 身手矯健 (Fast IPC) 身手矯健 (Fast IPC) 嬌小可愛 (10k LoC) 虛擬化 虛擬化 嬌小可愛 (10k LoC) 蘿莉 (10 years dev) 蘿莉 (10 years dev) 免授權金 (BSD License) 免授權金 (BSD License) 隨時等你來開 .... 發 隨時等你來開 .... 發
  • 32. Virtualization Goes Mobile 我來,我見,我征服 切斷了所有退路 → Virtualization 的概念 喝下你藏好的毒 → Virtualization 的實做途徑 I came, I saw, I conquered 隱藏的災難 需要更彈性的設計 我宅,我色,我舒服 I home, I suck, I comforted 大量引入客製化 難以預料的 與 open source 產品設計 安全要求 軟體 component? Executives? 整體運算模式的轉變、多元的消費性電子產品設計需求 安全性要求、與 open source 軟體銜接、引入專屬技術 與功能導向的運算
  • 33. 參考資料 • The Motorola Evoke QA4: A Case Study in Mobile Virtualization, Gernot Heiser, Open Kernel Labs, Inc. • Embedded VMM for Portable Virtual Machines, Naveen Kalla, Patrice Guelah, and Scott R. Armstrong • VMX Framework Performance and Power Management White Paper, VirtualMetrix, Inc. • OKL4: http://en.wikipedia.org/wiki/OKL4 • OKLabs: http://www.ok-labs.com/ • L4HQ → L4 Community: http://l4hq.org/