416 Commits
Author SHA1 Message Date
shuhua hua 124690270d shell: flashdev: close fds on allocation failure 2026-09-25 02:05:33 +00:00
Joel Sherrill 22b3389e26 cpukit/libmisc/shell/main_mdump.c: Use uintptr_t to print address
The behavior of the %p printf() specifier is implementation
dependent. The behavior varies on RTEMS between printf() and
printk(). This change prints an address as a uintptr_t to
ensure formatting is consistent. It also adjusts the output
width based on target architecture pointer size.

Updates rtems/docs/rtems-docs#163
2026-09-18 09:26:23 +10:00
Sebastian Huber 3b061c5c44 cpukit/libmisc: Write the Doxygen briefs
The briefs of the libmisc files named a topic, not the content of the
file.  Four shell briefs named the wrong command.  The file
main_blksync.c said "RM Shell Command Implementation".  The files
main_id.c, main_time.c and shellconfig.c named ls and debugrfs.  Four
string conversion sources named the conversion, for example "Convert
String to Unsigned Long".

Write every brief in the style of the tree.  A source brief starts with
"This source file contains".  A command brief names the command the file
provides.  A header brief starts with "This header file provides".  Put
@file, @ingroup and @brief in this order in every block.

Updates #5717.

Assisted-by: Claude:claude-opus-5 claude-code
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-09-01 20:17:20 +00:00
Sebastian Huber b6200fc946 cpukit/libmisc/shell: Add the Doxygen file headers
Fifty-five shell files had no Doxygen block.  Seventeen of them hold a
command and 38 hold the imported utility code the commands use.  Doxygen
listed none of them.

Give each file a block with @file, @ingroup and @brief.  The brief names
the command or the utility the file provides.

Every file in cpukit outside contrib has a Doxygen block.  The block of
cfsetspeed.c does not open with two asterisks.  The next commit repairs
it.

Updates #5717.

Assisted-by: Claude:claude-opus-5 claude-code
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-09-01 20:17:20 +00:00
Sebastian Huber 2ac6ce0f41 cpukit/libmisc/shell: Group the files
Two of the 124 shell sources named a group.  The other 122 gave Doxygen
no place to file them, so the shell groups listed two files.

Point each command at RTEMSImplShellCommands and each infrastructure
file at RTEMSImplShell.  The imported utility code joins
RTEMSImplShellUtilities.

Fifty-five files still have no Doxygen block.  Most of them hold the
imported utility code.  A later commit adds the blocks.

Updates #5717.

Assisted-by: Claude:claude-opus-5 claude-code
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-09-01 20:17:20 +00:00
Sebastian Huber b2cf56b7b8 cpukit: Fix the last undefined group names
Five files named a group which no file defines.  The names
RTEMSLibdebugger, Flash, RTEMSGenericIODevAPI and SPIBus had no
definition.  One shell command left the @ingroup argument empty.

Point each file at the group which covers it.  The headers flashdev.h
and iodev.h define a group of their own, so they name it.

Only the two C++ headers still name an undefined group.

Updates #5717.

Assisted-by: Claude:claude-opus-5 claude-code
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-09-01 20:17:20 +00:00
Sebastian Huber 1f79c2d7ef cpukit/libfs: Fix the file system groups
Six group names in libfs reached no group.  The names libfs_msdos,
libfs_dosfs, FatFS and LibFSIMFS had no definition.  The groups
libfs_ff and libfs_ffo had a definition with no parent.  Nineteen files
in defaults wrote the group title after the group name, so Doxygen
looked for the groups File, System and Operations as well.

Point the DOS file system files at DOSFS and delete the two dead group
definitions in dosfs.  Point the FatFS files at RTEMSImplFATFS and
imfs_init.c at IMFS.  Drop the group title from the @ingroup lines in
defaults.

The file ioman.c implements rtems_io_register_name(), so it joins
RTEMSImplClassicIO with the other I/O manager directives.  The file
imfs_eval_devfs.c joins IMFS with its neighbour imfs_eval.c.

Updates #5717.

Assisted-by: Claude:claude-opus-5 claude-code
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-09-01 20:17:20 +00:00
Sebastian Huber 7c937096c7 cpukit: Add missing implementation groups
Eight components had no Doxygen group.  Their files could not join a
group which reaches RTEMSImpl:

  - the PCI bus support
  - the driver manager
  - the debugger server
  - the trace buffer generator support
  - the monitor
  - the capture engine
  - the FTP daemon
  - the shell

The header rtems-trace-buffer-vars.h also named the group Shell, which
no file defines.

Define one group for each component.  Give the shell two subgroups, one
for the commands and one for the utility code which the commands use.
Point rtems-trace-buffer-vars.h at RTEMSImplTrace.

The other files join these groups in later commits.

Updates #5717.

Assisted-by: Claude:claude-opus-5 claude-code
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-09-01 20:17:20 +00:00
Chris Johns 3a30552451 cpukit/shell: Add prio command to print all priorities for all threads
This command is useful on system that have POSIX and classic threads
running together.

