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) you don’t need a bunch of hardware procedures to make hardware work, so we can make do with just skiboot.
The POWER8 Functional Simulator 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.
To go from a bare Ubuntu 14.10 VM on x86_64 to running skiboot in the simulator, I did the following:
- apt-get install vim git emacs wget xterm # xterm is needed by the simulator. wget and editors are useful things.
- (download systemsim-p8…deb from above URL)
- dpkg -i systemsim-p8*deb # now the simulator is installed
- git clone https://github.com/open-power/skiboot.git # get skiboot source
- 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 # get a compiler to build it with
- apt-get install make gcc valgrind # get build tools (skiboot unittests run on the host, so get a gcc and valgrind)
- tar xfJ x86_64-gcc-4.8.0-nolibc_powerpc64-linux.tar.xz
- mkdir -p /opt/cross
- mv gcc-4.8.0-nolibc /opt/cross/ # now you have a powerpc64 cross compiler
- export PATH=/opt/cross/gcc-4.8.0-nolibc/powerpc64-linux/bin/:$PATH # add cross compiler to path
- cd skiboot
- make # 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.
- make check # run the unit tests. Everything should pass.
- cd external/mambo
- /opt/ibm/systemsim-p8/run/pegasus/power8 -f skiboot.tcl # run the simulator
The last step there will barf as you unlikely have a /tmp/zImage.epapr sitting around that’s suitable. If you use op-build to build a full set of OpenPower foo, you’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 petitboot (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!
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’t load a kernel.
At this point, congratulations, you can now become an OpenPower firmware hacker without even possessing any POWER8 hardware!
For the cross compiler on 14.10, do “apt-get install gcc-powerpc-linux-gnu”
You can disable the xterm with “-n”.
The console output is interleaved with the mambo output on stdout, Ctrl-C breaks into the mambo shell and then “quit” exits.
Pingback: Building OpenPower firmware for use in POWER8 Simulator | Ramblings
Pingback: Running OPAL in qemu – the powernv platform | Ramblings