as a preemptive multitasking system for micro-controllers. Its probably one of the best known in the industry.
Here's the
Reference Manual for FreeRTOS.
But, while the industry is pushing to low power 32-bit and 64-bit processors, we're pushing on with 8-bit machines.
And FreeRTOS hasn't shown much love for 8-bit machines for some time, so let's pick up that baton for 8-bits...
So I've dredged the swamp of the Interwebs and, out of what I found, built a modern (v10.3.0) release of FreeRTOS for Z80.
At this stage there are only two targets supported, but because target or platform specific code is all in one file, it is pretty easy to support additional targets.
The two targets working are:
- SCZ180 (SC126 & SC130) on RomWBW HBIOS
- YAZ180 running as an application
FreeRTOS is present as a library in z88dk. As a library it can only run in one 64kB memory space, and doesn't support memory banking.
It is going to be useful where you need to manage a number simultaneous of tasks in parallel, rather than being considered an operating system (like FUZIX).
It is fully preemptive, running separate stacks for each Task, and it provides queues, semaphores, and event management for inter-Task communications.
As FreeRTOS is written in C, there are only a few architecture specifics that need to be adjusted, and they're mainly found in the
portmacro.h file. These architecture specifics are going to be the same for any Z80 machine.
All the target or platform specifics are in one file
FreeRTOSBoardDefs.h, and to add a new target just four macros need to be built...- configure the Timer and make sure the Timer ISR is always available
- reset / reload the Timer if needed (as on z180)
- manage Task switching to when vTaskSwitchContext() banked in.
- stop the Timer (not really necessary)
I've made some assumptions about how much of the FreeRTOS API should be available, and number of priorities, etc. They're in the
FreeRTOSConfig.h file, and can be adjusted (and the library rebuilt and installed) as desired.
If the header files are changed, then this should also be reflected in the z88dk headers, or use your own personal headers if preferred.
There's not a lot of testing been done on this yet, and I'm sure there'll still be things to fix and improve.
Enjoy,
Phillip