Closes #5732
2026-08-27 12:14:28 +10:00
Mohamed Ayman 181e86a199 Fix_Issue_1828: Respect forever flag on failed login
The shell main loop used a single result variable both to record whether
the previous login/command attempt succeeded and to decide whether
the loop should continue.

When the login function failed after repeated incorrect passwords,
result became false, and the loop condition then exited the shell
regardless of the forever flag being set.

Track login failures separately with a new login_failed flag,
and use it alongside result in the loop condition so that
a failed login correctly falls through to a new login attempt when
forever is set, matching the documented behavior of that flag.
Other exit paths EOF, explicit logout and exit are unaffected.
2026-08-20 18:32:26 -05:00
Chris Johns 2c39475802 libmisc/shell: Add -a to print all vars in the shell getenv command
Closes #5572
2026-05-16 09:40:59 +10:00
Joel Sherrill 211acc10da cpukit/shell/edit: Address -Wsign-compare warnings
This warning occurs when comparing a signed variable to an unsigned one.
This is frequently an int or ssize_t variable compared to a uint32_t or
size_t. Sometimes the size_t is from a sizeof() use.
2026-01-28 13:19:23 -06:00
Joel Sherrill 63c93acec1 cpukit/libmisc/shell/main_mknod.c: Address -Wclobbered warning
This warning indicates the potential for using a local variable which
is not guaranteed to be preserved across a setjmp()/longjmp() pair.
In this case, it was a false positive and the warning was disabled.

Updates #5364.
2026-01-23 17:43:20 -06:00
Joel Sherrill cc9aa4b748 ino_t printf() cases: Add PRIdinod_t for ino_t format specifier
The sizeof(ino_t) can potentially vary based on the target. This
resulted in -Wformat warnings. Add PRIdino_t in <rtems/inttypes.h>
to have a portable format specifier.

Closes #5393.
2025-12-04 18:41:19 -06:00
Joel Sherrill 3c2592be04 cpukit/libmisc/shell: Correct comparisons of different signedness
The GCC warning -Wsign-compare flagged these instances of comparing
signed and unsigned types. A common pair was size_t and int.
2025-12-04 18:46:23 -05:00
Joel Sherrill f6c6b309eb cpukit/libmisc/shell/main_pci.c: Add field in shell_pci_modifier table
This file had a table supporting the command line options.

Updates #5325.
2025-10-14 14:23:59 -05:00
Joel Sherrill f519633d0d cpukit/.../shell: Address missing field initializer warnings
Address missing field initializer warnings.

These were all rtems_shell_cmd_t or rtems_shell_alias_t declarations
with initialization.  The initialization was changed to using named
fields.

