Git Product home page Git Product logo

google / embedded-shell Goto Github PK

View Code? Open in Web Editor NEW
165.0 9.0 28.0 11.64 MB

UART based embedded shell for embedded systems. Intended to be used for learning, experimenting and diagnostics.

License: Apache License 2.0

Makefile 22.35% C 63.12% Assembly 5.79% Shell 8.74%
risc-v armv8 arm-assembly cortex-m shell bringup bootloader arm-architecture assembly linker gdb aarch64 riscv64 riscv32 embedded qemu nucleo-f401re tiva-c-series bare-metal baremetal

embedded-shell's Introduction

Important disclaimer:

This is not an officially supported Google product

Embedded Shell

A Terminal like interface over UART.

  • Targeted at embedded systems engineers and researchers who want to explore the hardware by writing small functions that can be triggered from a shell like interface.
  • A UART based shell that enables finer control of CPU by allowing functions to be exposed as commands to be triggered from the prompt.
  • Low memory footprint of < 4kB

this is a perfect tool for getting up and running with a new board in less than 1 hour.

Features:

  • Low footprint shell implementation.
  • Commands with same foot print as int main(int argc, char* argv[]){}
  • Export function as command using a macro (ADD_CMD() available in shell.h).
  • Supported Languages: C, C++ and Assembly.
  • Automatic source file discovery
    • .c, .cpp and .S source files in the Project and shell directory are automatically picked for compilation (No need to modify any Makefile. The build system automatically figrues the source files).
  • Automatic Header discovery.
    • location for .h and .hpp files is automatically passed to the compiler for header file lookup.

Supported Processors/Architectures

examples/ implements a hello world example for the processor variety listed below:

Architecture Processor Example Location Board
ARM v7 A-class 32 bit Cortex-a7 (quadcore) examples/emulation/armv7A-32-Rpi2 raspberry pi 2b (Emulated on Qemu)
ARM v8 A-class 32 bit Cortex-a53 examples/emulation/armv8A-32-RPi3b raspberry pi 3b (Emulated on Qemu)
ARM v7 M-class 32 bit Cortex-m3 examples/emulation/armv7M-32 mps2-an385 (Emulated on Qemu)
ARM v8 A-class 64 bit Cortex-a72 examples/emulation/armv8A-64 virt (Emulated on Qemu)
ARM v8 A-class 64 bit Cortex-a72 (quadcore) examples/emulation/armv8A-64-smp (multicore) virt (Emulated on Qemu)
ARM v8 M-class 32 bit Cortex-m33 (dualcore) examples/emulation/armv8M-32 (multicore) mps3-an524 (Emulated on Qemu)
RISC-V 64 bit rv64g examples/emulation/riscv-64 virt (Emulated on Qemu)
RISC-V 32 bit (RV32IMAC) SiFive E31 examples/physical/hifive hifive1-revb (Physical Board)
ARM v7 M-class 32 bit Cortex-m4 examples/physical/nucleo-f401re nucleo-f401re (Physical Board)
ARM v7 M-class 32 bit Cortex-m4 examples/physical/tiva-c tiva-c (Physical Board)

Quick Setup

Execute ./manage -s or .scripts/setup to install all the dependencies.

Quick Demo

Following is a run of example in examples/emulation/riscv-64

cd examples/emulation/riscv-64
make
make run

Qemu Demo

If you haven't done the Quick Setup as noted above, you'll need to install following utilities:

sudo apt install -y binutils make binutils-riscv64-linux-gnu gcc-riscv64-linux-gnu g++-riscv64-linux-gnu \
                    qemu-system-riscv64

wget -P ~ https://git.io/.gdbinit

pip3 install pygments

Further, gdb based debugging can also be done by running the following commands in two separate terminals:

make debug

and

make gdb

Qemu Debug

You should see similar output as in above visual.

Documentation

  • To be able to run all the example and create your own project follow the documentation in docs/.
  • It also provides details about the internal workings of shell and how to setup your own project.

Table of contents

Topic Description
How shell Works Explains the working of shell with a flowchart.
Running examples in example/ Guides on getting started with trying examples. Includes topics like -
- installing dependences
- qemu based targets
- physical board based targets
- debugging etc
Setting up new project Details on how to start setting up a new project.
Platform initialization and uart driver Details the implementation of the platform_init() and the relation to the uart driver.
Uart driver Describes implementation and constraint on the uart driver.
User Linker Scripts Guides on how a liner script should be written if the user wants to manually set the memory layout and do the code placement.

Contributing

Topic Description
Code of Conduct Guides on the conduct expected while making contributions.
Contributing Guidelines on how to contribute to the code on GitHub.

Source Code Headers

Every file containing source code must include copyright and license information. This is to help well-intentioned people avoid accidental copying that doesn't comply with the license.

Apache header:

Copyright 2021 Google LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

embedded-shell's People

Contributors

aneesh2312 avatar nisarg001 avatar streetdogg avatar therustyengineer avatar xray-bit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

embedded-shell's Issues

rv32-ima

Does it work for rv32-ima platform?

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.