{"id":3912,"date":"2014-12-03T14:45:59","date_gmt":"2014-12-03T04:45:59","guid":{"rendered":"https:\/\/www.flamingspork.com\/blog\/?p=3912"},"modified":"2014-12-03T14:45:59","modified_gmt":"2014-12-03T04:45:59","slug":"running-skiboot-opal-on-the-power8-simulator","status":"publish","type":"post","link":"https:\/\/www.flamingspork.com\/blog\/2014\/12\/03\/running-skiboot-opal-on-the-power8-simulator\/","title":{"rendered":"Running skiboot (OPAL) on the POWER8 Simulator"},"content":{"rendered":"<p><a href=\"https:\/\/github.com\/open-power\/skiboot\">skiboot<\/a> is open source boot and runtime firmware for <a href=\"http:\/\/openpowerfoundation.org\/\">OpenPOWER<\/a>. On real POWER8 hardware, you will also need <a href=\"https:\/\/github.com\/open-power\/hostboot\">HostBoot<\/a> to do <a href=\"https:\/\/github.com\/open-power\/docs\/blob\/master\/hostboot\/HostBoot_PG.md\">this<\/a> (basically, to make the chip work) but in a functional simulator (such as <a href=\"http:\/\/www-304.ibm.com\/support\/customercare\/sas\/f\/pwrfs\/home.html\">this one released by IBM<\/a>) you don&#8217;t need a bunch of hardware procedures to make hardware work, so we can make do with just skiboot.<\/p>\n<p>The <a href=\"http:\/\/www-304.ibm.com\/support\/customercare\/sas\/f\/pwrfs\/home.html\">POWER8 Functional Simulator<\/a> is free to use but not open source and is only supported on limited platforms. But you can always run it all in a VM! I have it running this way on my laptop right now.<\/p>\n<p>To go from a bare Ubuntu 14.10 VM on x86_64 to running skiboot in the simulator, I did the following:<\/p>\n<ul>\n<li>apt-get install vim git emacs wget xterm <strong># xterm is needed by the simulator. wget and editors are useful things.<\/strong><\/li>\n<li>(download systemsim-p8&#8230;deb from above URL)<\/li>\n<li>dpkg -i systemsim-p8*deb <strong># now the simulator is installed<\/strong><\/li>\n<li>git clone https:\/\/github.com\/open-power\/skiboot.git <strong># get skiboot source<\/strong><\/li>\n<li>wget https:\/\/www.kernel.org\/pub\/tools\/crosstool\/files\/bin\/x86_64\/4.8.0\/x86_64-gcc-4.8.0-nolibc_powerpc64-linux.tar.xz <strong># get a compiler to build it with<\/strong><\/li>\n<li>apt-get install make gcc valgrind <strong># get build tools (skiboot unittests run on the host, so get a gcc and valgrind)<\/strong><\/li>\n<li>tar xfJ x86_64-gcc-4.8.0-nolibc_powerpc64-linux.tar.xz<\/li>\n<li>mkdir -p \/opt\/cross<\/li>\n<li>mv gcc-4.8.0-nolibc \/opt\/cross\/ <strong># now you have a powerpc64 cross compiler<\/strong><\/li>\n<li>export PATH=\/opt\/cross\/gcc-4.8.0-nolibc\/powerpc64-linux\/bin\/:$PATH <strong># add cross compiler to path<\/strong><\/li>\n<li>cd skiboot<\/li>\n<li>make <strong># this should build a bunch of things, leaving you with skiboot.lid (and other things). If you have many CPUs, feel free to make -j128.<\/strong><\/li>\n<li>make check <strong># run the unit tests. Everything should pass.<\/strong><\/li>\n<li>cd external\/mambo<\/li>\n<li>\/opt\/ibm\/systemsim-p8\/run\/pegasus\/power8 -f skiboot.tcl <strong># run the simulator<\/strong><\/li>\n<\/ul>\n<p>The last step there will barf as you unlikely have a \/tmp\/zImage.epapr sitting around that&#8217;s suitable. If you use op-build to build a full set of OpenPower foo, you&#8217;ll likely be able to extract it from there. Basically, the skiboot.tcl script is adding a payload for skiboot to execute. On real hardware, this ends up being a Linux kernel with a small userspace and <a href=\"http:\/\/www-01.ibm.com\/support\/knowledgecenter\/linuxonibm\/liabp\/liabppetitboot.htm\">petitboot <\/a>(link is to IBM documentation for IBM POWER8 systems). For the simulator, you could boot any tiny zImage.epapr you like, it should detect OPALv3 and boot!<\/p>\n<p>Even if you cannot be bothered building a kernel or petitboot environment, if you comment out the associated lines in skiboot.tcl, you should be able to run the simulator and see the skiboot console message come up that says we couldn&#8217;t load a kernel.<\/p>\n<p>At this point, congratulations, you can now become an OpenPower firmware hacker without even possessing any POWER8 hardware!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>skiboot is open source boot and runtime firmware for OpenPOWER. On real POWER8 hardware, you will also need HostBoot to do this (basically, to make the chip work) but in a functional simulator (such as this one released by IBM) &hellip; <a href=\"https:\/\/www.flamingspork.com\/blog\/2014\/12\/03\/running-skiboot-opal-on-the-power8-simulator\/\">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":[76,570,588,615],"tags":[636,568,617,584],"class_list":["post-3912","post","type-post","status-publish","format-standard","hentry","category-code","category-ibm-work-et-al","category-opal","category-powerpc","tag-opal","tag-power8","tag-simulator","tag-skiboot"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5a6n8-116","jetpack-related-posts":[{"id":3940,"url":"https:\/\/www.flamingspork.com\/blog\/2015\/02\/03\/building-openpower-firmware-for-use-in-power8-simulator\/","url_meta":{"origin":3912,"position":0},"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":3991,"url":"https:\/\/www.flamingspork.com\/blog\/2015\/08\/28\/running-opal-in-qemu-the-powernv-platform\/","url_meta":{"origin":3912,"position":1},"title":"Running OPAL in qemu &#8211; the powernv platform","author":"Stewart Smith","date":"2015-08-28","format":false,"excerpt":"Ben has a qemu tree up with some work-in-progress patches to qemu to support the PowerNV platform. This is the \"bare metal\" platform like you'd get on real POWER8 hardware running OPAL, and it allows us to use qemu like my previous post used the POWER8 Functional Simulator - to\u2026","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":3775,"url":"https:\/\/www.flamingspork.com\/blog\/2014\/07\/17\/openpower-firmware-up-on-github\/","url_meta":{"origin":3912,"position":2},"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":[]},{"id":3965,"url":"https:\/\/www.flamingspork.com\/blog\/2015\/06\/12\/gcov-code-coverage-for-openpower-firmware\/","url_meta":{"origin":3912,"position":3},"title":"gcov code coverage for OpenPower firmware","author":"Stewart Smith","date":"2015-06-12","format":false,"excerpt":"For skiboot (which provides the OPAL boot and runtime firmware for OpenPower machines), I've been pretty interested at getting some automated code coverage data for booting on real hardware (as well as in a simulator). Why? Well, it's useful to see that various test suites are actually testing what 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":4055,"url":"https:\/\/www.flamingspork.com\/blog\/2016\/05\/10\/first-power9-bits-merged-into-skiboot-master\/","url_meta":{"origin":3912,"position":4},"title":"First POWER9 bits merged into skiboot master","author":"Stewart Smith","date":"2016-05-10","format":false,"excerpt":"I just merged in some base POWER9 support patches into skiboot. While this is in no way near complete or really enough to be interesting to anyone that isn't heavily involved in POWER9 development, it's nice to take upstream first and open source first so seriously that this level of\u2026","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":3919,"url":"https:\/\/www.flamingspork.com\/blog\/2014\/12\/11\/skiboot-4-1\/","url_meta":{"origin":3912,"position":5},"title":"skiboot-4.1","author":"Stewart Smith","date":"2014-12-11","format":false,"excerpt":"I just posted this to the mailing list, but I've tagged skiboot-4.1, so we have another release! There's a good amount of changes since 4.0 nearly a month ago and this is the second release since we hit github back in July. For the full set of changes, \"git log\"\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\/3912","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=3912"}],"version-history":[{"count":1,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/3912\/revisions"}],"predecessor-version":[{"id":3913,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/3912\/revisions\/3913"}],"wp:attachment":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/media?parent=3912"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/categories?post=3912"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/tags?post=3912"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}