{"id":531,"date":"2020-03-23T07:30:00","date_gmt":"2020-03-23T12:30:00","guid":{"rendered":"https:\/\/jacobncalvert.com\/?p=531"},"modified":"2020-03-23T12:40:31","modified_gmt":"2020-03-23T17:40:31","slug":"virtualization-for-embedded-systems-series-type-2-hypervisors-deep-dive","status":"publish","type":"post","link":"https:\/\/jacobncalvert.com\/blog-archive\/2020\/03\/23\/virtualization-for-embedded-systems-series-type-2-hypervisors-deep-dive\/","title":{"rendered":"Virtualization for Embedded Systems Series: Type-2 Hypervisors Deep Dive"},"content":{"rendered":"\n<p class=\"has-drop-cap\">In the previous post in this series, we dove deep into container technology and looked at how to implement some functionality into containers applicable to embedded devices. In this post, we will look at type-2 hypervisors and dive deep into practical ways to use them for embedded systems. This post will be light on content as I am quite busy currently, but wanted to wrap up this series. I will try to circle back and dive deeper into this topic later. <\/p>\n\n\n\n<p><em><strong>Note: all the code, scripts, etc. are<\/strong><\/em><a href=\"https:\/\/github.com\/jacobcalvert\/virtualization-for-embedded-systems-series\"><em><strong> archived in a git repo at GitHub.<\/strong><\/em><\/a><\/p>\n\n\n\n<h2>Diving In<\/h2>\n\n\n\n<p>As a refresher <a href=\"https:\/\/jacobncalvert.com\/2019\/11\/04\/virtualization-for-embedded-systems-series-types-of-virtualization\/\">from the Types of Virtualization<\/a> post, type-2 hypervisors are virtualization systems in which a Host OS sits between the Guest OS and the hardware. Sometimes, especially when the Guest OSes instruction set differs from the Host OSes instruction set, this type of hypervisors are called emulators. In this context, this type of hypervisor is well-suited for embedded systems development and test. For this deep dive, I will be focusing on the emulation side of type-2 hypervisors. <em>(The other side of type-2 hypervisors are more like VirtualBox and are not particularly useful for embedded systems development).<\/em><\/p>\n\n\n\n<h2>QEMU as a Development Platform<\/h2>\n\n\n\n<p><a href=\"https:\/\/www.qemu.org\/\">QEMU is an open-source emulator<\/a> which has broad community support and contains libraries for emulating a large number of targets of many different instruction sets and peripherals. This makes it a particularly useful tool for developing code for a target for which you don&#8217;t have real hardware. <\/p>\n\n\n\n<h3>Setting up a QEMU Target<\/h3>\n\n\n\n<p>Luckily, QEMU has prebuilt packages for most platforms you can simply <a rel=\"noreferrer noopener\" aria-label=\"install using the package manager (opens in a new tab)\" href=\"https:\/\/www.qemu.org\/download\/\" target=\"_blank\">install using the package manager<\/a> of your choice. I&#8217;m going to be targeting the aarch64 (also referred to as arm64 in Linux land) architecture for emulating a virtual platform similar to the Raspberry Pi 3 (and newer). I have installed the package on my Linux Mint machine which provides <code>qemu-system-aarch64<\/code>. With this emulator available, I can invoke the emulator with the following command:<\/p>\n\n\n\n<p><code>qemu-system-aarch64 -m virt -M 1G -kernel kernel.elf<\/code><\/p>\n\n\n\n<p>This command will start up an ARMv8-A-based virtual machine, with 1GB of RAM, and load the code in kernel.elf.  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the previous post in this series, we dove deep into container technology and looked at how to implement some functionality into containers applicable to embedded devices. In this post, we will look at type-2 hypervisors and dive deep into practical ways to use them for embedded systems. This post will be light on content as I am quite busy currently, but wanted to wrap up this series. I will try to circle back and dive deeper into this topic&hellip;<\/p>\n","protected":false},"author":1,"featured_media":532,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[97,81,98],"tags":[94,105,117,96,95],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Virtualization for Embedded Systems Series: Type-2 Hypervisors Deep Dive - Jacob N Calvert<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jacobncalvert.com\/blog-archive\/2020\/03\/23\/virtualization-for-embedded-systems-series-type-2-hypervisors-deep-dive\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Virtualization for Embedded Systems Series: Type-2 Hypervisors Deep Dive - Jacob N Calvert\" \/>\n<meta property=\"og:description\" content=\"In the previous post in this series, we dove deep into container technology and looked at how to implement some functionality into containers applicable to embedded devices. In this post, we will look at type-2 hypervisors and dive deep into practical ways to use them for embedded systems. This post will be light on content as I am quite busy currently, but wanted to wrap up this series. I will try to circle back and dive deeper into this topic&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jacobncalvert.com\/blog-archive\/2020\/03\/23\/virtualization-for-embedded-systems-series-type-2-hypervisors-deep-dive\/\" \/>\n<meta property=\"og:site_name\" content=\"Jacob N Calvert\" \/>\n<meta property=\"article:published_time\" content=\"2020-03-23T12:30:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-03-23T17:40:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/jacobncalvert.com\/wp-content\/uploads\/2019\/11\/green-motherboard-163140.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"960\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/jacobncalvert.com\/blog-archive\/#website\",\"url\":\"https:\/\/jacobncalvert.com\/blog-archive\/\",\"name\":\"Jacob N Calvert\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/jacobncalvert.com\/blog-archive\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/jacobncalvert.com\/blog-archive\/2020\/03\/23\/virtualization-for-embedded-systems-series-type-2-hypervisors-deep-dive\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/jacobncalvert.com\/blog-archive\/wp-content\/uploads\/2019\/11\/green-motherboard-163140.jpg\",\"contentUrl\":\"https:\/\/jacobncalvert.com\/blog-archive\/wp-content\/uploads\/2019\/11\/green-motherboard-163140.jpg\",\"width\":1280,\"height\":960},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/jacobncalvert.com\/blog-archive\/2020\/03\/23\/virtualization-for-embedded-systems-series-type-2-hypervisors-deep-dive\/#webpage\",\"url\":\"https:\/\/jacobncalvert.com\/blog-archive\/2020\/03\/23\/virtualization-for-embedded-systems-series-type-2-hypervisors-deep-dive\/\",\"name\":\"Virtualization for Embedded Systems Series: Type-2 Hypervisors Deep Dive - Jacob N Calvert\",\"isPartOf\":{\"@id\":\"https:\/\/jacobncalvert.com\/blog-archive\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/jacobncalvert.com\/blog-archive\/2020\/03\/23\/virtualization-for-embedded-systems-series-type-2-hypervisors-deep-dive\/#primaryimage\"},\"datePublished\":\"2020-03-23T12:30:00+00:00\",\"dateModified\":\"2020-03-23T17:40:31+00:00\",\"author\":{\"@id\":\"https:\/\/jacobncalvert.com\/blog-archive\/#\/schema\/person\/f4b22a996d41bf09ed2bbe22912a8c8a\"},\"breadcrumb\":{\"@id\":\"https:\/\/jacobncalvert.com\/blog-archive\/2020\/03\/23\/virtualization-for-embedded-systems-series-type-2-hypervisors-deep-dive\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/jacobncalvert.com\/blog-archive\/2020\/03\/23\/virtualization-for-embedded-systems-series-type-2-hypervisors-deep-dive\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/jacobncalvert.com\/blog-archive\/2020\/03\/23\/virtualization-for-embedded-systems-series-type-2-hypervisors-deep-dive\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/jacobncalvert.com\/blog-archive\/\",\"url\":\"https:\/\/jacobncalvert.com\/blog-archive\/\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"position\":2,\"item\":{\"@id\":\"https:\/\/jacobncalvert.com\/blog-archive\/2020\/03\/23\/virtualization-for-embedded-systems-series-type-2-hypervisors-deep-dive\/#webpage\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/jacobncalvert.com\/blog-archive\/#\/schema\/person\/f4b22a996d41bf09ed2bbe22912a8c8a\",\"name\":\"Jacob\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/jacobncalvert.com\/blog-archive\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/64a2dd1c00cb39dfc19bb1204c87efbc?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/64a2dd1c00cb39dfc19bb1204c87efbc?s=96&d=mm&r=g\",\"caption\":\"Jacob\"},\"sameAs\":[\"https:\/\/jacobncalvert.com\"],\"url\":\"https:\/\/jacobncalvert.com\/blog-archive\/author\/jcalvert\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/jacobncalvert.com\/blog-archive\/wp-json\/wp\/v2\/posts\/531"}],"collection":[{"href":"https:\/\/jacobncalvert.com\/blog-archive\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jacobncalvert.com\/blog-archive\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jacobncalvert.com\/blog-archive\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jacobncalvert.com\/blog-archive\/wp-json\/wp\/v2\/comments?post=531"}],"version-history":[{"count":8,"href":"https:\/\/jacobncalvert.com\/blog-archive\/wp-json\/wp\/v2\/posts\/531\/revisions"}],"predecessor-version":[{"id":663,"href":"https:\/\/jacobncalvert.com\/blog-archive\/wp-json\/wp\/v2\/posts\/531\/revisions\/663"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/jacobncalvert.com\/blog-archive\/wp-json\/wp\/v2\/media\/532"}],"wp:attachment":[{"href":"https:\/\/jacobncalvert.com\/blog-archive\/wp-json\/wp\/v2\/media?parent=531"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jacobncalvert.com\/blog-archive\/wp-json\/wp\/v2\/categories?post=531"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jacobncalvert.com\/blog-archive\/wp-json\/wp\/v2\/tags?post=531"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}