Bare-metal x86-64 image
This page spiecifies how to create a bare-metal ERIKA3 RTOS image for x86-64. The following image can be used for running on Qemu or with Xen/KVM hypervisor.
This tutorial explains how to setup RT_Druid environment to compile ERIKA3 RTOS application and how to create an ERIKA3 bare-metal image running a simple application.
Contents
Bare-metal compiler set-up
[todo]
RT-Druid set-up
In order to RT-Druid on the platform, download the RT-Druid package from the download section of the ERIKA3 website. Then, extract the downloaded archive. In the following part of the tutorial, we refer to directory containing the extracted RT-Druid archive as $RTDRUID_DIR
.
Launch the RT-Druid application as follows:
$ cd $RTDRUID_DIR $ ./eclipse
In order to enable the bare-metal compiler tool, set the Gnu compiler prefix
property. RT-Druid allows to set these variables also from within Eclipse. Just press the right mouse button on the Eclipse project and select Properties as shown in the following figure.
Then, select Generator properties, enable project specific settings (as shown in the next figure), and set the desired value for the X86_64 property named Gnu compiler prefix
.
Note that RT-Druid allows to set these variables for a single project by just pressing the right mouse button on the Eclipse project and selecting Properties).
Simple application
As ERIKA3 application we consider the simple "helloworld" application consisting of two tasks printing on the serial interface.
- Run the RT-Druid tool $ cd $RTDRUID_DIR $ ./eclipse
- Create a new project by clicking on
New
→RT-Druid v3 Oil and C/C++ Project
as shown in the next Figure: - Name the new project (e.g.,
mytest
) as shown in the next Figure: - Check the box for using an existing template and select
x86-64
→Helloworld OSEK demo
as shown in the next Figure: - Eclipse will then show the new project, and RT-Druid will generate the configuration files, as shown in the next Figure:
- Modify the configuration file
conf.oil
by settings the following parameters:- The parameter
PLATFORM
defines the supported platform (default value isJAILHOUSE
). In order to generate the bare-metal image set the parameter as follows:PLATFORM = BARE
. - The parameter
INT_CONTROLLER
defines the supported interrupt controller and the values areAPIC
orX2APIC
(default value isX2APIC
). APIC ("Advanced Programmable Interrupt Controller") is the updated Intel standard for the older PIC. It is used in multiprocessor systems and is an integral part of all recent Intel (and compatible) processors. Its variant, referred to as X2APIC, is the most recent generation of the Intel's programmable interrupt controller and has been introduced with the Nehalem microarchitecture in November 2008. - In case of X2APIC mode, the parameter
X2APIC_MODE
defines whether the X2APIC is operating in the TSC deadline mode or not. The parameter is under the </code>INT_CONTROLLER = X2APIC>/code> parameter and the values areTSC_DEADLINE
andNO_TSC_DEADLINE
(default value isTSC_DEADLINE
). - Click with the right mouse key on the project and select
Build project
as shown in the next Figure:
- The parameter
The resulting elf file, contained in $ECLISE_WORKSPACE/mytest/out
will be used to build the ERIKA3 bare-image as explained in the following section.
Build the ERIKA3-image
[todo]
Then, on the serial interface, you will see the two tasks printing alternatively on the serial interface, as shown in the next figure: