GithubHelp home page GithubHelp logo

cfe2cos's People

Contributors

base0x10 avatar others avatar robertgiff avatar zacharied avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

base0x10

cfe2cos's Issues

Implement PSP watchdog timer functions

void CFE_PSP_WatchdogInit(void)

CFE_PSP_WatchdogInit configures the watchdog timer.

void CFE_PSP_WatchdogEnable(void)

CFE_PSP_WatchdogEnable enables the watchdog timer.

void CFE_PSP_WatchdogDisable(void)

CFE_PSP_WatchdogDisable disables the watchdog timer.

void CFE_PSP_WatchdogService(void)

CFE_PSP_WatchdogService services the watchdog timer according to the
value set in WatchDogSet.

uint32 CFE_PSP_WatchdogGet(void)

CFE_PSP_WatchdogGet gets the watchdog time in milliseconds

void CFE_PSP_WatchdogSet(uint32 WatchdogValue)

CFE_PSP_WatchdogSet sets the watchdog time in milliseconds

implement PSP entry point and restart Functions

void CFE_PSP_Main(uint32 ModeId, char *StartupFilePath)

CFE_PSP_Main is the entry point that the real time OS calls to start our
software. This routine will do any BSP/OS specific setup, then call the
entrypoint of the flight software ( i.e. the cFE main entry point ).
The flight software (i.e. cFE ) should not call this routine.

void CFE_PSP_Restart(uint32 resetType)

CFE_PSP_Restart is the entry point back to the BSP to restart the processor.
The flight software calls this routine to restart the processor.

uint32 CFE_PSP_GetRestartType(uint32 *restartSubType )

CFE_PSP_GetRestartType returns the last reset type and if a pointer to a valid
memory space is passed in, it returns the reset sub-type in that memory.
Right now the reset types are application specific. For the cFE they
are defined in the cfe_es.h file.

'uint32 CFE_PSP_GetSpacecraftId(void)'

CFE_PSP_GetSpacecraftId retuns the Spacecraft ID (if any )
we will probably just have it return 1 or perhaps a meaningful machine identifier

Implement Semaphore and Mutex API Functions

This is going to be a lot of work. There are 22 Functions to implement and it may be difficult to integrate with the COS resource tables (or I could be misunderstanding how that will work).

int32 OS_BinSemCreate(uint32 *sem_id, const char *sem_name, uint32 sem_initial_value, uint32 options)
This function creates a binary semaphore. Semaphore names must be unique; if the name already exists this function fails. Names cannot be NULL.

int32 OS_BinSemDelete ( uint32 sem_id )
This is the function used to delete a binary semaphore in the operating system. This also frees the respective sem_id to be used again when another semaphore is created.

int32 OS_BinSemFlush(uint32 sem_id)
This function releases all the tasks waiting on the given semaphore

int32 OS_BinSemGive(uint32 sem_id)
This function gives back a binary semaphore

int32 OS_BinSemTake(uint32 sem_id)
This function reserves a binary semaphore

int32 OS_BinSemTimeWait(uint32 sem_id , uint32 msecs)
This function reserves a binary semaphore with a timeout.

int32 OS_BinSemGetIdByName (uint32 *sem_id, const char *sem_name)
This function takes a binary semaphore name and looks for a valid binary semaphore with this name and returns the id of that semaphore.

int32 OS_BinSemGetInfo (uint32 sem_id, OS_mut_sem_prop_t *sem_prop)
This function takes sem_id, and looks it up in the OS table. It puts all of the information known about that semaphore into a structure pointer to by sem_prop

int32 OS_CountSemCreate(uint32 *sem_id, const char *sem_name, uint32 sem_initial_value, uint32 options)
This function creates a counting semaphore. Semaphore names must be unique; if the name already exists this function fails. Names cannot be NULL.

int32 OS_CountSemDelete ( uint32 sem_id )
This is the function used to delete a counting semaphore in the operating system. This also frees the respective sem_id to be used again when another semaphore is created.

