{"id":3991,"date":"2015-08-28T12:42:14","date_gmt":"2015-08-28T02:42:14","guid":{"rendered":"https:\/\/www.flamingspork.com\/blog\/?p=3991"},"modified":"2015-08-28T12:42:14","modified_gmt":"2015-08-28T02:42:14","slug":"running-opal-in-qemu-the-powernv-platform","status":"publish","type":"post","link":"https:\/\/www.flamingspork.com\/blog\/2015\/08\/28\/running-opal-in-qemu-the-powernv-platform\/","title":{"rendered":"Running OPAL in qemu &#8211; the powernv platform"},"content":{"rendered":"<p>Ben <a href=\"https:\/\/github.com\/ozbenh\/qemu\">has a qemu tree<\/a> up with some work-in-progress patches to qemu to support the PowerNV platform. This is the &#8220;bare metal&#8221; platform like you&#8217;d get on real POWER8 hardware running OPAL, and it allows us to use qemu like my <a href=\"https:\/\/www.flamingspork.com\/blog\/2014\/12\/03\/running-skiboot-opal-on-the-power8-simulator\/\">previous post<\/a> used the POWER8 Functional Simulator &#8211; to boot OpenPower firmware.<\/p>\n<p>To build qemu for this, follow these steps:<\/p>\n<pre>apt-get -y install gcc python g++ pkg-config libz-dev libglib2.0-dev \\\r\n  libpixman-1-dev libfdt-dev git\r\ngit clone https:\/\/github.com\/ozbenh\/qemu.git\r\ncd qemu\r\n.\/configure --target-list=ppc64-softmmu\r\nmake -j `grep -c processor \/proc\/cpuinfo`\r\n<\/pre>\n<p>This will leave you with a ppc64-softmmu\/qemu-system-ppc64 binary. Once you&#8217;ve <a href=\"https:\/\/www.flamingspork.com\/blog\/2015\/02\/03\/building-openpower-firmware-for-use-in-power8-simulator\/\">built your OpenPower firmware to run in a simulator<\/a>, you can boot it!<\/p>\n<p>Note that this qemu branch is under development, and is likely to move\/change or even break.<\/p>\n<p>I do it like this:<\/p>\n<pre>cd ~\/op-build\/output\/images;  # so skiboot.lid is in pwd\r\n~\/qemu\/ppc64-softmmu\/qemu-system-ppc64 -m 1G -M powernv \\\r\n-kernel zImage.epapr -nographic \\\r\n-cdrom ~\/ubuntu-vivid-ppc64el-mini.iso<\/pre>\n<p>and this lets me test that we launch the Ubunut vivid installer correctly.<\/p>\n<p>You can easily add other qemu options such as additional disks or networking and verify that it works correctly. This way, you can do development on some skiboot functionality or a variety of kernel and op-build userspace (such as the petitboot bootloader) without needing either real hardware or using the simulator.<\/p>\n<p>This is useful if, say, you&#8217;re running on ppc64el, for which the POWER8 functional simulator is currently not available on.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ben has a qemu tree up with some work-in-progress patches to qemu to support the PowerNV platform. This is the &#8220;bare metal&#8221; platform like you&#8217;d get on real POWER8 hardware running OPAL, and it allows us to use qemu like &hellip; <a href=\"https:\/\/www.flamingspork.com\/blog\/2015\/08\/28\/running-opal-in-qemu-the-powernv-platform\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[570,588,615],"tags":[636,643,584],"class_list":["post-3991","post","type-post","status-publish","format-standard","hentry","category-ibm-work-et-al","category-opal","category-powerpc","tag-opal","tag-qemu","tag-skiboot"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5a6n8-12n","jetpack-related-posts":[{"id":4001,"url":"https:\/\/www.flamingspork.com\/blog\/2015\/10\/20\/tianocore-uefi-ported-to-openpower\/","url_meta":{"origin":3991,"position":0},"title":"TianoCore (UEFI) ported to OpenPower","author":"Stewart Smith","date":"2015-10-20","format":false,"excerpt":"Recently, there's been (actually two) ports of TianoCore (the reference implementation of UEFI firmware) to run on POWER on top of OPAL (provided by skiboot) - and it can be run in the Qemu PowerNV model. More details: http:\/\/firmwaresecurity.com\/2015\/10\/12\/tianocore-for-openpower\/ https:\/\/github.com\/andreiw\/ppc64le-edk2 https:\/\/github.com\/ozbenh\/edk2","rel":"","context":"In &quot;IBM&quot;","block_context":{"text":"IBM","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/ibm-work-et-al\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4231,"url":"https:\/\/www.flamingspork.com\/blog\/2016\/10\/30\/windows-nt4-for-powerpc-guest-on-opal-on-power8-in-qemu\/","url_meta":{"origin":3991,"position":1},"title":"Windows NT4 for PowerPC guest on OPAL on POWER8 in qemu","author":"Stewart Smith","date":"2016-10-30","format":false,"excerpt":"Sometimes, programming is just for fun. This is what PREPHV is for Andrei Warkentin. To quote the README: \"This is mostly a huge ugly hack, derived from my ppc64le_hello code. The running philosophy here is to throw things together late at night with my family asleep and see how far\u2026","rel":"","context":"In &quot;OPAL&quot;","block_context":{"text":"OPAL","link":"https:\/\/www.flamingspork.com\/blog\/category\/opal\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.flamingspork.com\/blog\/wp-content\/uploads\/2016\/10\/Screenshot-from-2016-10-30-18-17-35.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.flamingspork.com\/blog\/wp-content\/uploads\/2016\/10\/Screenshot-from-2016-10-30-18-17-35.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.flamingspork.com\/blog\/wp-content\/uploads\/2016\/10\/Screenshot-from-2016-10-30-18-17-35.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.flamingspork.com\/blog\/wp-content\/uploads\/2016\/10\/Screenshot-from-2016-10-30-18-17-35.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":491,"url":"https:\/\/www.flamingspork.com\/blog\/2005\/10\/19\/solaris-10-under-qemu\/","url_meta":{"origin":3991,"position":2},"title":"Solaris 10 under QEMU","author":"Stewart Smith","date":"2005-10-19","format":false,"excerpt":"I'm currently watching a Solaris 10 install under QEMU on my laptop. It seems to be taking a while, but getting there. (I got a Solaris 10 DVD in my AUUG shwag) Basically, I want to play with DTrace and see how easy it is to do things with it.\u2026","rel":"","context":"In &quot;cool gadgets&quot;","block_context":{"text":"cool gadgets","link":"https:\/\/www.flamingspork.com\/blog\/category\/cool-gadgets\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3940,"url":"https:\/\/www.flamingspork.com\/blog\/2015\/02\/03\/building-openpower-firmware-for-use-in-power8-simulator\/","url_meta":{"origin":3991,"position":3},"title":"Building OpenPower firmware for use in POWER8 Simulator","author":"Stewart Smith","date":"2015-02-03","format":false,"excerpt":"Previously, I blogged on how to Run skiboot (OPAL) on the POWER8 Simulator. If you want to build the full Open Power firmware environment, including the Petitboot bootloader and kernel, you can now do so! My pull request for an op-build target for the simulator has been merged, so you\u2026","rel":"","context":"In &quot;code&quot;","block_context":{"text":"code","link":"https:\/\/www.flamingspork.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4325,"url":"https:\/\/www.flamingspork.com\/blog\/2017\/11\/22\/installing-windows-on-a-usb-key\/","url_meta":{"origin":3991,"position":4},"title":"Installing Windows on a USB key","author":"Stewart Smith","date":"2017-11-22","format":false,"excerpt":"For some unknown reason, the Windows installer doesn't let you install to a USB key. Luckily, there's a simple workaround. It turns out that only the very first step of installation cares about that. So, if you can fool it (say, by running in qemu), you can have a USB\u2026","rel":"","context":"In &quot;General&quot;","block_context":{"text":"General","link":"https:\/\/www.flamingspork.com\/blog\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3775,"url":"https:\/\/www.flamingspork.com\/blog\/2014\/07\/17\/openpower-firmware-up-on-github\/","url_meta":{"origin":3991,"position":5},"title":"OpenPower firmware up on github!","author":"Stewart Smith","date":"2014-07-17","format":false,"excerpt":"With the whole OpenPower thing, a lot of low level firmware is being open sourced, which is really exciting for the platform - the less proprietary code sitting in memory the better in my books. If you go to https:\/\/github.com\/open-power you'll see code for a bunch of the low level\u2026","rel":"","context":"In &quot;code&quot;","block_context":{"text":"code","link":"https:\/\/www.flamingspork.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/3991","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/comments?post=3991"}],"version-history":[{"count":1,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/3991\/revisions"}],"predecessor-version":[{"id":3992,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/3991\/revisions\/3992"}],"wp:attachment":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/media?parent=3991"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/categories?post=3991"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/tags?post=3991"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}