Giter Site home page Giter Site logo

0x50f13 / gumos Goto Github PK

View Code? Open in Web Editor NEW
3.0 6.0 1.0 21.62 MB

Not a real operating system, but a wrapper on FreeRTOS and M5Stack

License: MIT License

C++ 8.68% C 90.43% Lua 0.01% Makefile 0.89%
m5stack freertos freertos-task operating-system esp32 esp32-idf espressif platformio ramfs gui wrapper lua lua-script

gumos's Introduction

GumOS

WORK IN PROGRESS
Not a real operating system, but a wrapper on FreeRTOS and M5Stack. Will support lua script for M5Stack(currently lua does not support drawing and working with hardware – writing library implementing all of those is still to be done)

Notice

GUI is not yet ready. Also I have no idea why git don't want to add ramfs folder completely and adds only logo.

Modules

As I don't know how to implement dynamic loading on esp32 modules are currently hardcoded in src/kernel/kmodule.cpp

kconfig.h

This file stands for kernel configuration.

Parameter Description
KERENEL_VERSION Just kernel version.
KLOOP_SLEEP_MS Sleep time for kernel loop( located in kstart(void) src/kernel/kernel.cpp )
ARRAY_CAPACITY Default capacity for array capacity(see src/kernel/types/array.h)
HASHTABLE_CAPACITY Default capacity for array capacity(see src/kernel/types/hashtable.h)
TASK_STACK_DEPTH Max stack depth for FreeRTOS task(see https://www.freertos.org/a00125.html)
TIMER_SLEEP_TIME Timer loop sleep time.
TIMER_PRIORITY Priority of timer task.
TIMER_INITIAL_TIME Initial UNIX time to set.(For precision could be double)
MICRORAMFS_SIZE microramfs maximum size.
MIN_FREE_HEAP This is sometimes useful to detect memory leaky. If free heap is less than MIN_FREE_HEAP then kernel will panic.
LOAD_GUI Set to 1 to enable GUI.
LOAD_POWERCTL Set to 1 to enable powerctl.
LOAD_SOUNDCTL Set to 1 to enable soundctl.
LOAD_HIDCTL Set to 1 to enable keyboard.
LOAD_AUTOSTART Set to 1 to load lua autorun

microramfs

Brief

microramfs is builtin virtual filesystem that store resources and some of sensors states. It has fixed maximum size and in case of exceeding this space you will get error 8 (see https://github.com/Andrewerr/GumOS/blob/master/src/kernel/error.h ).

Initialization

microramfs initializes from static array placed in src/kernel/microramfs/init.h. It could be generated from any folder with this tool.

Functions

Any function return int which is error code(0 means no error).
Each function accepts filesystem instance(microramfs *fs) as first parameter.

Function Description
create_file(microramfs *fs,char *path) Creates file with given path(path should include file name).
write_file(microramfs *fs,char *path,uint8_t *data, uint64_t sz) Write data to file(file will be truncated).sz is size of data
read_file(microramfs *fs,char *path, uint8_t **data, uint64_t *sz) Read data from file.
IMPORTANT:*data should be NULL before calling this function.
Size of read data will be written to sz
rm_file(microramfs *fs,char *path) Remove file by given path.
ls_dir(microramfs *fs, char *path, array_t **array) List dir and put all object instances to array
create_dir(microramfs *fs,char *path, char *name) Create directory with name in directory path

Not yet implemented

Following functions are not yet implemented(and even not added to headers): rm_dir, append_file

Credits

Bootlogo by RoundIcons
PlatformIO https://platformio.org
FreeRTOS https://www.freertos.org
m5stack https://github.com/m5stack/M5Stack

Opensource software licenses

Lua

Files:

src/lua

https://www.lua.org

Copyright © 1994–2019 Lua.org, PUC-Rio.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

TO-DO

A lot things to do.

  • Fix issues
  • Add network services
  • Add NTP syncrhonization
  • Add bluetooth connection to smartphone for syncing messages,notifications etc.
  • Make GUI
  • Add sleep mode
  • Add SDCard interface
  • Add updater
  • A lot more...

gumos's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

dedazamarks

gumos's Issues

kassert doesn't work correctly.

On failure instead of printing out the file and line and than killing kernel and all processes kassert still allows processes to work which leads to several time printing out and sometime even to FreeRTOS guru meditation. In fact kassert should do the following:

  • Switch to console mode
  • Kill all processes except self
  • Print error
  • Kill self

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.