int32 OS_CountSemGive(uint32 sem_id)
This function gives back a counting semaphore

int32 OS_CountSemTake(uint32 sem_id)
This function reserves a counting semaphore

int32 OS_CountSemTimeWait(uint32 sem_id , uint32 msecs)
This function reserves a counting semaphore with a timeout.

int32 OS_CountSemGetIdByName (uint32 *sem_id, const char *sem_name)
This function takes a counting semaphore name and looks for a valid counting semaphore with this name and returns the id of that semaphore.

int32 OS_CountSemGetInfo (uint32 sem_id, OS_mut_sem_prop_t *sem_prop)
This function takes sem_id, and looks it up in the OS table. It puts all of the information known about that semaphore into a structure pointer to by sem_prop

int32 OS_MutSemCreate(uint32 *sem_id, const char *sem_name, uint32 options)
This function creates a mutex semaphore. Semaphore names must be unique; if the name already exists this function fails. Names cannot be NULL.

int32 OS_MutSemDelete ( uint32 sem_id )
This is the function used to delete a binary semaphore in the operating system. This also frees the respective sem_id to be used again when another mutex is created.

int32 OS_MutSemGive (uint32 sem_id )
This function releases a mutex semaphore

int32 OS_MutSemTake (uint32 sem_id )
This function allocates a mutex semaphore

int32 OS_MutSemGetIdByName (uint32 *sem_id, const char *sem_name)
This function takes a mutex name and looks for a valid mutex semaphore with this name and returns the id of that semaphore.

int32 OS_MutSemGetInfo (uint32 sem_id, OS_mut_sem_prop_t *sem_prop)
This function takes sem_id, and looks it up in the OS table. It puts all of the information known about that mutex into a structure pointer to by sem_prop

"Implement" PSP's EEPROM API

Eepromwrite API
We are totally going to be just implementing a hacky simulation of an EEPROM

int32 CFE_PSP_EepromWrite8(cpuaddr MemoryAddress, uint8 ByteValue)

int32 CFE_PSP_EepromWrite16(cpuaddr MemoryAddress, uint16 uint16Value)

int32 CFE_PSP_EepromWrite32(cpuaddr MemoryAddress, uint32 uint32Value)

int32 CFE_PSP_EepromWriteEnable(uint32 Bank)

int32 CFE_PSP_EepromWriteDisable(uint32 Bank)

int32 CFE_PSP_EepromPowerUp(uint32 Bank)

int32 CFE_PSP_EepromPowerDown(uint32 Bank)

Implement OSAL's Dynamic Loader and Symbol API

Someone with a better knowledge of our build should look at these and see if there is anything we need to be aware of. It seems like if we are not going to be dynamically loading, they can just be stubbed. Refer to OSAL API library in cFE-6.5.0-OSS-release/osal/doc

int32 OS_SymbolLookup (uint32 *SymbolAddress, char *SymbolName)
This function will lookup the address of a symbol.

int32 OS_SymbolTableDump ( char *filename, uint32 SizeLimit )
This function dumps the system symbol table to the specified filename.

int32 OS_ModuleLoad ( uint32 *ModuleId, char *FileName, OS_ModuleInfo_t *OptLoadAddress )
This function loads a new ELF object module into the operating system. This is intended for the loader in Traditional Real Time Operating Systems ( RTOSs ) such as vxWorks. The ELF object loader will load an “unlinked” object module into the system, resolve the external references, and enter it’s global symbols into the system symbol table for use. The dynamic loaders available include the vxWorks object loader and the RTEMS/Linux based CEXP. The desktop operating systems have a way of implementing this as well ( dlopen, dlsym on linux, OS X, cygwin )

int32 OS_ModuleUnload ( uint32 ModuleId )
This function unloads the specified module from the system. Not all operating system module loaders support the unload function.