Updates #5325.
2025-10-14 14:23:59 -05:00
Joel Sherrill 94d9749222 cpukit/libmisc/shell/*: Address unused parameter warnings
Add "(void) param;" annotation to address unused parameter warnings.
Found with GCC's warning -Wunused-paramter.
2025-09-26 22:38:34 +00:00
Joel Sherrill 788f4ee4b8 cpukit/libmisc/shell/hexdump-parse.c: Fix fall through warning
The case did not have a break because it was calling a function
which should have been marked as "__dead". It was calling a
function which was marked "__dead". Apparently the analysis
did not see through the extra layer.
2025-09-26 16:43:25 -05:00
Joel Sherrill 106363b29d cpukit/*: Correct implicit fallthrough warnings
Use RTEMS_FALL_THROUGH() to annotate case statements which
intentionally do not have a break statement.
2025-09-19 19:02:25 +00:00
Gedare Bloom 948bbec7f6 shell: add noreturn attribute to err.h 2025-09-18 14:14:15 -06:00
Aaron Nyholm f93f3b87c8 flashdev: Added missing copyright 2025-09-09 16:09:49 +00:00
Joel Sherrill 51a2ee5e33 cpukit/*: Add SPDX for RTEMS legacy license
These may still be relicensed but adding SPDX is needed.

Updates #4805.
2025-08-22 10:14:12 -05:00
Joel Sherrill ea86780bdf cpukit/libmisc: Move SPDX line to top of file
The RTEMS Software Engineering Guide specifies that the SPDX license
annotation shouldbe the first line of the file and not part of the
copyright/license comment block.
2025-08-11 19:06:32 +00:00
Amar Takhar 5fa8c7b52d readme: Add source locations for RTEMS Shell
If you have any ideas about the missing ones let us know.

This also reformats other areas using mdformat since it was used for the tables.
2025-08-01 09:10:55 +10:00
lei huang e1ce81a868 cpukit/shell: Fix NULL Pointer Dereference in Shell Memory Dump Commands 2025-07-15 19:05:58 -05:00
Joel Sherrill e255c2888a libnetwork references misc: Remove libnetwork references
The legacy network stack has been moved to a separate package.
Remove references to it in odd places.
2025-07-15 22:36:46 +00:00
Joel Sherrill 68baf9eead libmisc/shell/*: Relicense to 2-BSD
Many files in this directory were by persons and organizations
that have previously given relicensing permission. git history
was used to confirm authorship and contributions on files which
had unclear or missing copyrights.

Update #3053.
2025-03-01 20:21:56 +00:00
Gedare Bloom 0149e6e749 spdx: add 2-BSD SPDX tags on relicensed files
Updates the recently merged relicensed files with the 2-Clause BSD
SPDX annotation.

Closes #5208.
2025-03-01 04:14:54 +00:00
Gedare Bloom 8e6ded473c rtems: update licenses to 2BSD
This is an update of many lingering embedded brains GmbH licenses from
the RTEMS License to the 2-BSD license where possible depending on the
joint copyrights.

Updates #3053.
2025-02-10 15:44:09 +00:00
Gedare Bloom 23fa41ecae cpukit: relicense shell and telnetd files
These files are mostly authored by Fernando Ruiz Casas.

Updates #3053.
2025-02-07 15:01:13 +00:00
Kinsey Moore ea9ae3445d cpukit/shell: Improve medit documentation
The error message produced by attempting to use a large value as the
data to be written can be nonsensical for some inputs. This updates the
error message and the usage text to make expectations more clear.

Closes #2147
2025-02-07 00:31:40 +00:00
yang.zhang 6f604aec83 libmisc/shell: Only restore terminal settings on exit when captured
Signed-off-by: yang.zhang <zhangyang01@kylinos.cn>
2024-11-15 00:35:26 +00:00
Aaron Nyholm 87c725b6ed flashdev: Add sector IOCTLs
Added new IOCTLs to flashdev to get sector info.
Updated flashdev shell command and flashdev test with new IOCTLs.
2024-11-06 22:35:20 +00:00
Chris Johns a1c3d4ba8e version: Add the release label interfaces
- Mark the VC key interfaces as deprecated in doxygen

Updates #5037
2024-10-30 22:40:15 +00:00
Kinsey Moore d0e9ec85b0 cpukit/libmisc/shell: Remove shell prompt carriage return
This removes the carriage return printed before the shell prompt as it
can cause other output to be overwritten unexpectedly. This was
discovered when using the "cat" shell command on a file whose content
contained no trailing \n\r and was short enough to be entirely swallowed
by the prompt.
2024-10-25 02:44:37 +00:00
shuhua hua bcd4b83e16 Ignore empty user names as input
* To unify the surrounding coding style
2024-10-15 13:11:42 +00:00
zhengxiaojun 29a0d99bfd cpukit/libmisc/shell:fix command df overflow
- change type unsigned to uint64_t, it might overflowed if
    the size is greater the 4GB.
  - increase buffer size is to eliminate the compiler's warning
    that the buffer might be too small
2024-09-13 21:30:43 +00:00
Sebastian Huber a9bff015f6 stackchk: Avoid implementation header in API
Update #5047.
2024-09-12 02:26:15 +00:00
Amar Takhar 3139d38137 cpukit: Convert cpukit/*/README to MarkDown
There are a lot of README files this is just a cursory glance to convert but
will render fine online.  If they don't we can make changes.
2024-08-05 21:37:12 +00:00
Kinsey Moore 174b69afd6 cpukit/shell: Add window size retrieval control
This adds an environment variable that can be used to enable or disable
window size retrieval for the RTEMS shell. This will also disable window
size retrieval upon failure while allowing the user to re-enable it.
2024-07-18 00:10:15 +00:00
Kinsey Moore 8eb4932b13 cpukit/shell: Account for tick rate in timeouts
On systems that don't provide a proper terminal or have broken window
size detection, the RTEMS shell can take a long time execute commands if
the kernel tick interval is longer than 1ms. This updates the shell
window size retrieval timeout code to account for the kernel tick
interval bringing the experienced timeout from 12.5ms to 1.25ms when
using the default kernel tick interval (10ms).
2024-07-18 00:10:15 +00:00
Aaron Nyholm 7bfe79c44d libmisc/shell: Improve print messages for flashdev command 2024-06-10 17:58:00 +00:00
Chris Johns 7260887fa9 libmisc/shell: Work around tmux bug in row and column
- Extend the timeout to 150 msec for long remote sessions

- Improve the performance of the detection

Closes #4975
Closes #4977
2023-12-13 18:13:16 +11:00
Sebastian Huber bcef89f236 Update company name
The embedded brains GmbH & Co. KG is the legal successor of embedded
brains GmbH.
2023-05-20 11:05:26 +02:00
Aaron Nyholm c2913ec414 libmisc/shell: Fix file pointer leak and improved input data sanitation.
Coverity #1530126
Coverity #1530125
2023-05-17 13:41:44 -05:00
Aaron Nyholm 984693a4b3 libmisc/shell: Add flashdev command 2023-05-16 12:48:18 +10:00
zack 809e34e527 libmisc/shell/main_edit.c: User cannot cut using ctrl e and x
Closes #4557
2023-02-15 15:16:37 -06:00
Joel Sherrill 26e1610833 shell/main_pci.c: Address Dereference after null error check
Coverity CID 1399716

Closes #431.
2023-02-10 07:55:17 -06:00
Chris Johns edea93c40b libmisc/shell/edit: Return if no memory in move_gap
Closes #4835
2023-01-31 07:16:14 +11:00