diff --git a/README.md b/README.md index 7f235ef7..c75c579e 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,13 @@ This is a collection of APIs abstracting platform specific functionality to be l ## Version History +### Development Build: 1.5.0-rc1+dev42 + +- Updates the Readme for RTEMS and adds `README_RTEMS_5.txt`. The changes include removing references to the CEXP module loader, and describing the development environment setup for RTEMS 5. +- Remove obsolete OS_TaskRegister comment. +- See + + ### Development Build: 1.5.0-rc1+dev36 - Rename `UT_SetForceFail` to `UT_SetDefaultReturnValue` since some functions that retain more than 1 value are not necessarily failing. diff --git a/fsw/mcp750-vxworks/inc/psp_version.h b/fsw/mcp750-vxworks/inc/psp_version.h index 56e583e2..3c5d49ce 100644 --- a/fsw/mcp750-vxworks/inc/psp_version.h +++ b/fsw/mcp750-vxworks/inc/psp_version.h @@ -29,7 +29,7 @@ /* * Development Build Macro Definitions */ -#define CFE_PSP_IMPL_BUILD_NUMBER 36 +#define CFE_PSP_IMPL_BUILD_NUMBER 42 #define CFE_PSP_IMPL_BUILD_BASELINE "v1.5.0-rc1" /* diff --git a/fsw/mcp750-vxworks/src/cfe_psp_exception.c b/fsw/mcp750-vxworks/src/cfe_psp_exception.c index d9f94224..33fa1b50 100644 --- a/fsw/mcp750-vxworks/src/cfe_psp_exception.c +++ b/fsw/mcp750-vxworks/src/cfe_psp_exception.c @@ -169,7 +169,6 @@ void CFE_PSP_ExceptionHook (TASK_ID task_id, int vector, void* vpEsf ) ** ** Notes: The exception environment is local to each task Therefore this must be ** called for each task that that wants to do floating point and catch exceptions -** Currently, this is automatically called from OS_TaskRegister for every task */ void CFE_PSP_SetDefaultExceptionEnvironment(void) { diff --git a/fsw/pc-linux/inc/psp_version.h b/fsw/pc-linux/inc/psp_version.h index 1e13d029..dbc9ebfe 100644 --- a/fsw/pc-linux/inc/psp_version.h +++ b/fsw/pc-linux/inc/psp_version.h @@ -29,7 +29,7 @@ /* * Development Build Macro Definitions */ -#define CFE_PSP_IMPL_BUILD_NUMBER 36 +#define CFE_PSP_IMPL_BUILD_NUMBER 42 #define CFE_PSP_IMPL_BUILD_BASELINE "v1.5.0-rc1" /* diff --git a/fsw/pc-linux/src/cfe_psp_exception.c b/fsw/pc-linux/src/cfe_psp_exception.c index fc57b0c9..2bd16be8 100644 --- a/fsw/pc-linux/src/cfe_psp_exception.c +++ b/fsw/pc-linux/src/cfe_psp_exception.c @@ -264,7 +264,6 @@ void CFE_PSP_AttachExceptions(void) ** ** Notes: The exception environment is local to each task Therefore this must be ** called for each task that that wants to do floating point and catch exceptions -** Currently, this is automaticall called from OS_TaskRegister for every task */ void CFE_PSP_SetDefaultExceptionEnvironment(void) diff --git a/fsw/pc-rtems/README.txt b/fsw/pc-rtems/README.txt index f6e6a146..cd13243b 100644 --- a/fsw/pc-rtems/README.txt +++ b/fsw/pc-rtems/README.txt @@ -1,5 +1,6 @@ ABOUT THE PC-RTEMS CFE PSP ========================== +Note: These instructions are for RTEMS 4.11 The "pc-rtems" PSP layer is intended to be an easy way to prove out the basic functionality of CFE running on RTEMS without actually requiring a real hardware target with RTEMS support. @@ -14,13 +15,8 @@ build system. The RTEMS_BSP_TOP directory must be set to the same location eith the example toolchain file or via -D options to the CMake build. - - I. Setting up and compiling RTEMS BSP -Steps 1 & 5 may require root access. Everything else should be done as regular user. - - 1) install RTEMS toolchain for i386-rtems4.11 (or relevant target arch) into /opt/rtems-4.11 The RTEMS official docs have instructions for this, which should supercede anything here. @@ -29,23 +25,23 @@ Basic use of the the "rtems source builder" tool which works at the time of this OFFICIAL RTEMS SOURCE BUILDER CLONE URL: git://git.rtems.org/rtems-source-builder.git -sudo mkdir -p /opt/rtems-4.11 -git clone git://git.rtems.org/rtems-source-builder.git +mkdir -p ${HOME}/rtems-4.11 +git clone -b 4.11 git://git.rtems.org/rtems-source-builder.git cd rtems-source-builder/rtems -git checkout 4.11.2 -../source-builder/sb-set-builder --prefix=/opt/rtems-4.11 4.11/rtems-i386 +../source-builder/sb-set-builder --prefix=$HOME/rtems-4.11 4.11/rtems-i386 2) Clone/Bootstrap RTEMS source tree: -Note - at the time of this writing 4.11 is the current "stable" branch and -4.11.2 represents the latest point release tag on that branch. The bleeding -edge "development" branch tends to change on a frequent basis. +Note - at the time of this writing 4.11.3 is the latest point release +on the RTEMS 4.11 branch. We are using the rtems git repository 4.11 branch, which +contains the latest point release (or fixes for the point release in progress) +You may wish to download a specific release such as RTEMS 4.11.3. OFFICIAL RTEMS CLONE URL: git://git.rtems.org/rtems.git -$ git clone -b 4.11.2 git://git.rtems.org/rtems.git -$ export PATH=/opt/rtems-4.11/bin:$PATH +$ git clone -b 4.11 git://git.rtems.org/rtems.git +$ export PATH=$HOME/rtems-4.11/bin:$PATH $ (cd rtems && ./bootstrap) @@ -72,30 +68,7 @@ $ make $ make install $ cd .. - -4) Install cexp-2.2.x (dynamic module loader library) - -This is necessary to get the module loader to compile and work. - -Ref page: http://www.slac.stanford.edu/~strauman/rtems/cexp/index.html -Tarball: http://www.slac.stanford.edu/~strauman/rtems/cexp/cexp-2.2.3.tgz - -NOTE: As of 2017-10-26 the code is also now on github, but the git version appears to be -missing files and I was not able to get it to compile. -git clone -b CEXP_Release_2_2_3 https://github.com/till-s/cexpsh.git - -$ mkdir b-cexp -$ cd b-cexp -$ ../cexp-CEXP_Release_2_2_3/configure --with-rtems-top=${HOME}/rtems-4.11 --host=i386-rtems4.11 --enable-std-rtems-installdirs -$ make -$ make install -$ cd .. - -NOTE: using 2.2.3 against the latest rtems-4.11 produce a compile error regarding dereferencing incomplete types. -This appears to be due to #define XOPEN_SOURCE 500 on cexplock.c. Remove this and it compiled. - - -5) RTEMS build module for CMake +4) RTEMS build module for CMake This tells CMake how to build basic binaries for RTEMS - it does not know how to do this "out of the box" on a stock install. @@ -107,18 +80,6 @@ like this if not already present (prior to the "project()" function): set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../psp/cmake/Modules" ${CMAKE_MODULE_PATH}) ->>> IMPORTANT: Any code compiled with "-fPIC" will seriously confuse Cexp!! <<< - -RTEMS does not (yet?) do native shared modules. This build uses Cexp (installed earlier) -to get around this but this is _NOT_ a shared module in the traditional sense - it actually -is just a simple relocatable object that it loads. - -The "CMAKE_C_COMPILE_OPTIONS_PIC" is actually set to _not_ use -fPIC for this reason. - - - - - II. Mission setup modifications to use PC-RTEMS PSP Use a CMake toolchain file to build CFE for RTEMS. This goes under the mission's "_defs" top-level directory. @@ -132,27 +93,52 @@ file will be picked up and used by the build system. ====== START OF EXAMPLE TOOLCHAIN FILE: CUT HERE =========== +# This example toolchain file describes the cross compiler to use for +# the target architecture indicated in the configuration file. + +# In this sample application, the cross toolchain is configured to +# use a compiler for the RTEMS operating system targeting the "pc686" BSP + +# Note that to use this, the "RTEMS" platform module may need to be added +# to the system-wide CMake installation as a default CMake does not yet +# recognize RTEMS as a system name. An example of this is distributed with +# the pc-rtems PSP. + +# Basic cross system configuration set(CMAKE_SYSTEM_NAME RTEMS) set(CMAKE_SYSTEM_PROCESSOR i386) set(CMAKE_SYSTEM_VERSION 4.11) -set(RTEMS_TOOLS_PREFIX "/opt/rtems-${CMAKE_SYSTEM_VERSION}") -set(RTEMS_BSP_PREFIX "$ENV{HOME}/rtems-${CMAKE_SYSTEM_VERSION}") -set(RTEMS_BSP pc686) + +# The TOOLS and BSP are allowed to be installed in different locations. +# If the README was followed they will both be installed under $HOME +# By default it is assumed the BSP is installed to the same directory as the tools +SET(RTEMS_TOOLS_PREFIX "$ENV{HOME}/rtems-${CMAKE_SYSTEM_VERSION}" CACHE PATH + "RTEMS tools install directory") +SET(RTEMS_BSP_PREFIX "${RTEMS_TOOLS_PREFIX}" CACHE PATH + "RTEMS BSP install directory") + +# The BSP that will be used for this build +set(RTEMS_BSP "pc686") # specify the cross compiler - adjust accord to compiler installation # This uses the compiler-wrapper toolchain that buildroot produces -set(TARGET_PREFIX "${CMAKE_SYSTEM_PROCESSOR}-rtems${CMAKE_SYSTEM_VERSION}-") -set(CPUTUNEFLAGS "-march=i686 -mtune=i686") - -SET(CMAKE_C_COMPILER "${RTEMS_TOOLS_PREFIX}/bin/${TARGET_PREFIX}gcc") -SET(CMAKE_CXX_COMPILER "${RTEMS_TOOLS_PREFIX}/bin/${TARGET_PREFIX}g++") -SET(CMAKE_LINKER "${RTEMS_TOOLS_PREFIX}/bin/${TARGET_PREFIX}ld") -SET(CMAKE_ASM_COMPILER "${RTEMS_TOOLS_PREFIX}/bin/${TARGET_PREFIX}as") -SET(CMAKE_STRIP "${RTEMS_TOOLS_PREFIX}/bin/${TARGET_PREFIX}strip") -SET(CMAKE_NM "${RTEMS_TOOLS_PREFIX}/bin/${TARGET_PREFIX}nm") -SET(CMAKE_AR "${RTEMS_TOOLS_PREFIX}/bin/${TARGET_PREFIX}ar") -SET(CMAKE_OBJDUMP "${RTEMS_TOOLS_PREFIX}/bin/${TARGET_PREFIX}objdump") -SET(CMAKE_OBJCOPY "${RTEMS_TOOLS_PREFIX}/bin/${TARGET_PREFIX}objcopy") +SET(SDKHOSTBINDIR "${RTEMS_TOOLS_PREFIX}/bin") +set(TARGETPREFIX "${CMAKE_SYSTEM_PROCESSOR}-rtems${CMAKE_SYSTEM_VERSION}-") +set(RTEMS_BSP_C_FLAGS "-march=i686 -mtune=i686 -fno-common") +set(RTEMS_BSP_CXX_FLAGS ${RTEMS_BSP_C_FLAGS}) + +SET(CMAKE_C_COMPILER "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}gcc") +SET(CMAKE_CXX_COMPILER "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}g++") +SET(CMAKE_LINKER "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}ld") +SET(CMAKE_ASM_COMPILER "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}as") +SET(CMAKE_STRIP "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}strip") +SET(CMAKE_NM "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}nm") +SET(CMAKE_AR "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}ar") +SET(CMAKE_OBJDUMP "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}objdump") +SET(CMAKE_OBJCOPY "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}objcopy") + +# Exception handling is very iffy. These two options disable eh_frame creation. +set(CMAKE_C_COMPILE_OPTIONS_PIC -fno-exceptions -fno-asynchronous-unwind-tables) # search for programs in the build host directories SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) @@ -167,9 +153,21 @@ SET(CMAKE_PREFIX_PATH /) # abstraction layers are built when using this toolchain SET(CFE_SYSTEM_PSPNAME pc-rtems) SET(OSAL_SYSTEM_BSPTYPE pc-rtems) -SET(OSAL_SYSTEM_OSTYPE rtems-ng) - - +SET(OSAL_SYSTEM_OSTYPE rtems) + +# Info regarding the RELOCADDR: +#+--------------------------------------------------------------------------+ +#| Set the value of RELOCADDR to the address where you want your image to +#| load. If you'll be using GRUB to load the images it will have to be >= +#| 0x100000 (1024K). If you are using NetBoot to load the images it can be +#| >= 0x10000 (64K) AND <= 0x97C00 (607K) OR >= 0x100000 (1024K). The memory +#| top is of course another limit. Make sure there is enough space before the +#| upper memory limits for the image and the memory allocated by it to fit. +#| Make sure the value you choose is aligned to 4 bytes. +#+--------------------------------------------------------------------------+ +set(RTEMS_RELOCADDR 0x00100000) + +====== END OF EXAMPLE TOOLCHAIN FILE: CUT HERE =========== 2) Get RTEMS GRUB boot image diff --git a/fsw/pc-rtems/README_RTEMS_5.txt b/fsw/pc-rtems/README_RTEMS_5.txt new file mode 100644 index 00000000..b2f1f753 --- /dev/null +++ b/fsw/pc-rtems/README_RTEMS_5.txt @@ -0,0 +1,280 @@ +ABOUT THE PC-RTEMS CFE PSP for RTEMS 5 +======================================== + +Note: These instructions are for RTEMS 5 + +The "pc-rtems" PSP layer is intended to be an easy way to prove out the basic functionality +of CFE running on RTEMS without actually requiring a real hardware target with RTEMS support. + +It is based on: + - RTEMS built using the "pc686" BSP (i.e. an ordinary off the shelf i686 PC) + - Running the resulting binary in a QEMU virtual i686 PC + +The example instructions here are to set up RTEMS under your local home dir in ${HOME}/rtems-5. +However any location can be used e.g. /opt/x-tools/rtems-5 might be good choice on a shared +build system. The RTEMS_BSP_TOP directory must be set to the same location either by editing +the example toolchain file or via -D options to the CMake build. + + +I. Setting up and compiling RTEMS BSP + +1) install RTEMS toolchain for i386-rtems5 (or relevant target arch) into ${HOME}/rtems5 + +The RTEMS official docs have instructions for this, which should supercede anything here. + +Basic use of the the "rtems source builder" tool which works at the time of this writing: +OFFICIAL RTEMS SOURCE BUILDER CLONE URL: git://git.rtems.org/rtems-source-builder.git + + +mkdir -p ${HOME}/rtems-5 +git clone -b 5 git://git.rtems.org/rtems-source-builder.git +cd rtems-source-builder/rtems +../source-builder/sb-set-builder --prefix=$HOME/rtems-5 5/rtems-i386 + + +2) Clone/Bootstrap RTEMS source tree: + +Note - at the time of this writing 5.1 is the current "stable" branch and +5.1 represents the latest point release tag on that branch. We are going to +use the "5" branch, which will eventually be released as 5.2. The latest +5 branch has a bux fix for the RFS file system needed by the cFS for this target. +If you use the 5.1 release tag (or tarball) you will most likely not be able +to run the cFS without an error. + +OFFICIAL RTEMS CLONE URL: git://git.rtems.org/rtems.git + +$ git clone -b 5 git://git.rtems.org/rtems.git +$ export PATH=$HOME/rtems-5/bin:$PATH +$ (cd rtems && ./bootstrap) + +3) Build/Install RTEMS pc686 BSP + +Note - use same terminal as previous step, or set PATH environment again. +The "prefix" can be whatever location is preferable for installation. + +$ mkdir b-pc686 +$ cd b-pc686 +$ ../rtems/configure --target=i386-rtems5 \ + --enable-rtemsbsp=pc686 \ + --prefix=${HOME}/rtems-5 \ + --enable-networking \ + --enable-cxx \ + --disable-posix \ + --disable-deprecated + +$ make +$ make install +$ cd .. + +4) RTEMS build module for CMake + +This tells CMake how to build basic binaries for RTEMS - it does not know how to do this +"out of the box" on a stock install. + +An "RTEMS.cmake" module is now directly included here with the PSP and can be directly +used by the build system so long as it is included in the CMAKE_MODULE_PATH. Add a line +like this if not already present (prior to the "project()" function): + +set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../psp/cmake/Modules" ${CMAKE_MODULE_PATH}) + + +II. Mission setup modifications to use PC-RTEMS PSP + +Use a CMake toolchain file to build CFE for RTEMS. This goes under the mission's "_defs" top-level directory. +This example below may be edited and tuned to the mission-specific needs. + +Specifically this file should be called "toolchain-.cmake" where can be anything such as +"cpu3" or "i686-pc-rtems". + +Then in the "targets.cmake" file set the "TGT_PLATFORM" variable to be the same ARCHNAME and the toolchain +file will be picked up and used by the build system. + +====== START OF EXAMPLE TOOLCHAIN FILE: CUT HERE =========== +# This example toolchain file describes the cross compiler to use for +# the target architecture indicated in the configuration file. + +# In this sample application, the cross toolchain is configured to +# use a compiler for the RTEMS operating system targeting the "pc686" BSP + +# Note that to use this, the "RTEMS" platform module may need to be added +# to the system-wide CMake installation as a default CMake does not yet +# recognize RTEMS as a system name. An example of this is distributed with +# the pc-rtems PSP. + +# Basic cross system configuration +set(CMAKE_SYSTEM_NAME RTEMS) +set(CMAKE_SYSTEM_PROCESSOR i386) +set(CMAKE_SYSTEM_VERSION 5) + +# The TOOLS and BSP are allowed to be installed in different locations. +# If the README was followed they will both be installed under $HOME +# By default it is assumed the BSP is installed to the same directory as the tools +SET(RTEMS_TOOLS_PREFIX "$ENV{HOME}/rtems-${CMAKE_SYSTEM_VERSION}" CACHE PATH + "RTEMS tools install directory") +SET(RTEMS_BSP_PREFIX "${RTEMS_TOOLS_PREFIX}" CACHE PATH + "RTEMS BSP install directory") + +# The BSP that will be used for this build +set(RTEMS_BSP "pc686") + +# specify the cross compiler - adjust accord to compiler installation +# This uses the compiler-wrapper toolchain that buildroot produces +SET(SDKHOSTBINDIR "${RTEMS_TOOLS_PREFIX}/bin") +set(TARGETPREFIX "${CMAKE_SYSTEM_PROCESSOR}-rtems${CMAKE_SYSTEM_VERSION}-") +set(RTEMS_BSP_C_FLAGS "-march=i686 -mtune=i686 -fno-common") +set(RTEMS_BSP_CXX_FLAGS ${RTEMS_BSP_C_FLAGS}) + + +SET(CMAKE_C_COMPILER "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}gcc") +SET(CMAKE_CXX_COMPILER "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}g++") +SET(CMAKE_LINKER "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}ld") +SET(CMAKE_ASM_COMPILER "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}as") +SET(CMAKE_STRIP "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}strip") +SET(CMAKE_NM "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}nm") +SET(CMAKE_AR "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}ar") +SET(CMAKE_OBJDUMP "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}objdump") +SET(CMAKE_OBJCOPY "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}objcopy") + +# Exception handling is very iffy. These two options disable eh_frame creation. +set(CMAKE_C_COMPILE_OPTIONS_PIC -fno-exceptions -fno-asynchronous-unwind-tables) + +# Link libraries needed for an RTEMS 5.x executable +# This was handled by the bsp_specs file in 4.11 +set(LINK_LIBRARIES "-lrtemsdefaultconfig -lrtemsbsp -lrtemscpu") + +# search for programs in the build host directories +SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) + +# for libraries and headers in the target directories +SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) + +SET(CMAKE_PREFIX_PATH /) + +# these settings are specific to cFE/OSAL and determines which +# abstraction layers are built when using this toolchain +SET(CFE_SYSTEM_PSPNAME pc-rtems) +SET(OSAL_SYSTEM_BSPTYPE pc-rtems) +SET(OSAL_SYSTEM_OSTYPE rtems) + +# This is for RTEMS 5 specific ifdefs needed by the OSAL +ADD_DEFINITIONS(-D_RTEMS_5_) + +# Info regarding the RELOCADDR: +#+--------------------------------------------------------------------------+ +#| Set the value of RELOCADDR to the address where you want your image to +#| load. If you'll be using GRUB to load the images it will have to be >= +#| 0x100000 (1024K). If you are using NetBoot to load the images it can be +#| >= 0x10000 (64K) AND <= 0x97C00 (607K) OR >= 0x100000 (1024K). The memory +#| top is of course another limit. Make sure there is enough space before the +#| upper memory limits for the image and the memory allocated by it to fit. +#| Make sure the value you choose is aligned to 4 bytes. +#+--------------------------------------------------------------------------+ +set(RTEMS_RELOCADDR 0x00100000) + +====== END OF EXAMPLE TOOLCHAIN FILE: CUT HERE =========== + +2) Get RTEMS GRUB boot image + +NOTE: The GRUB image is not needed when using QEMU. The "-kernel" option to QEMU makes things +much easier and is highly recommended. + +RTEMS binaries cannot be directly booted by a PC BIOS... Grub is one way to boot RTEMS. + +Instructions for building GRUB for use with RTEMS@ + +https://devel.rtems.org/wiki/Building/Grub + +If using grub, create a grub configuration file to work with the boot image + +Minimal example below. Replace accordingly, and can be otherwise modified as needed. + +====== START OF EXAMPLE rtems-grub.cfg FILE: CUT HERE =========== + +set default=0 +set timeout=1 + +# Basic menu entry that boots with the console on the emulated VGA screen +menuentry -console { multiboot (hd0,0)/core-.exe } + +# Alternative menu entry to output the RTEMS console to COM1: +menuentry -com1 { multiboot (hd0,0)/core-.exe --console=com1 } + +====== END OF EXAMPLE rtems-grub.cfg FILE: CUT HERE =========== + +NOTE - This should be called "_rtems-grub.cfg" for the target_add_hook macro to find it + +This can also be auto-generated by adding a "FILE(WRITE)" cmake command to the +"target_add_hook" macro in the toolchain file above. However by explicitly writing +the file per cpu this gives extra control / tunability. + + + + +III. Building and Running CFE + +1) Build mission as normal and run "make install" to copy binaries to /exe (if using cmake makefile wrapper) + +2) A minimal QEMU boot sequence for reference (assuming "cpu1") + +qemu-system-i386 -m 128 \ + -kernel ${INSTALL_DIR}/cpu1/core-cpu1.exe \ + -drive file=fat:rw:${INSTALL_DIR}/cpu1,format=raw \ + -nographic \ + -no-reboot \ + -append "--console=/dev/com1" + +where ${INSTALL_DIR} represents the filesystem location of the installed binaries from "make install" + +Note that the "fat" emulation used above is fairly limited, generally only useful for read-only testing. +To get read-write operation one would have to create real filesystem images and copy files into them, then +use the images directly. This is also what would need to be done to deploy on real hardware. + +The "-no-reboot" flag causes QEMU to exit if a panic or shutdown event occurs, rather than emulating +an actual processor reset. This is generally a good thing when debugging, since a bad build can +cause a reset loop. This flag can be omitted if one wishes to emulate the processor reset. + + +3) Network-enabled boot sequence. + +This is an example QEMU command that includes a simulated network device. This works with the +"CI_LAB" / "TO_LAB" apps to allow commands and telemetry from CFE to be exchanged with the host PC. + +The "device" and "netdev" options can be tuned to your preferences (see documentation) + +qemu-system-i386 -m 128 -nographic -no-reboot \ + -kernel ${INSTALL_DIR}/cpu1/core-cpu1.exe \ + -drive file=fat:rw:${INSTALL_DIR}/cpu1,format=raw \ + -device i82557b,netdev=net0,mac=00:04:9F:00:27:61 \ + -netdev user,id=net0,hostfwd=udp:127.0.0.1:1235-:1235 \ + -append "--console=/dev/com1" + +One can then use the "cmdutil" and "tlm_decode" applications to interact with the CFE. + +4) Automated/scripted Unit-testing configuration using QEMU + +The Unit Test BSP (utbsp) by default will start an RTEMS shell and allow +an interactive user to query/interact with the system as part of the unit testing. + +The BSP also supports a "--batch-mode" option which is intended for +automated or script-based execution. It can be invoked through QEMU's +"-append" option or through the GRUB bootloader if using real hardware. +When using QEMU this allows for fully scripted testing. + +The basic QEMU command to execute a single unit test is: + +qemu-system-i386 -m 128 \ + -kernel ${test-executable}.exe \ + -append '--batch-mode' \ + -nographic -no-reboot \ + -append "--console=/dev/com1" \ + > log-${test-executable}.txt + + +The entire suite of unit tests can be executed using a for loop: + +for i in *test.exe *UT.exe; do \ + qemu-system-i386 -m 128 -kernel $i -append '--batch-mode' -nographic -no-reboot -append "--console=/dev/com1" \ + | tee log-${i%%.exe}.txt; \ +done + diff --git a/fsw/pc-rtems/inc/psp_version.h b/fsw/pc-rtems/inc/psp_version.h index bf4edf96..8ca751a7 100644 --- a/fsw/pc-rtems/inc/psp_version.h +++ b/fsw/pc-rtems/inc/psp_version.h @@ -29,7 +29,7 @@ /* * Development Build Macro Definitions */ -#define CFE_PSP_IMPL_BUILD_NUMBER 36 +#define CFE_PSP_IMPL_BUILD_NUMBER 42 #define CFE_PSP_IMPL_BUILD_BASELINE "v1.5.0-rc1" /* diff --git a/fsw/pc-rtems/src/cfe_psp_exception.c b/fsw/pc-rtems/src/cfe_psp_exception.c index 04f58fc1..5570505f 100644 --- a/fsw/pc-rtems/src/cfe_psp_exception.c +++ b/fsw/pc-rtems/src/cfe_psp_exception.c @@ -95,7 +95,6 @@ int32 CFE_PSP_ExceptionGetSummary_Impl(const CFE_PSP_Exception_LogData_t* Buffer ** ** Notes: The exception environment is local to each task Therefore this must be ** called for each task that that wants to do floating point and catch exceptions -** Currently, this is automaticall called from OS_TaskRegister for every task */ void CFE_PSP_SetDefaultExceptionEnvironment(void) {