Skip to content
/ rki Public
forked from alanc98/rki

Rtems Kernel Image , an example RTEMS application

License

Notifications You must be signed in to change notification settings

SayCV/rki

 
 

Repository files navigation

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

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

Each target can be configured and compiled separately.

How to Configure the RKI image

For the Raspberry Pi, enter the build-arm-rpi subdirectory. For the SPARC/sis simulator target, enter the build-sparc-sis directory.

Edit these lines in the Makefile
##
## paths for the RTEMS tools and RTEMS BSP
##
RTEMS_TOOL_BASE=/home/alan/Projects/rtems/4.11
RTEMS_BSP_BASE=/home/alan/Projects/rtems/4.11

In addition to the build environment, you can also 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

  • The paths in the makefile set to the tools and BSP

You should be able to just type

$ make

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    # build the image
$ ./run-sis.sh
(gdb) target sim
(gdb) load
(gdb) run

And the Raspberry Pi:

Raspberry Pi
$ make    # build the image
$ cp rki.bin 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.

About

Rtems Kernel Image , an example RTEMS application

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 100.0%