close
Showing posts with label qemu. Show all posts
Showing posts with label qemu. Show all posts

Sunday, February 22, 2015

[HOWTO] 5- Run RTEMS on QEMU

If you're a QEMU fan, and want to give it a try running RTEMS, then this post is for you. Make sure you've followed all of the previous instructions described here [1] [2] [3].

There are some RTEMS sim scripts you can use that do the magic of running simulators for you (but then you'll have to get sim-scripts repo and run it from there). I won't go through sim-scripts here, just do it manually as it's just one command! For more instructions you can peek into the or1ksim README file.

$ vim $HOME/development/rtems/src/rtems/c/src/lib/libbsp/or1k/or1ksim/README
BERJAYA
or1sim BSP README


Run

Let's run some interesting sample app called capture now that you can have some interactive fun with.
$ qemu-system-or32 -serial mon:stdio -serial /dev/null -net none -nographic -m 128M -kernel $HOME/development/rtems/build/or1k-rtems4.11/c/or1ksim/testsuites/samples/capture/capture.exe

BERJAYA
RTEMS or1ksim/capture.exe running on QEMU

You can try running other samples under sample directory.

References


Saturday, February 21, 2015

[HOWTO] 2- Build or1k simulator(s)

So, assuming you're coming from the previous post [HOWTO] 1- Build or1k-rtems* toolchain via RSB and have already installed the or1k toolchain for RTEMS, then you're ready to build RTEMS. But before that, you need OpenRISC simulator to run RTEMS on; this post illustrates how to get some simulator(s) built.

or1ksim

or1ksim the the main or1k simulator, and the one that can run Linux and RTEMS. For more details about or1ksin refer to its web-page [1]. Now, you're supposed to have RSB installed from the previous post [2], you can install the latest or1ksim development code from github as simple as typing just one RSB command (RSB FTW)!

1- Build
$ cd HOME/development/rtems/src/rtems-source-builder/bare/config
$ ../../source-builder/sb-set-builder --log=l-or1ksim.txt --prefix=$HOME/development/rtems/4.11 devel/or1ksim
RTEMS Source Builder - Set Builder, v0.5.0
Build Set: devel/or1ksim
config: devel/or1ksim-1.1.0.cfg
package: or1ksim-1.1.0-x86_64-linux-gnu-1
Creating source directory: sources
download: https://github.com/openrisc/or1ksim/archive/or1k-master.zip -> sources/or1k-master.zip
 redirect: https://codeload.github.com/openrisc/or1ksim/zip/or1k-master
downloading: sources/or1k-master.zip - 2.1MB     
warning: or1k-master.zip: no hash found
building: or1ksim-1.1.0-x86_64-linux-gnu-1
installing: or1ksim-1.1.0-x86_64-linux-gnu-1 -> /home/hesham/development/rtems/4.11
cleaning: or1ksim-1.1.0-x86_64-linux-gnu-1
Build Set: Time 0:00:42.205439

2- Check



Now you want to be sure that this "one command" fetch, build, install really works!

$ ls -alh $HOME/development/rtems/4.11/bin/ | grep sim*
-rwxr-xr-x 1 hesham disk 1.1M Feb 21 16:25 or1k-elf-sim 

QEMU

RTEMS can also work on QEMU, if you do not already have it, you can simply "RSB" it. It'll do full QEMU build for all the architectures supported (that's why it'll take a lot of time).

1- Build


$ cd HOME/development/rtems/src/rtems-source-builder/bare/config
$ ../../source-builder/sb-set-builder --log=l-qemu.txt --prefix=$HOME/development/rtems/4.11 devel/qemu
2- Check


BERJAYA


Now that you've more tools than you need, you can proceed to the next posts describing how to build and run RTEMS on one of the previously mentioned simulators.

References


[1] http://opencores.org/or1k/Or1ksim