Close
0%
0%

NTIOS (Arduino OS)

An operating system for larger microcontrollers, like Teensy 4.0, ESP32, or Artemis

Similar projects worth following
This is the OS used in the most modern form of the #Arduino Desktop project I've worked on, and detailed some minor information about this project in a log there. This project is so large, and likely to be incorporated into so many other projects, that I thought it deserved to be called a project of its own.

This OS features a modular HAL, a built-in emulator for running user created programs, an assembler, some basic file encoding/decoding, fonts, password protection, and other random features. Due to all these features, it requires a large memory to run.

This project has existed since 2020 but was posted on Hackaday in 2024.

Overview

NTIOS can load programs from an SD card and run them, as well as provides an assembler and text editor that allows these programs to be written on the system.  This is done through an emulator, which runs an architecture I designed to run fast on emulators.  It also provides a bunch of useful APIs for the Arduino script that hosts it.  I'm still working on running it outside of Arduino, as a lot of libraries are still used to make it work, but I've made some progress on that front.

NTIOS has a lot of features, some of them are sort of random or niche:

  • Basic hardware abstraction layer, drivers can be initialized after the system starts
  • Drivers for many different devices, including displays, CTP controllers, sensors, GPS, etc - many of which can be initialized from the system CLI shell
  • Software framework for GUIs and visuals
  • Detects and controls the CPU frequency on Teensy 4.x
  • CPU architecture detection via macros for a few architectures, including Xtensa, various ARM architectures, and Teensy 4
  • Built-in shell with useful functions for file manipulation, and even a text editor if you are on a graphical terminal
  • Some file encoders/decoders for WAV and BMPs, also a simple compressed audio format I made up
  • Code for PID loops and Kalman-filter based sensor fusion, which can be inserted into the HAL if I remember correctly
  • Built in pixel font for graphical displays
  • Configurable graphical keyboard for touch displays

It is generally tailored for portable devices and a lesser extent for robotics.  A lot of this could be bloatware for certain applications, so I think at some point the different parts should be separated into modules that are inserted at compile time, instead of keeping everything loaded at once.  A tablet doesn't need code for PID loops, for example.

This OS was created as a sort of development environment for various ideas.  It's been used in a few portable device prototypes of mine, as well as other random stuff.  That's why it has such diverse and specific features.

Driver List

Here's a list of the drivers I've written or worked on for the system, with notes indicating if it's unfinished:

  • BNO055 IMU
  • GT911 Capacitive Touch Controller
  • FT5436 Capacitive Touch Controller
  • ILI9481 LCD Screen Controller
  • NMEA GPS
  • MCP23017 GPIO Expander
  • AT command cellular driver (not well tested)
  • RA8875 Driver (probably needs some work, not sure what the state is)

Progress

I've been working on adding some other features, which do not quite work yet:

  • PNG decoding
  • Loading ELF files and running them in the OS's environment (ie, natively running applications instead of running through an emulator)
  • RA8875 driver still needs some work I think, need to test it

I need to make some standard graphical shell for this OS, as of right now there is no good way to use it via touchscreen or keyboard/mouse.  That would need to be a different sort of 'package' from the OS, so there isn't a graphical shell bloating the base OS.

Also, as previously mentioned, I think a separation of the OS into different modules would be useful, so a reduced form of it can easily be compiled.

Supported Devices

I know it works with ESP32, Artemis, and Teensy 4.0.  I would expect that it works with many other devices and architectures on Arduino, I just haven't tried others yet.

Integration with Processors

The OS is a git repo to be inserted in the sketch's 'src' directory.  Since the OS's repo cannot contain drivers for every interface on every processor, it is up to the sketch to extend some of the HAL base classes and add them to the device list.  From there the other drivers can be attached to the base hardware drivers.  For example, on Teensy there is a TeensySPIPort class, which provides the OS with access to the SPI bus.  From here the OS's included drivers can use the bus in a modular way.  The only other required steps are OS initialization, and starting any shell code or intended application code:

/*
 * This function sets...
Read more »

  • Improved Text Editor

    Dylan Brophy08/16/2024 at 21:22 0 comments

    This OS already has an older text editor, but its fairly minimalist and simple.  I needed a new text editor with more features.  Here's what I've got so far:

    So far I've got edit history for undo/redo, and the basic editing features that a text editor needs.  The font needs some work, and this program also needs to be finished (I can save but not exit XD), but at this point the program actually seems practical to use.  In fact, I used it to write some plans this morning, just as a good test.  And now I have notes stored on my Teensy 4.1 computer :P

    For graphics I'm using the #RA8875 VGA card I built, which for the mostpart, is doing the job well.  This is certainly a much nicer and larger screen than I've been used to with Arduino-baded computers I built in the past. The source code is available on my gitlab server:  https://git.nuclaer-servers.com/Nuclaer/teensy-ntios/-/tree/master/src (check the editor.cpp and editor.h files)

    This text editor will be an optional addition to the OS, as it requires much more features that make it take up a lot more space in code; a lot of applications don't need such a program.  Of course, for actually using a computer and administrating it, a decent text editor is critical.

View project log

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates