DROSS

The Drogon Real-time Operating System (Simplified)

Firstly, DROSS is not really an operating system – the title makes it sound a lot grander than it really is…

However… I wrote it for a commercial project running on an ATmega processor to satisfy a need to get away from the existing “big loop” type of programmin style that people were doing on the Arduino, and I then later ported it to a PIC project I was working on.

DROSS is a set of library routines avalable under both the GPLv3 and a commercial use license.

DROSS and the supporting libraries are written entirely in C. There is no C++ code, nor any C++ support for DROSS.

The DROSS library includes:

  • A task scheduler. Tasks can be called at regular intervals from 1 millisecond upwards. Tasks are expected to run in under 1mS although one (just one!) event can over-run and will subsequently be pre-empted. The intention was that these tasks are able read/write hardware sensors, freeing up the main program (which is pre-emptivly interrupted by the tasks) to carry out its main task.

The tasks can be called at regular intervals, or they can self-schedule and say when they next want to be called.

Additionally, there is a system of co-routines too – this was developed for the PIC to overcome some of the limitations of SDCC not being able to handle re-entrant floating point code.

  • A replacement for the Arduino Wiring library

Written in C and some changes to make it more compatible for running in the DROSS environment. In particular one of the PWM channels is no-longer avalable due to DROSS itself needing one of the timers setup in a slightly different manner to the way the Arduino system does it.

  • Serial handling

Simplified but fully capable serial library utilising interrupts to send and receive data.

  • Interrupt driven analog port handling

The analog ports can be sampled via an interrupt driven task with the data being fed through a simple with low-pass filter.

  • 2-wire (I2C) driver code

A simplified interrrupt driven 2-wire/i2c driver for the ATmega – the driver runs the bus in master mode only.

Comments

DROSS — 7 Comments

    • Sorry – I’ve just had the time to get my act together on this. I need to tidy up the code, stick all the relevant GPLness on it and put it on the GIT – One of these days..

      -Gordon

    • Yes. I’m in the process of putting together some new code for the ATmega on the Gertboard for the Raspberry Pi – However even if you’re not got a Pi or a Gertboard, that’s OK as this is all command-line stuff and will work on an Arduino unchanged. Getting there, but it’ll be a few weeks though.

      -Gordon

    • Soon – (as always!) – I’m going to use it with some new stuff I’m writing for the ATmega on the Gertboard (raspberry pi interface board) and will be polishing it up & publishing it then. don’t get to oexcited though – its just a little task scheduller I wrote to help out on some projects I did a couple of years ago now..

      -Gordon