int32 OS_ModuleInfo ( uint32 ModuleId, OS_ModuleInfo_t *ModuleInfo)
This function fills out the OS_ModuleInfo_t structure with data about the module identified by ModuleId. The OS_ModuleInfo_t structure contains the following fields:
CodeAddress, CodeSize, DataAddress, DataSize, BSSAddress, BSSSize, and Flags. The primary use is to obtain the location of the dynamically loaded module.

Implement PSP's memory API Functions

Memory API

int32 CFE_PSP_MemRead8(cpuaddr MemoryAddress, uint8 *ByteValue)

int32 CFE_PSP_MemWrite8(cpuaddr MemoryAddress, uint8 ByteValue)

int32 CFE_PSP_MemRead16(cpuaddr MemoryAddress, uint16 *uint16Value)

int32 CFE_PSP_MemWrite16(cpuaddr MemoryAddress, uint16 uint16Value)

int32 CFE_PSP_MemRead32(cpuaddr MemoryAddress, uint32 *uint32Value)

int32 CFE_PSP_MemWrite32(cpuaddr MemoryAddress, uint32 uint32Value)

int32 CFE_PSP_MemCpy(void *dest, void *src, uint32 n)

int32 CFE_PSP_MemSet(void *dest, uint8 value, uint32 n)

int32 CFE_PSP_MemValidateRange(cpuaddr Address, uint32 Size, uint32 MemoryType)

uint32 CFE_PSP_MemRanges(void)

int32 CFE_PSP_MemRangeSet(uint32 RangeNum, uint32 MemoryType, cpuaddr StartAddr, uint32 Size, uint32 WordSize, uint32 Attributes)

int32 CFE_PSP_MemRangeGet (uint32 RangeNum, uint32 *MemoryType, cpuaddr *StartAddr, uint32 *Size, uint32 *WordSize, uint32 *Attributes)

Implement other processor related methods for PSP

uint32 CFE_PSP_GetProcessorId(void)

CFE_PSP_GetProcessorId returns the CPU ID as defined by the specific board
and BSP.

void CFE_PSP_FlushCaches(uint32 type, cpuaddr address, uint32 size)

This is a BSP specific cache flush routine

Implement OSAL's Miscellaneous Functions (Timeing and Printing and API_Init)

int32 OS_API_Init (void)
This function returns initializes the internal data structures of the OS Abstraction Layer.
It must be called in the application startup code before calling any other OS routines.

