Skip to content

Latest commit

 

History

History
66 lines (45 loc) · 2.25 KB

File metadata and controls

66 lines (45 loc) · 2.25 KB

Getting Started and Building

Requirements

  • GCC (or a compatible C99 compiler)
  • GNU Make
  • x86 Linux is required to run the demo, since it uses terminal raw mode (demo/x86-gcc)

After fetching the code

cd zoom-shell

Build the x86 demo

make demo
./build/zoom_shell_demo

The demo uses demo/x86-gcc/zoom_shell_cfg_user.h to override the default configuration and enables most features (including the extension modules). To exit, type exit or press Ctrl+D (depending on your terminal).

Run the automated tests

make test

The tests use test/zoom_shell_cfg_test.h, which is independent from the demo configuration. When everything passes, the process exits with code 0.

Note: if you encounter link errors after editing zoom_shell_cfg_user.h, run make clean first and then rebuild, so that every translation unit is recompiled with the new macros.

Directory layout (brief)

zoom-shell/
├── include/           # zoom_shell.h, zoom_shell_cfg.h
├── src/               # Core: core / cmds / var
├── extensions/        # Optional extensions (hexdump, log, calc, ai_bridge, ...)
├── demo/x86-gcc/      # PC terminal demo + link.lds
├── demo/stm32-freertos/ etc.   # Templates for other platforms
├── test/              # Unit tests
└── docs/              # Documentation (this directory)

Configuration

  1. Copy or take inspiration from demo/x86-gcc/zoom_shell_cfg_user.h to write your own zoom_shell_cfg_user.h.

  2. Define a macro at compile time so the config header is included:

    -DZOOM_SHELL_CFG_USER='"zoom_shell_cfg_user.h"'
  3. In zoom_shell_cfg_user.h, set ZOOM_CMD_MAX_LENGTH, ZOOM_GET_TICK(), and so on; toggle individual features with ZOOM_USING_* macros.

For more details, see the "Porting to your MCU" and "Linker script" sections of the main README.md; the extension list is in extensions_overview.md, and the general porting procedure is in porting_general.md.

Static library (optional)

make lib

This produces build/libzoomshell.a (the core plus the object files of each extension; the exact contents are defined by the Makefile).