Skip to content

Commit

Permalink
Fix nasa#577, Scrub OSAL user's guide
Browse files Browse the repository at this point in the history
Documentation changes only
  • Loading branch information
skliper authored and lbleier-GSFC committed Apr 6, 2020
1 parent 20d3b57 commit b41101d
Show file tree
Hide file tree
Showing 9 changed files with 225 additions and 219 deletions.
2 changes: 1 addition & 1 deletion cmake/Makefile.sample
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ usersguide:

osalguide:
$(MAKE) --no-print-directory -C "$(O)" osalguide
@/bin/echo -e "\n\nOsal Users Guide: \nfile://$(CURDIR)/$(O)/doc/osal_guide/html/index.html\n"
@/bin/echo -e "\n\nOsal Users Guide: \nfile://$(CURDIR)/$(O)/doc/osalguide/html/index.html\n"

# Make all the commands that use the build tree depend on a flag file
# that is used to indicate the prep step has been done. This way
Expand Down
8 changes: 3 additions & 5 deletions cmake/cfe-usersguide.doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
# Doxygen Configuration options to generate the "cFE Users Guide"
#---------------------------------------------------------------------------

# Start with the common definitions, some of which are extended or overridden here.
# Start with the main page so document ordering is established
INPUT += @MISSION_SOURCE_DIR@/cfe/docs/src/main.dox

# Common definitions, some of which are extended or overridden here.
@INCLUDE = @MISSION_BINARY_DIR@/doc/cfe-common.doxyfile
PROJECT_NAME = "Core Flight Executive Users Guide"
OUTPUT_DIRECTORY = users_guide
Expand All @@ -15,10 +17,6 @@ GENERATE_LATEX = YES
STRIP_FROM_PATH += @MISSION_SOURCE_DIR@/cfe/cmake/sample_defs
INPUT += @MISSION_SOURCE_DIR@/cfe/cmake/sample_defs

# Main page for the users guide
INPUT += @MISSION_SOURCE_DIR@/cfe/docs/src/main.dox
INPUT += @MISSION_SOURCE_DIR@/cfe/docs/src/cfe_usersguide.dox

#PREDEFINED
PREDEFINED += @USERGUIDE_PREDEFINED@

Expand Down
14 changes: 5 additions & 9 deletions cmake/osalguide.doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,17 @@
# Doxygen Configuration options to generate the "OSAL API Guide"
#---------------------------------------------------------------------------

# Start with the common definitions, some of which are extended or overridden here.
# Start with the main page so document ordering is established
INPUT += @MISSION_SOURCE_DIR@/cfe/docs/src/osalmain.dox

# Common definitions, some of which are extended or overridden here.
@INCLUDE = @MISSION_BINARY_DIR@/doc/osal-common.doxyfile
PROJECT_NAME = "Core Flight Executive OSAL API Guide"
PROJECT_NAME = "OSAL User's Guide"
OUTPUT_DIRECTORY = osalguide
GENERATE_LATEX = YES

# Main page for the osal guide
INPUT += @MISSION_SOURCE_DIR@/cfe/docs/src/osalmain.dox
INPUT += @MISSION_SOURCE_DIR@/cfe/docs/src/osalguide.dox

#PREDEFINED
PREDEFINED += @OSALGUIDE_PREDEFINED@

# Bring in the cFE header files for the documentation of the various API calls
INPUT += \
@MISSION_OSAL_HEADERFILES@ \
@OSAL_MISC_ADDITION@
INPUT += @MISSION_OSAL_HEADERFILES@
51 changes: 0 additions & 51 deletions docs/src/cfe_usersguide.dox

This file was deleted.

106 changes: 53 additions & 53 deletions docs/src/main.dox
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,59 @@
\mainpage Core Flight Executive Documentation

