GithubHelp home page GithubHelp logo

fritzprix / tachyos Goto Github PK

View Code? Open in Web Editor NEW
16.0 3.0 4.0 5.27 MB

Embedded OS for IoT

License: GNU Lesser General Public License v3.0

Makefile 0.03% C 5.46% Assembly 0.30% Dockerfile 0.01% C++ 94.20% Shell 0.01%
rtos arm-cortex-m0 arm-cortex-m4f arm-cortex-m3 microkernel embedded-systems operating-system

tachyos's Introduction

TachyOS

Build Status Codacy Badge

Note

This project is subjected to serious HOMEBREWING and still in INFANCY. So any experimental change can be made without any notice.

About

TachyOS is the RTOS based on microkernel architecture which includes only minimal components like thread / synchronization, memory management, inter-thread communication while supporting execution context / address space isolation(protection) and extensible modular interface. Name of this project comes from the hypothetical particle called 'tachyon' [t챈ki.�뭤], whose speed increases as its energy decreases theoretically, is thought to be the ideal of the real time application which runs in very constrained environment.

Motivation

  • Build modular architecture which supports both static linked(kernel mode) and dynamic-linked module(user mode).
  • Provides dynamic loading and dependency management of an application through network.
  • Provides secure runtime environment and fault isolation for user application using memory protection facility which is generally available in low-cost hardware.

Features

  • provide runtime scalablility with various dynamic modules. (Not Supported Yet)
  • Provides application loading and debugging over the network. (Not Supported Yet)
  • Provides autonomous dependency (dynamic module) management over the network. (Not Supported Yet)
  • Support multi-threading
    • The number of threads is limited only by available memory
    • Context-switch overhead is less than 5us in ARM CM4 (STM)
  • Preemptive scheduler with 6 execution priorities
  • Various lightweight synchronization
    • Monitor (mutex / condition variable)
    • Event (blocking pub / sub)
    • Semaphore
    • Barrier
  • Various Inter-thread communication
    • Message Queue
    • Mail Queue
  • HAL (as static module) [UART / I2C / SPI / TIMER / RTC / GPIO]

Target Supported

  • STM32F40x (ARM Cortex-M4)
  • STM32F41x (ARM Cortex-M4)
  • STM32F20x (ARM Cortex-M3)

Build Environment

project is developed with eclipse IDE with ARM Cross compile tool (toolchain and plugin)

  • arm gcc cross compiler link : [GCC ARM Embedded in Launchpad] (https://launchpad.net/gcc-arm-embedded)

    $ sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
    $ sudo apt-get update
    $ sudo apt-get install gcc-arm-embedded
  • Install clang to build dependent library

    make sure clang / llvm-ar command is available

    $ sudo apt-install clang
  • python2.7 & pip for configuration utility (jconfigpy)

    $ sudo apt-get install python-dev python-pip  
  • gnu arm eclipse plug-in (optional) link : [GNU ARM Eclipse Plug-ins ] (http://gnuarmeclipse.livius.net/blog/)

  • For Windows user, MinGW or Cygwin should be installed (might be included in GCC ARM toolchain installation)

Build in Ubuntu

  1. get source code from repository

    $ git clone https://github.com/fritzprix/TachyOS.git
    $ cd TachyOS
  2. initiate project configuration and make your own configuration

    $ make config
  3. or you can use predefined configuration

     $ make config ARCH=ARM DEFCONF=stm32f4_def.conf
  4. build project

    $ make all
  5. (Optional) if you want reconfigure project

    $ make config_clean

To-Do

  • Add SDIO HAL Implementation (~Apr.2016)
  • Add virtual file system (~May.2016)

License

LGPL V3.0

tachyos's People

Contributors

fritzprix avatar zhcubgvlqhnrlmnvbsak avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

tachyos's Issues

System Fault when optimization applied to compile

When -O1 flag used in compile, hardware fault arised.

  • occurrence : Supervisor call return of Idle Thread
  • detail :
    when stack frame of Supervisor call popped, program counter of stack is abnormal (NULL)

Message corrupted usging print_dbg()

printing debug log in fast loop causes corrupted message.
tested loop consists of led shift operation and yield(0) which means
yields CPU to another thread and wait ready queue immediately.
This is not reproduced in lower speed condition.

test code is as below

static DECLARE_THREADROUTINE(led_shifter)
{
    tch_hal_module_gpio_t* gpio = (tch_hal_module_gpio_t*) ctx->Module->request(MODULE_TYPE_GPIO);
    gpio_config_t iocfg;
    gpio->initCfg(&iocfg);
    iocfg.Mode = GPIO_Mode_OUT;
    iocfg.Otype = GPIO_Otype_PP;
    iocfg.PuPd = GPIO_PuPd_Float;
    iocfg.popt = ActOnSleep;
    tch_gpioHandle* handle = gpio->allocIo(ctx, tch_gpio5, (1 << 6 | 1 << 7),
            &iocfg, tchWaitForever);
    tch_bState led = bSet;
    uint32_t cnt = 0;
    while (TRUE) {
        handle->out(handle, 1 << 6, led);
        handle->out(handle, 1 << 7, led);
        led = !led;
        cnt++;
        print_dbg("Led Shifted  %d times\n\r",cnt++);
        ctx->Thread->yield(0);
    }
    return tchOK;
}

this is generated log file capture.txt

Bug - i2c write causes 'usagefault'

Usage fault is caused in I2C write operation which has been fine.

Usage fault is generated with INVSTATE flag set, which means EPSR is corrupted. any return from exception might be the cause of problem.

  • check any changes related to I2C or Event comparing to master branch (which is supposed to work correctly)

CI build failure due clang / llvm version specific suffix

clang / llvm has version suffix on the executable file name on docker base image (cbuild:0.0.1)

  1. migration base image of cbuild:0.0.1 from ubuntu16.04 -> 18.04
  2. installing clang / llvm and switch them with update alternative command

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.