项目作者: siemens

项目描述 :
FreeRTOS for Jailhouse Cells
高级语言: C
项目地址: git://github.com/siemens/freertos-cell.git
创建时间: 2015-06-29T10:23:26Z
项目社区:https://github.com/siemens/freertos-cell

开源协议:Other

下载


FreeRTOS cell for the jailhouse hypervisor

FreeRTOS is a real time operation system
for embedded systems. It is widely used on ARM based microprocessor boards.
Jailhouse is a partitioning Hypervisor based on Linux.
For more information on both systems refer to the corresponding web pages.

This project aims at getting both systems run together on a multicore ARM processor system.
It allows to combine the general purpose OS Linux with a hard real time OS. Both systems are
almost isolated from each other by the underlying hypervisor.

Prerequisites

  • At the moment the system runs only on a Banana Pi board
  • Make sure Jailhouse is running correctly on this board. Installation instructions can
    be found here.
  • A working cross compiler toolchain for your target platform

Setup

First of all clone this repository

  1. FREERTOS_CELL_DIR=$HOME/freertos-cell
  2. git clone https://github.com/siemens/freertos-cell.git $FREERTOS_CELL_DIR

Jailhouse configuration

Let’s assume your Jailhouse sources reside in the directory

  1. JAILHOUSE_DIR=$HOME/jailhouse

then do the following to build new cell description files for the hypervisor

  1. Root cell description

    1. cp $FREERTOS_CELL_DIR/jailhouse-configs/bananapi.c $JAILHOUSE_DIR/configs/arm/
  2. RTOS cell description

    1. cp $FREERTOS_CELL_DIR/jailhouse-configs/bananapi-freertos-demo.c $JAILHOUSE_DIR/configs/arm/
  3. Rebuild your jailhouse subsystem. In the directory “$JAILHOUSE_DIR/configs/arm” you will get
    two new files which are used in the next step.

  4. Setup your jailhouse instances

This step has to be executed on the ARM target. You have to transfer the cell files to the target machine.

  1. jailhouse enable $JAILHOUSE_DIR/configs/arm/bananapi.cell
  2. jailhouse cell create $JAILHOUSE_DIR/configs/arm/bananapi-freertos-demo.cell

FreeRTOS code generation

Cross compiling

The build system assumes that your cross compiler prefix is “arm-linux-gnueabihf-“.
If this condition is true then you simply do

  1. cd $FREERTOS_CELL_DIR
  2. make

If your cross compiler prefix is something different then you can build the whole by invoking

  1. cd $FREERTOS_CELL_DIR
  2. make CROSS_COMPILE='xxx-yyy-zzz-'

Native compile step on the target

It is also possible to build the code directly on the target machine by doing the following

  1. cd $FREERTOS_CELL_DIR
  2. make CROSS_COMPILE=''

Startup of the application

Now you are ready to start your FreeRTOS demo under the hypervisor.
Once again this step has to be executed on the ARM target.

  1. jailhouse cell load FreeRTOS $FREERTOS_CELL_DIR/freertos-demo.bin
  2. jailhouse cell start FreeRTOS

After performing these 2 steps you should get some output from the FreeRTOS demo application
on the second serial interface (baudrate: 115200) of the Banana Pi board.

Moreover the green LED on the board should start to blink.

The first serial interface is used by the hypervisor and Linux.

Porting to other platforms

If you plan to get the whole system running on other hardware bases you have to take
into consideration the following items:

  • Modify the serial interface access
  • Your hardware needs a GIC (Generic Interrupt Controller) module
  • Of course you need a SoC with virtualization support
  • It must be possible to switch the CPUs online/offline