Skip to content

Latest commit

 

History

History
110 lines (78 loc) · 3.51 KB

readme.asciidoc

File metadata and controls

110 lines (78 loc) · 3.51 KB

Rtems Kernel Image Project (RKI)

This project provides a starting point or example of how to configure an RTEMS application for your project. There are many ways to configure an RTEMS application, this project is just something I have done to help me run on various targets. It is put together from different examples I have found, most of which have been contributed by RTEMS developers.

Note
I have tested this on the Raspberry Pi and the SPARC/sis simulator with RTEMS 4.11. I have not tested this project with RTEMS 4.10. I am not sure the RAM disk code will compile and run on RTEMS 4.10.

This project configuration provides:

  • RAM Disk setup

  • NVRAM Disk setup

  • Network setup ( if the target supports it )

  • Shell setup and shell startup script

  • Example shell commands including whetstone and dhrystone benchmarks

  • Common Makefile for a couple of targets ( ARM/Raspberry Pi and SPARC/sis simulator )

Each target can be configured and compiled separately.

You can configure many of the options in the RKI. Take a close look at the following files:

Config Files
  • rtems_config.h

  • rki_config.h

  • rtems_net_config.h

How to build

Make sure you have the following set up correctly
  • arm-rtems4.11 and/or sparc-rtems4.11 tools installed

  • arm/raspberrypi and or sparc/sis BSP compiled and installed

You then need to type, replacing the paths and ARCH/BSP appropriately

$ make ARCH=sparc-rtems4.11 BSP=sis RTEMS_TOOL_BASE=/home/cdesai/rtems/tools RTEMS_BSP_BASE=/home/cdesai/rtems/4.11

to build the executable.

How to run the RKI image

Here is how to run the rki program on the SPARC/sis simulator:

SPARC/sis
$ make ARCH=sparc-rtems4.11 BSP=sis RTEMS_TOOL_BASE=/home/cdesai/rtems/tools RTEMS_BSP_BASE=/home/cdesai/rtems/4.11    # build the image
$ sparc-rtems4.11-gdb legacy-build/sparc-rtems4.11-sis/rki.elf
(gdb) target sim
(gdb) load
(gdb) run

And the Raspberry Pi:

Raspberry Pi
$ make ARCH=arm-rtems4.11 BSP=raspberrypi RTEMS_TOOL_BASE=/home/cdesai/rtems/tools RTEMS_BSP_BASE=/home/cdesai/rtems/4.11    # build the image
$ cp legacy-build/arm-rtems4.11-raspberrypi/rki.bin legacy-build/arm-rtems4.11-raspberrypi/kernel.img

( Now copy the kernel.img to your Raspberry Pi SD card. Be sure to back up the old kernel.img! )

Commands to try

When you run the application on a target, you should get the shell prompt. Try some of these commands:

List all tasks
# task
List all semaphores
# sema
Run the Dhrystone benchmark
# dhrystone
Run the Whetstone benchmark
# whetstone
Create 5 tasks that run for 10 seconds
# taskdemo

There are quite a few more commands to run, just type

# help

You can also add your own commands, and include a startup script

Check out what the startup script is doing by typing:

# cat shell-init

In the case of the Raspberry Pi BSP, it formats a 64 Megabyte RAM disk with the RTEMS file system, then mounts the disk on /ram.