<UL>
<LI> General Information and Concepts <BR>
<UL>
<LI> \subpage cfebackground <BR>
<LI> \subpage cfeappdocs <BR>
<LI> \subpage cfeversion <BR>
<LI> \subpage cfedependencies <BR>
<LI> \subpage cfeacronyms <BR>
<LI> \subpage cfeglossary <BR>
</UL>
<LI> Executive Services (ES) <BR>
<UL>
<LI> \subpage cfeesovr <BR>
<LI> \subpage cfeescmds <BR>
<LI> \subpage cfeestlm <BR>
<LI> \subpage cfe_es_events.h "ES Event Message Reference" <BR>
<LI> \subpage cfeescfg <BR>
</UL>
<LI> Events Services (EVS) <BR>
<UL>
<LI> \subpage cfeevsovr <BR>
<LI> \subpage cfeevscmds <BR>
<LI> \subpage cfeevstlm <BR>
<LI> \subpage cfe_evs_events.h "EVS Event Message Reference" <BR>
<LI> \subpage cfeevscfg <BR>
</UL>
<LI> Software Bus Services (SB) <BR>
<UL>
<LI> \subpage cfesbovr <BR>
<LI> \subpage cfesbcmds <BR>
<LI> \subpage cfesbtlm <BR>
<LI> \subpage cfe_sb_events.h "SB Event Message Reference" <BR>
<LI> \subpage cfesbcfg <BR>
</UL>
<LI> Table Services (TBL) <BR>
<UL>
<LI> \subpage cfetblovr <BR>
<LI> \subpage cfetblcmds <BR>
<LI> \subpage cfetbltlm <BR>
<LI> \subpage cfe_tbl_events.h "TBL Event Message Reference" <BR>
<LI> \subpage cfetblcfg <BR>
</UL>
<LI> Time Services (TIME) <BR>
<UL>
<LI> \subpage cfetimeovr <BR>
<LI> \subpage cfetimecmds <BR>
<LI> \subpage cfetimetlm <BR>
<LI> \subpage cfe_time_events.h "TIME Event Message Reference" <BR>
<LI> \subpage cfetimecfg <BR>
</UL>
<LI> \subpage cfeevents <BR>
<LI> \subpage cfecmdmnems <BR>
<LI> \subpage cfetlmmnems <BR>
<LI> \subpage cfeapi <BR>
<LI> General Information and Concepts
<UL>
<LI> \subpage cfebackground
<LI> \subpage cfeappdocs
<LI> \subpage cfeversion
<LI> \subpage cfedependencies
<LI> \subpage cfeacronyms
<LI> \subpage cfeglossary
</UL>
<LI> Executive Services (ES)
<UL>
<LI> \subpage cfeesovr
<LI> \subpage cfeescmds
<LI> \subpage cfeestlm
<LI> \subpage cfe_es_events.h "ES Event Message Reference"
<LI> \subpage cfeescfg
</UL>
<LI> Events Services (EVS)
<UL>
<LI> \subpage cfeevsovr
<LI> \subpage cfeevscmds
<LI> \subpage cfeevstlm
<LI> \subpage cfe_evs_events.h "EVS Event Message Reference"
<LI> \subpage cfeevscfg
</UL>
<LI> Software Bus Services (SB)
<UL>
<LI> \subpage cfesbovr
<LI> \subpage cfesbcmds
<LI> \subpage cfesbtlm
<LI> \subpage cfe_sb_events.h "SB Event Message Reference"
<LI> \subpage cfesbcfg
</UL>
<LI> Table Services (TBL)
<UL>
<LI> \subpage cfetblovr
<LI> \subpage cfetblcmds
<LI> \subpage cfetbltlm
<LI> \subpage cfe_tbl_events.h "TBL Event Message Reference"
<LI> \subpage cfetblcfg
</UL>
<LI> Time Services (TIME)
<UL>
<LI> \subpage cfetimeovr
<LI> \subpage cfetimecmds
<LI> \subpage cfetimetlm
<LI> \subpage cfe_time_events.h "TIME Event Message Reference"
<LI> \subpage cfetimecfg
</UL>
<LI> \subpage cfeevents
<LI> \subpage cfecmdmnems
<LI> \subpage cfetlmmnems
<LI> \subpage cfeapi
</UL>

