A real-time operating system for Patmos