void OS_printf (const char String, ...)
This function provides a printing utility similar to printf. There is a #define
OS_UTILITY_TASK_ON which, in the VxWorks operating systems, creates a utility
task to which all the parameters to OS_printf are passed. The utility task then prints out
the message. This is done so that print statements may be called from tasks that cannot
block.
In the other OS’s, (and if the #define is not present), OS_printf provides a pass through to
printf.
This function takes all the parameters and formatting options of printf.

void OS_printf_disable(void)
This function disables the UART or console output of OS_printf. After this function is
called, OS_printf will return immediately without trying to format or output any strings.

void OS_printf_enable(void)
This function enables the UART or console output of OS_printf. After this function is called, OS_printf will format and output strings that are passed to it.

int32 OS_Tick2Micros (void)
This function returns the number of microseconds per operating system tick. It is used for computing the delay time in the operating system calls.

int32 OS_GetLocalTime( OS_time_t * time_struct)
This function returns the local time of the machine it is on

int32 OS_SetLocalTime( OS_time_t * time_struct)
This function allows the user to set the local time of the machine it is on

int32 OS_Milli2Ticks ( uint32 milli_seconds)
This function returns the equivalent number of system clock ticks for the give period of time in milliseconds. The number of ticks is rounded up if necessary

Implement OSAL's Task API methods

int32 OS_TaskCreate(uint32 *task_id, const char *task_name, const void *function_pointer, const uint32 *stack_pointer, uint32 stack_size, uint32 priority, uint32 flags)
Creates a task and passes back the id of the task created. Task names must be unique; if the name already exists this function fails. Names cannot be NULL.

int32 OS_TaskDelete ( uint32 task_id )
This function is used to delete a task in the operating system. This also frees the respective task_id to be used again when another task is created.

int32 OS_TaskInstallDeleteHandler(void *function_pointer)
This function is used to install a callback that is called when the task is deleted. The callback is called when OS_TaskDelete is called with the task ID. A task delete handler is useful for cleaning up resources that a task creates, before the task is removed from the system.

void OS_TaskDelete ( void )
This function allows a task to delete itself (exit). It frees its task Id to be used again by another task. This function doesn't delete any resources used by the task.

Int32 OS_TaskDelay(uint32 millisecond )
Causes the current thread to be suspended from execution for the period of millisecond.

int OS_TaskSetPriority(uint32 task_id, uint32 new_priority)
Sets the priority for the specified task.

int OS_TaskRegister(void)
Registers the task, performing application and OS specific initialization.
This function should be called at the start of each task.

Int32 OS_TaskGetId (void)
This function returns a unique identification number for task/thread where this routine was called.

int32 OS_TaskGetIdByName (uint32 *task_id, const char *task_name)
This function takes a task name and looks for a valid task with this name and returns the id of that task.

int32 OS_TaskGetInfo (uint32 task_id, OS_task_prop_t *task_prop)
This function takes task_id, and looks it up in the OS table. It puts all of the information known about that task into a structure pointer to by task_prop

Implement PSP's error, exception, and panic related function

void CFE_PSP_AttachExceptions(void)

CFE_PSP_AttachExceptions will setup the exception environment for the chosen platform
On a board, this can be configured to look at a debug flag or switch in order to
keep the standard OS exeption handlers, rather than restarting the system

void CFE_PSP_SetDefaultExceptionEnvironment(void)

CFE_PSP_SetDefaultExceptionEnvironment defines the CPU and FPU exceptions that are enabled for each cFE Task/App

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

void CFE_PSP_Panic(int32 ErrorCode)

CFE_PSP_Panic is called by the cFE Core startup code when it needs to abort the
cFE startup. This should not be called by applications.

Implement PSP timer related methods

uint32 CFE_PSP_Get_Timer_Tick(void)

CFE_PSP_Get_Timer_Tick returns the underlying OS timer tick value
It is used for the performance monitoring software

uint32 CFE_PSP_GetTimerTicksPerSecond(void)

CFE_PSP_GetTimerTicksPerSecond provides the resolution of the least significant
32 bits of the 64 bit time stamp returned by CFE_PSP_Get_Timebase in timer
ticks per second. The timer resolution for accuracy should not be any slower
than 1000000 ticks per second or 1 us per tick

uint32 CFE_PSP_GetTimerLow32Rollover(void)

CFE_PSP_GetTimerLow32Rollover provides the number that the least significant
32 bits of the 64 bit time stamp returned by CFE_PSP_Get_Timebase rolls over.
If the lower 32 bits rolls at 1 second, then the CFE_PSP_TIMER_LOW32_ROLLOVER
will be 1000000. if the lower 32 bits rolls at its maximum value (2^32) then
CFE_PSP_TIMER_LOW32_ROLLOVER will be 0.

void CFE_PSP_Get_Timebase(uint32 *Tbu, uint32 *Tbl)

Provides a common interface to system timebase. This routine
is in the BSP because it is sometimes implemented in hardware and
sometimes taken care of by the RTOS.

void CFE_PSP_GetTime(OS_time_t *LocalTime)

This call gets the local time from the hardware on the Vxworks system

  • on the mcp750s
  • on the other os/hardware setup, it will get the time the normal way

uint32 CFE_PSP_Get_Dec(void)

provides a common interface to decrementer counter. this routine is in the bsp because it is sometimes implemented in hardware and sometimes taken care of by RTOS

Implement PSP's IO Functions

I/O Port API

int32 CFE_PSP_PortRead8(cpuaddr PortAddress, uint8 *ByteValue)

int32 CFE_PSP_PortWrite8(cpuaddr PortAddress, uint8 ByteValue)

int32 CFE_PSP_PortRead16(cpuaddr PortAddress, uint16 *uint16Value)

int32 CFE_PSP_PortWrite16(cpuaddr PortAddress, uint16 uint16Value)

int32 CFE_PSP_PortRead32(cpuaddr PortAddress, uint32 *uint32Value)

int32 CFE_PSP_PortWrite32(cpuaddr PortAddress, uint32 uint32Value)

Implement other memory and storage functions for PSP

int32 CFE_PSP_GetCDSSize(uint32 *SizeOfCDS)

CFE_PSP_GetCDSSize fetches the size of the OS Critical Data Store area.

int32 CFE_PSP_WriteToCDS(void *PtrToDataToWrite, uint32 CDSOffset, uint32 NumBytes)

CFE_PSP_WriteToCDS writes to the CDS Block.

int32 CFE_PSP_ReadFromCDS(void *PtrToDataToRead, uint32 CDSOffset, uint32 NumBytes)

CFE_PSP_ReadFromCDS reads from the CDS Block

int32 CFE_PSP_GetUserReservedArea(cpuaddr *PtrToUserArea, uint32 *SizeOfUserArea )

CFE_PSP_GetUserReservedArea returns the location and size of the memory used for the cFE
User reserved area.

int32 CFE_PSP_GetVolatileDiskMem(cpuaddr *PtrToVolDisk, uint32 *SizeOfVolDisk )

CFE_PSP_GetVolatileDiskMem returns the location and size of the memory used for the cFE
volatile disk.

int32 CFE_PSP_GetKernelTextSegmentInfo(cpuaddr *PtrToKernelSegment, uint32 *SizeOfKernelSegment)

CFE_PSP_GetKernelTextSegmentInfo returns the location and size of the kernel memory.

int32 CFE_PSP_InitSSR(uint32 bus, uint32 device, char *DeviceName)

CFE_PSP_InitSSR will initialize the Solid state recorder memory for a particular platform

int32 CFE_PSP_InitProcessorReservedMemory(uint32 RestartType )

CFE_PSP_InitProcessorReservedMemory initializes all of the memory in the
BSP that is preserved on a processor reset. The memory includes the
Critical Data Store, the ES Reset Area, the Volatile Disk Memory, and
the User Reserved Memory. In general, the memory areas will be initialized
( cleared ) on a Power On reset, and preserved during a processor reset.

int32 CFE_PSP_Decompress( char * srcFileName, char * dstFileName)

Not super related to other methods in this issue, but needs to be implemented.
It initially looks like composite already has a way to do this, but I could be wrong
CFE_PSP_Decompress will uncompress the source file to the file specified in the
destination file name. The Decompress uses the "gzip" algorithm. Files can
be compressed using the "gzip" program available on almost all host platforms.

We shouldn't have to mock `__isoc99_sscanf`

Currently we're providing a mock implementation of __isoc99_sscanf in cFE_util.c, because otherwise the build fails.

This forum thread seems to have some information about this problem. I think it's most likely that we're compiling against two different versions of libc.

Since for now the stub isn't called, and no panic occurs, I'm putting this on the back burner. However, eventually either the cFE will call the stub or the root cause of the issue will pop up again, so we should probably figure out how to remove the stub.

Implement OSAL's Queue Functions

int32 OS_QueueCreate ( uint32 *queue_id, const char *queue_name, uint32 queue_depth, uint32 data_size, uint32 flags )
This is the function used to create a queue in the operating system. Depending on the
underlying operating system, the memory for the queue will be allocated automatically or
allocated by the code that sets up the queue. Queue names must be unique; if the name
already exists this function fails. Names cannot be NULL.

int32 OS_QueueDelete ( uint32 queue_id )
This is the function used to delete a queue in the operating system. This also frees the
respective queue_id to be used again when another queue is created.

int32 OS_QueueGet ( uint32 queue_id, void *data, uint32 size, uint32 *size_copied, int32 timeout)
This function is used to retrieve a data item from an existing queue. The queue can be
checked, pended on, or pended on with a timeout.

int32 OS_QueuePut ( uint32 queue_id, void *data, uint32 size, uint32 flags)
This function is used to send data on an existing queue. The flags can be used to specify
the behavior of the queue if it is full.

int32 OS_QueueGetIdByName (uint32 *queue_id, const char *queue_name)
This function takes a queue name and looks for a valid queue with this name and returns
the id of that queue.

int32 OS_QueueGetInfo (uint32 queue_id, OS_queue_prop_t *queue_prop)
This function takes queue_id, and looks it up in the OS table. It puts all of the
information known about that queue into a structure pointer to by queue_prop.

oscore test segfaults on task creation

The problem begins in UT_os_task_create_test. See log output.

=== Testing task ===

=== Testing create ===
Starting GenericTask: Create_NotImpl, id: 5
Starting GenericTask: , id: 6
Starting GenericTask: , id: 7
Starting GenericTask: , id: 8
Starting GenericTask: , id: 9
Starting GenericTask: , id: 10
Starting GenericTask: , id: 11
Starting GenericTask: , id: 12
Starting GenericTask: , id: 13
Starting GenericTask: , id: 14
Starting GenericTask: , id: 15
Starting GenericTask: , id: 16
Starting GenericTask: , id: 17
Starting GenericTask: , id: 18
Starting GenericTask: , id: 19
Starting GenericTask: , id: 20
Starting GenericTask: , id: 21
Starting GenericTask: , id: 22
Starting GenericTask: , id: 23
Starting GenericTask: , id: 24
Starting GenericTask: , id: 25
Starting GenericTask: , id: 26
Starting GenericTask: , id: 27
Starting GenericTask: , id: 28
Starting GenericTask: , id: 29
Starting GenericTask: , id: 30
Starting GenericTask: , id: 31
Starting GenericTask: , id: 32
Starting GenericTask: , id: 33
Starting GenericTask: , id: 34
Starting GenericTask: , id: 35
Starting GenericTask: , id: 36
Starting GenericTask: , id: 37
Starting GenericTask: , id: 38
Starting GenericTask: , id: 39
Starting GenericTask: , id: 40
Starting GenericTask: , id: 41
Starting GenericTask: , id: 42
Starting GenericTask: , id: 43
Starting GenericTask: , id: 44
Starting GenericTask: , id: 45
Starting GenericTask: , id: 46
Starting GenericTask: , id: 47
Starting GenericTask: , id: 48
Starting GenericTask: , id: 49
Starting GenericTask: , id: 50
Starting GenericTask: , id: 51
Starting GenericTask: , id: 52
Starting GenericTask: , id: 53
Starting GenericTask: , id: 54
Starting GenericTask: , id: 55
Starting GenericTask: , id: 56
Starting GenericTask: , id: 57
Starting GenericTask: , id: 58
Starting GenericTask: , id: 59
Starting GenericTask: , id: 60
Starting GenericTask: , id: 61
Starting GenericTask: , id: 62
Starting GenericTask: , id: 63
Starting GenericTask: , id: 64
Starting GenericTask: , id: 65
Starting GenericTask: , id: 66
Starting GenericTask: , id: 67
Starting GenericTask: , id: 68
Starting GenericTask: , id: 69
Starting GenericTask: CREATE_TASK64, id: 70


General registers-> EAX: 0, EBX: 3, ECX: 3dd3ad90, EDX: 8
Segment registers-> CS: 1b, DS: 23, ES: 23, FS: 23, GS: 33, SS: 23
Index registers-> ESI: 0, EDI: 0, EIP: 4081187b, ESP: 41c75e98, EBP: 41c75ec0
Indicator-> EFLAGS: 3202
(Exception Error Code-> ORIG_AX: 4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.