GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Vanderhell/microsh: Minimal debug shell for embedded systems written in portable C99, focused on zero-allocation command handling, UART-friendly input, and small deterministic firmware integrations.

BranchesTags
Open more actions menu

Latest commit

 

History

9 Commits
9 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
cmake
cmake
 
 
docs
docs
 
 
include
include
 
 
src
src
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CMakeLists.txt
CMakeLists.txt
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 

Repository files navigation

microsh

CI License: MIT

microsh is a small embedded shell library for byte-stream consoles such as UART, RTT, USB CDC, and test harnesses. It is written in strict C99, uses no dynamic allocation, and has no third-party runtime dependencies.

The current repository state is documented in docs/VERIFICATION.md. Releases are tag-based only; see CHANGELOG.md and .github/workflows/release.yml.

Highlights

  • Fixed-size command table with built-in help
  • argc/argv command handlers with quoted-argument support
  • Optional history and tab completion
  • Deterministic RAM use configured at compile time
  • CMake package export and install support
  • C and C++ consumer examples

Constraints

  • MSH_MAX_COMMANDS is the total slot count, including built-in help
  • User command capacity is MSH_MAX_COMMANDS - 1
  • Input is ASCII-oriented; there is no Unicode line-editing claim
  • msh_feed() is not ISR-safe or reentrant on a shared msh_t
  • Output callbacks are synchronous and receive borrowed strings that may be stack-backed

Minimal Example

#include "msh.h"

static void uart_print(const char *str, void *ctx) {
    (void)ctx;
    uart_write_blocking(str);
}

static int cmd_status(int argc, const char *const *argv, void *ctx) {
    (void)argc;
    (void)argv;
    (void)ctx;
    uart_write_blocking("ok\r\n");
    return 0;
}

static msh_t shell;

void shell_init(void) {
    msh_init(&shell, uart_print, NULL);
    msh_register(&shell, "status", "Show status", cmd_status);
    msh_prompt(&shell);
}

ISR Handoff Pattern

Do not call msh_feed() directly from an ISR. Push received bytes into a caller-owned ring buffer in the interrupt handler, then drain that buffer from the owning main loop or task:

void uart_rx_isr(void) {
    ring_push(&rx_ring, uart_read_byte());
}

void shell_poll(void) {
    uint8_t byte;
    while (ring_pop(&rx_ring, &byte)) {
        msh_feed(&shell, (char)byte);
    }
}

Build

CMake

cmake -S . -B build -DMICROSH_BUILD_TESTS=ON
cmake --build build
ctest --test-dir build

Makefile Test Path

cd tests
make

Documentation

  • docs/API_REFERENCE.md
  • docs/COOKBOOK.md
  • docs/DESIGN.md
  • docs/ISSUES.md
  • docs/PORTING_GUIDE.md
  • docs/VERIFICATION.md
  • CONTRIBUTING.md
  • SECURITY.md
  • CHANGELOG.md

Status

This repository contains the implementation, tests, packaging metadata, CI definitions, and documentation for a small embedded utility library. Verification evidence and any remaining gaps are tracked in docs/VERIFICATION.md.

About

Minimal debug shell for embedded systems written in portable C99, focused on zero-allocation command handling, UART-friendly input, and small deterministic firmware integrations.

Topics

bare-metalcc99clidebuggingembeddedfirmwarelibrarymicrocontrollershell3uartzero-allocation

Resources

Readme
MIT license

Contributing

Contributing

Security policy

Security policy
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.