KRNL - An Arduino Kernel

Last update: 250922 19:18:55

Browse files incl examples:

Src folder list: here

Download zipfile for install krnl/krnl.zip

Doxified krnl here: html/index.html

Github: https://github.com/jdn-aau/krnl

I have found it interesting to develop an open source realtime kernel (KRNL) for the Arduino platform:

  • open source

  • well suited for teaching

    • easy to read and understand source

    • priority to straight code instead insane optimization(which will make it nearly unreadable)

  • well suited for serious duties - but with no warranty what so ever

  • easy to use

    • just import library krnl and you are ready

  • automatic recognition of architeture

    • supports all atmega variants I have had available (168,328,1280,2560 - uno, duemillanove, mega 1280 and 2560)

  • Suited for scheduability test after RMA

    • Krnl traps miss of deadlines and issue a breakout to user space so ypu can trap

    • See html-w-examples for krnl code and examples (browse under files

Some characteristics:

  • preemptive scheduling

    • Basic heart beat at 1 kHz. KRNL can have heeartbeat in quants of milli seconds

    • krnl uses timer2 so PWM based on timer2 is not possible(you can change it)

    • static priority scheme

  • support task, semaphores, message queues

    • All elements shall be allocated prior to start of KeRNeL

  • support user ISRs and external interrupts

  • Directory krnl shall be within your libraries directory .. sketchbook/libraries

  • You have to restart your arduino environment

a small hello world example

See templates for a number of commented runable examples which illustrates very well different mockups.

Access to code

welcome

history

git clone https://github.com/jdn-aau/krnl.git
  • ( 2018 added immediate ceiling protocol on semaphores (version 20180313)

  • ( updated june 2015 with new features for handling tight fixed frequency execution)

krnl consists of two files krnl.h and krnl.cpp which you shall save in directory sketchbook/libraries/krnl

Src folder list: here

or click here - beware wuite many lines of code

(click for krnl.h code)