Changes between Initial Version and Version 1 of Projects/ARINC653UsingPOK


Ignore:
Timestamp:
08/18/14 05:05:30 (10 years ago)
Author:
Just Janek
Comment:

Created page with "The goal of this project is to make RTEMS arinc653 compliant using the arinc653 implementation in POK. This means this is part of the [http://www.rtems.org/wiki/index.php/GSOC..."

Legend:

Unmodified
Added
Removed
Modified
  • Projects/ARINC653UsingPOK

    v1 v1  
     1= ARINC653 on RTEMS (using POK) =
     2
     3
     4The goal of this project is to make RTEMS arinc653 compliant using the arinc653 implementation in POK. This means this is part of the [http://www.rtems.org/wiki/index.php/GSOC_2014_-_Paravirtualization_of_RTEMS RTEMS on POK] project.
     5
     6A lot of additional information can be found on [http://justjnk.blogspot.nl/ this blog.]
     7
     8Source code can be found on [https://github.com/JustJanek/GSOC_RTEMS_ARINC653 this github.]=  Status  =
     9
     10At the end of GSoC2014 every pok arinc653 function can be called from the rtems application but only a few return an error code for successfully run. When running the one of each arinc653 subset the following table can be made:
     11
     12{| class="wikitable" border="1"
     13|-
     14! Arinc653 subset
     15! Works?
     16|-
     17| Partition
     18| yes
     19|-
     20| Error
     21| yes
     22|-
     23| Process
     24| yes
     25|-
     26| Time
     27| yes
     28|-
     29| Blackboard
     30| no
     31|-
     32| Buffer
     33| no
     34|-
     35| Event
     36| no
     37|-
     38| Queueing
     39| no
     40|-
     41| Sampling
     42| no
     43|-
     44| Semaphore
     45| no
     46|}
     47
     48A lot of arinc653 subsets that require any form of inter-process or inter-partition communication currently returns an error and needs debugging for a fix.
     49=  Including pok arinc653 calls to rtems  =
     50
     51This chapter will explain how you could make available pok arinc653 functions to rtems applications.
     52=  A static library containing pok arinc653 calls  =
     53
     54To allow rtems to call pok arinc653 calls we make use of static libraries. As it was prior to starting this project the contents of the static library created by pok called 'libpart.a' was already added to 'libbsp.a' which in turn is added to the build directory. Since the object files of the arinc653 calls and the underlying calls are automatically added to 'libpart.a' we have to make sure 'libpart.a' will have the arinc653 calls added to them.
     55
     56According to the pok user manual (chapter 5) a set of configurations are necessary for arinc653. By default, if the Makefile located in $POK/examples/rtems-guest has an addition '--arinc653' argument added to the BUILD variable it will include the arinc653 partition, arinc653 time and arinc653 process calls to 'libpart.a'. This is because the '--arinc653' argument adds the proper configuration macros to the deployment.h header file. If additional arinc653 calls are to be added make sure to add appropriate macros to deployment.h within the partition folder of your project (e.g. $POK/examples/rtems-guest/generated-code/cpu/part1/deployment.h) and then use 'make all' on the makefile located in the generated-code folder. To make sure your calls are added use the 'nm' command on 'libpart.a'.
     57=  Adding header files for pok arinc653 to rtems  =
     58
     59
     60As all header files assume the inclusion stucture to be "INCLUDE_DIR/arinc653/*.h" this structure is kept in place for the arinc653 header files by configuration in Makefile.am. This makefile also makes sure that erroneous inclusion within the arinc653 header files are fixed (namely one in arinc653/types.h). It is assumed that the environment variable POK_PATH is set to the path of your pok folder. If all the arinc653 headers are included you can use the calls like calling functions from any other library. An example:
     61
     62{{{
     63#define POK_NEEDS_ARINC653_PARTITION 1
     64#define POK_NEEDS_ARINC653_PROCESS 1
     65
     66#include <bsp.h>
     67#include <stdio.h>
     68#include <stdlib.h>
     69#include <arinc653/types.h>
     70#include <arinc653/partition.h>
     71
     72rtems_task Init(rtems_task_argument argument);
     73
     74rtems_task Init(rtems_task_argument ignored)
     75{
     76    PARTITION_STATUS_TYPE partition_status;
     77    RETURN_CODE_TYPE ret;
     78    GET_PARTITION_STATUS(&partition_status, &ret);
     79    printf("ret after get partition:%d\n", ret);
     80    printf("OPERATING_MODE_TYPE:%d\n", partition_status.OPERATING_MODE);
     81    exit( 0 );
     82}
     83}}}
     84=  More POK calls  =
     85
     86If there are functions from pok that are required to be called and are not in 'libpart.a' (e.g. they are added to 'libpok.a') you can use the same method to add the contents of 'libpok.a' to 'libbsp.a'. However, it should be noted that this might cause duplicates between object files in 'libpok.a' and in 'libpart.a' as they both might contain some of the same object files.
     87=  How to build  =
     88
     89
     90This guide will go through the steps that are necessary to get arinc653 calls
     91from POK working on an RTEMS partition and to be able to run an example project
     92that goes through at least one arinc653 call of each arinc653 subset (buffer,
     93blackboard, partition, time, etc.).
     94
     95'''Note: Make sure your environment can at least run the default "hello world" for
     96RTEMS on POK (i.e. the patches for virtualpok are applied to your RTEMS
     97directory).'''
     98
     991. Apply the patches that can be retrieved from
     100https://github.com/JustJanek/GSOC_RTEMS_ARINC653/tree/master/patches
     101
     102 *  virtualpok_arinc653.patch is to be applied to $RTEMS/c/src/lib/libbsp/i386/virtualpok/
     103 *  hello_init_c.patch is to be applied to $RTEMS/testsuites/samples/hello/init.c
     104 *  libpok_rtems_arinc653.patch is to be applied to $POK/libpok
     105 *  rtems-guest_rtems_arinc653.patch is to be applied to $POK/examples/rtems-guest
     106
     1072. Go to $POK/examples/rtems-guest and use the command 'make'. A new folder
     108named generated-code/ should either be added (if it wasn't there yet). Add the
     109following macros to $POK/examples/rtems-guest/generated-code/cpu/part1/deployment.h
     110
     111{{{
     112#define POK_CONFIG_NB_BLACKBOARDS 2
     113#define POK_CONFIG_NB_BUFFERS 2
     114#define POK_CONFIG_ARINC653_NB_SEMAPHORES 2
     115#define POK_CONFIG_NB_EVENTS 2
     116#define POK_CONFIG_ARINC653_NB_EVENTS 2
     117#define POK_NEEDS_BLACKBOARDS 1
     118#define POK_NEEDS_ARINC653_BLACKBOARD 1
     119#define POK_NEEDS_BUFFER 1
     120#define POK_NEEDS_ARINC653_BUFFER 1
     121#define POK_NEEDS_ARINC653_EVENT 1
     122#define POK_NEEDS_ARINC653_ERROR 1
     123#define POK_NEEDS_ARINC653_QUEUEING 1
     124#define POK_NEEDS_ARINC653_SAMPLING 1
     125#define POK_NEEDS_ARINC653_SEMAPHORE 1
     126}}}
     127
     1283. Go to $POK/examples/rtems-guest/generated-code and run the command 'make all'
     129
     1304. Copy-paste $POK/examples/rtems-guest/generated-code/cpu/part1/libpart.a to
     131$RTEMS/c/src/lib/libbsp/i386/virtualpok.
     132
     1335. Build RTEMS with the following configuration line:
     134
     135--target=i386-rtems4.11 --enable-rtemsbsp=virtualpok --enable-paravirt
     136--disable-cxx --disable-networking --disable-posix --enable-maintainter-mode
     137--enable-tests --disable-multiprocessing USE_COM1_AS_CONSOLE=1
     138BSP_PRESS_KEY_FOR_RESET=0
     139
     140For example:
     141{{{
     142mkdir pc386_arinc653
     143cd pc386_arinc653
     144$RTEMS/configure --target=i386-rtems4.11 --enable-rtemsbsp=virtualpok
     145        --enable-paravirt --disable-cxx --disable-networking --disable-posix
     146        --enable-maintainter-mode --enable-tests --disable-multiprocessing
     147        USE_COM1_AS_CONSOLE=1 BSP_PRESS_KEY_FOR_RESET=0
     148}}}
     149
     1506. Copy-paste <build_dir>/i386-rtems4.11/c/virtualpok/testsuites/samples/hello/hello.exe
     151to $POK/examples/rtems-guest
     152
     1537. go to $POK/examples/rtems-guest and run "./copy_rebuild_kernel.sh hello.exe"
     154
     1558. If everything went well you can now run "make run" in $POK/examples/rtems-guest
     156and the arinc653 calls example will run.
     157=  TODO  =
     158
     159
     160- Fix erroneous arinc653 calls (debugging)