Fix #945, shell implementation on posix and rtems #946
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe the contribution
Fix #945
Due to other changes the shell implementation on RTEMS and POSIX failed to build under certain configurations.
active_id
field was not valid. Using the existingOS_CloseAllFiles()
function does what is needed here and is much simpler.For now, the broken impl file is simply deleted, and RTEMS will always use
os-impl-no-shell.c
. In a future version, the implementation can be fixed properly.Testing performed
Build POSIX and RTEMS with shell enabled (OSAL_CONFIG_INCLUDE_SHELL=true)
Run "shell-test" and confirm behavior on POSIX (passes) and RTEMS (skips)
(Note that CFE does not directly use the OSAL shell function, but apps might; it is optional)
Expected behavior changes
Broken code is removed, so OSAL builds with
OSAL_CONFIG_INCLUDE_SHELL=true
on all platforms, but RTEMS will still result in OS_ERR_NOT_IMPLEMENTED always.System(s) tested on
Ubuntu 20.04 (native)
RTEMS 4.11.3
Additional context
I briefly investigated what it would take to fix this on RTEMS properly. The issue is that the
rtems_shell_init()
function attaches to a "device name" (typically /dev/console for interactive use), not individual input/output file descriptors. So it appears to be a matter of creating a pseudoterminal-type device that "reads" from the script and writes to the file. But it also appeared this was an area that changed a fair bit in RTEMS between 4.11 and 5.x release, so any solution would be unlikely to work on both, and this is why I decided its probably not worth pursuing for now. (a stakeholder who wants the shell to work on RTEMS can always re-implement).But since the existing code in
os-impl-shell.c
was very broken, it is just removed (not even useful as a basis for future; better to use posix or vxworks as basis instead).Contributor Info - All information REQUIRED for consideration of pull request
Joseph Hickey, Vantage Systems, Inc.