**/
Expand Down
124 changes: 84 additions & 40 deletions docs/src/osal_fs.dox
Original file line number Diff line number Diff line change
@@ -1,50 +1,94 @@
/**
\page osalfsovr File System Overview

The File System API is a thin wrapper around a selection of POSIX file APIs. In addition the File System API presents a common directory structure and volume view regardless of the underlying system type. For example, vxWorks uses MS-DOS style volume names and directories. For example, a vxWorks RAM disk might have the volume “RAM:0”. With this File System API, volumes are represented as Unix-style paths where each volume is mounted on the root file system:

<UL>
The File System API is a thin wrapper around a selection of POSIX file APIs.
In addition the File System API presents a common directory structure and
volume view regardless of the underlying system type. For example, vxWorks
uses MS-DOS style volume names and directories where a vxWorks RAM disk might
have the volume “RAM:0”. With this File System API, volumes are represented
as Unix-style paths where each volume is mounted on the root file system:

<UL>
<LI>RAM:0/file1.dat becomes /mnt/ram/file1.dat
<LI>FL:0/file2.dat becomes /mnt/fl/file2.dat
</UL>

This abstraction allows the applications to use the same paths regardless of the implementation and it also allows file systems to be simulated on a desktop system for testing. On a desktop Linux system, the file system abstraction can be set up to map virtual devices to a regular directory. This is accomplished through the OS_mkfs call, OS_mount call, and a BSP specific volume table that maps the virtual devices to real devices or underlying file systems.

In order to make this file system volume abstraction work, a “Volume Table” needs to be provided in the Board Support Package of the application. The table has the following fields:

<UL>
<LI> Device Name: This is the name of the virtual device that the Application uses. Common names are “ramdisk1”, “flash1”, or “volatile1” etc. But the name can be any unique string.

<LI>Physical Device Name: This is an implementation specific field. For vxWorks it is not needed and can be left blank. For a File system based implementation, it is the “mount point” on the root file system where all of the volume will be mounted. A common place for this on Linux could be a user’s home directory, “/tmp”, or even the current working directory “.”. In the example of “/tmp” all of the directories created for the volumes would be under “/tmp” on the Linux file system. For a real disk device in Linux, such as a RAM disk, this field is the device name “/dev/ram0”.

<LI>Volume Type: This field defines the type of volume. The types are: FS_BASED which uses the existing file system, RAM_DISK which uses a RAM_DISK device in vxWorks, RTEMS, or Linux, FLASH_DISK_FORMAT which uses a flash disk that is to be formatted before use, FLASH_DISK_INIT which uses a flash disk with an existing format that is just to be initialized before it’s use, EEPROM which is for an EEPROM or PROM based system.

<LI>Volatile Flag: This flag indicates that the volume or disk is a volatile disk (RAM disk ) or a non-volatile disk, that retains its contents when the system is rebooted. This should be set to TRUE or FALSE.

<LI>Free Flag: This is an internal flag that should be set to FALSE or zero.

<LI>Is Mounted Flag: This is an internal flag that should be set to FALSE or zero. Note that a “pre-mounted” FS_BASED path can be set up by setting this flag to one.

<LI>Volume Name: This is an internal field and should be set to a space character “ “.

<LI>Mount Point Field: This is an internal field and should be set to a space character “ “.

<LI>Block Size Field: This is used to record the block size of the device and does not need to be set by the user.
</UL>

</UL>

This abstraction allows the applications to use the same paths regardless of
the implementation and it also allows file systems to be simulated on a desktop
system for testing. On a desktop Linux system, the file system abstraction can
be set up to map virtual devices to a regular directory. This is accomplished
through the OS_mkfs call, OS_mount call, and a BSP specific volume table that
maps the virtual devices to real devices or underlying file systems.

In order to make this file system volume abstraction work, a “Volume Table”
needs to be provided in the Board Support Package of the application. The table
has the following fields:

<UL>
<LI> Device Name: This is the name of the virtual device that the Application
uses. Common names are “ramdisk1”, “flash1”, or “volatile1” etc. But the
name can be any unique string.
<LI> Physical Device Name: This is an implementation specific field. For
vxWorks it is not needed and can be left blank. For a File system based
implementation, it is the “mount point” on the root file system where all
of the volume will be mounted. A common place for this on Linux could
be a user’s home directory, “/tmp”, or even the current working
directory “.”. In the example of “/tmp” all of the directories created
for the volumes would be under “/tmp” on the Linux file system. For a real
disk device in Linux, such as a RAM disk, this field is the device
name “/dev/ram0”.
<LI> Volume Type: This field defines the type of volume. The types are:
FS_BASED which uses the existing file system, RAM_DISK which uses a
RAM_DISK device in vxWorks, RTEMS, or Linux, FLASH_DISK_FORMAT which uses
a flash disk that is to be formatted before use, FLASH_DISK_INIT which
uses a flash disk with an existing format that is just to be initialized
before it’s use, EEPROM which is for an EEPROM or PROM based system.
<LI> Volatile Flag: This flag indicates that the volume or disk is a volatile
disk (RAM disk ) or a non-volatile disk, that retains its contents when
the system is rebooted. This should be set to TRUE or FALSE.
<LI> Free Flag: This is an internal flag that should be set to FALSE or zero.
<LI> Is Mounted Flag: This is an internal flag that should be set to FALSE
or zero. Note that a “pre-mounted” FS_BASED path can be set up by setting
this flag to one.
<LI> Volume Name: This is an internal field and should be set to a space
character “ “.
<LI> Mount Point Field: This is an internal field and should be set to a space
character “ “.
<LI> Block Size Field: This is used to record the block size of the device and
does not need to be set by the user.
</UL>
**/

/**
\page osalfsfd File Descriptors In Osal

The OSAL uses abstracted file descriptors. This means that the file descriptors passed back from the OS_open and OS_creat calls will only work with other OSAL OS_* calls. The reasoning for this is as follows:

Because the OSAL now keeps track of all file descriptors, OSAL specific information can be associated with a specific file descriptor in an OS independent way. For instance, the path of the file that the file descriptor points to can be easily retrieved. Also, the OSAL task ID of the task that opened the file can also be retrieved easily. Both of these pieces of information are very useful when trying to determine statistics for a task, or the entire system. This information can all be retrieved with a single API, OS_FDGetInfo.

Realizing that we cannot provide all of the file system calls that everyone would need, we also provide the underlying OS's file descriptor for any valid OSAL file descriptor. This way, you can manipulate the underlying file descriptor as needed.

There are some small drawbacks with the OSAL file descriptors. Because the related information is kept in a table., there is a define called OS_MAX_NUM_OPEN_FILES that defines the maximum number of file descriptors available. This is a configuration parameter, and can be changed to fit your needs.

Also, if you open or create a file not using the OSAL calls (OS_open or OS_creat) then none of the other OS_* calls that accept a file descriptor as a parameter will work (the results of doing so are undefined). Therefore, if you open a file with the underlying OS's open call, you must continue to use the OS's calls until you close the file descriptor. Be aware that by doing this your software may no longer be OS agnostic.

**/
The OSAL uses abstracted file descriptors. This means that the file descriptors
passed back from the OS_open and OS_creat calls will only work with other OSAL OS_*
calls. The reasoning for this is as follows:

Because the OSAL now keeps track of all file descriptors, OSAL specific information
can be associated with a specific file descriptor in an OS independent way. For
instance, the path of the file that the file descriptor points to can be easily
retrieved. Also, the OSAL task ID of the task that opened the file can also be
retrieved easily. Both of these pieces of information are very useful when trying
to determine statistics for a task, or the entire system. This information can all
be retrieved with a single API, OS_FDGetInfo.

All of possible file system calls are not implemented. "Special" files requiring OS
specific control/operations are by nature not portable. Abstraction in this case is
is not possible, so the raw OS calls should be used (including open/close/etc). Mixing
with OSAL calls is not supported for such cases. #OS_TranslatePath is available to
support using open directly by an app and maintain abstraction on the file system.

There are some small drawbacks with the OSAL file descriptors. Because the related
information is kept in a table, there is a define called OS_MAX_NUM_OPEN_FILES that
defines the maximum number of file descriptors available. This is a configuration
parameter, and can be changed to fit your needs.

Also, if you open or create a file not using the OSAL calls (OS_open or OS_creat)
then none of the other OS_* calls that accept a file descriptor as a parameter will
work (the results of doing so are undefined). Therefore, if you open a file with
the underlying OS's open call, you must continue to use the OS's calls until you
close the file descriptor. Be aware that by doing this your software may no longer
be OS agnostic.
**/
11 changes: 6 additions & 5 deletions docs/src/osal_timer.dox
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/**
\page osaltimerover Timer Overview
\page osaltimerover Timer Overview

The timer API is a generic interface to the OS timer facilities. It is implemented using the POSIX timers on Linux and vxWorks and the native timer API on RTEMS. The OS X version is not complete, and will have to be simulated, since the POSIX timer API is not supported on OS X. Cygwin support is TBD. The number of timers supported is controlled by the configuration parameter OS_MAX_TIMERS.


**/
The timer API is a generic interface to the OS timer facilities. It is
implemented using the POSIX timers on Linux and vxWorks and the native timer
API on RTEMS. The number of timers supported is controlled by the configuration
parameter OS_MAX_TIMERS.
**/
Loading

0 comments on commit b41101d

Please sign in to comment.