CM0508 Real-time operating systems and concurrency
This module introduces the application and implementation of real-time
operating systems and the use of concurrency in programming small
embedded systems. It presents fundamental
concepts: processes, communication
and synchronisation, and illustrates their implementation
using a modern, standards-compliant RTOS. Students are given the
opportunity to apply an RTOS in their own programs to solve a variety
of problems.
Lectures are the main vehicle for introducing fundamental concepts and
principles and for providing context and motivation. Students will be
expected to prepare for lecture topics and deepen their understanding
of course material by studying course texts and technical
literature. Seminars and laboratory sessions support the lecture
programme by providing students with opportunities to identify and
apply appropriate techniques for the application and implementation of
a variety of RTOS services.
Formative assessment will be provided in the form of small weekly
exercises, mainly practical in nature and involving
programming. Summative assessment is by way of course work undertaken
in the last 4/5 weeks of the module. Students will be required to
implement a simple embedded application, making use of a real-time
operating system, and to report on issues raised by their work.
The principles and techniques taught in this module
complement those treated in CM0506 Small Embedded Systems and are used
extensively in the level 6 modules CM0605 Embedded Systems Engineering
and CM0034 Industrial Case Project.
Module Team
- Module tutor
- Michael Brockway
- Lecturer
- David Kendall
Teaching Arrangements
Lecture Mon 11.00 - 12.00 EB A108
Lab/Seminar Mon 17.00 - 18.00 PB F1
Lab/Seminar Thu 13.00 - 14.00 PB F1
You should attend the lecture session and one of the lab/seminar sessions every week.
Synopsis
The aim of this module is to provide students with an understanding of the application and implementation of real-time operating systems. Students will be able to develop small, embedded systems using a variety of RTOS services, including multi-tasking, synchronisation, communication and timing. A practical approach is taken throughout and assessment is by course work.
On completion of this module, students will be able to:
- Describe the architecture of a typical RTOS, explain its services and evaluate the advantages and disadvantages of its use in a variety of embedded system scenarios.
- Discuss the task model and scheduling services provided by an RTOS and reason informally about the behaviour of a multi-tasking system under a variety of scheduling algorithms.
- Explain the application and implementation of basic RTOS services for task synchronisation, inter-task communication and event timing.
- Apply their knowledge of task management, synchronisation, communication and timing services in designing and building a small multi-tasking embedded system that makes use of a simple RTOS.
Teaching Plan
The following is a provisional guide to the organisation of this part of the module for this year. These arrangements are subject to change during the course of the module.
| Week | W/c | Lecture | Practical |
|---|---|---|---|
| 1 | 27-Sep | Introduction to real-time, operating systems, and real-time operating systems. [Slides] | Introduction/review of development tools/environment. A simple device driver 1: LED driver. C programming exercises. [Lab] |
| 2 | 04-Oct | The process model. Interrupts and Interrupt Service Routines (ISR). [Slides] | A simple device driver 2: Joystick driver. C programming exercises. [Lab] |
| 3 | 11-Oct | Interrupts, Vectored Interrupt Controller (VIC), ISR implementation [Slides] | A timer interrupt and timer ISR. [Lab] |
| 4 | 18-Oct | Introduction to ucOS-II: multi-tasking, delays [Slides] | Task management and delays in uC/OS-II [Lab] |
| 5 | 25-Oct | Shared variable IPC; interference; race conditions [Slides] | More task managment and delay in uC/OS-II [Lab] |
| 6 | 01-Nov | Mutual exclusion algorithms: Dekker, Peterson. Deadlock. Starvation. [Slides] | C programming problems [Lab] |
| 7 | 08-Nov | Semaphores and mutexes. [Slides] | Introduction to the assignment. Semaphores/mutexes lab. [Lab] |
| 8 | 15-Nov | Event flags, mailboxes and message queues. [Slides] | Solving communication and synchronisation problems with event flags, mailboxes and message queues. [Lab] |
| 9 | 22-Nov | The problem of priority inversion and some solutions. [Slides] | Assignment lab/surgery |
| 10 | 29-Nov | Memory management [Slides] | Assignment lab/surgery |
| 11 | 06-Dec | Review [Slides] | Assignment lab/surgery |
| 12 | 13-Dec | Assignment surgery | Assignment lab/surgery |
Assessment
Summative assessment comprises:
- a single course work assignment undertaken in the last 4/5 weeks of the module; students will be required to implement a simple embedded application, making use of a real-time operating system, and to report on issues raised by their work. [Assignment Specification]
Formative assessment comprises a variety of theoretical and practical exercises with opportunities for discussion with tutors and colleagues.
Feedback on formative assessment will be given during the seminar and laboratory sessions. Additionally the eLearning Portal will be used for more formal feedback on summative assessment.
Recommended Reading
There is no essential textbook for this module. [LAB08] gives full details of the uCOS-II RTOS used in the module but is too expensive to recommend for individual purchase. The other recommended books and papers give useful information on parts of the syllabus only.
-
Books
-
[DOW08]Downey, A.,
The Little Book of
Semaphores (Local
copy), Green Tea Press, 2002
A free text book by Allen Downey that introduces a variety of interesting synchronisation problems and their solution using semaphores. -
[LAB02]Labrosse, J.,
MicroC/OS-II The Real-Time Kernel (2nd edition), Newnes, 2002
A good textbook that gives a detailed account of (an earlier version of) the real-time operating system used in this module. Too expensive to buy outright but it would be a good idea to have access to it. The library has nine copies. It might cost about a tenner each between 3 or 4 of you to get hold of a copy. -
[WOL08]Wolf, W.,
Computers as Components: Principles of Embedded Computing System
Design, Morgan Kaufmann, 2008
Nice overview of interrupts in Chapter 3 and of RTOS in Chapter 6.
-
[DOW08]Downey, A.,
The Little Book of
Semaphores (Local
copy), Green Tea Press, 2002
-
Papers
- [SR04]Stankovic, J. and Rajkumar, R., Real-Time Operating Systems, Journal of Real-Time Systems, 28, 237-253, 2004
Resources
- IAR
- Micrium (site)
-
LPC2378
- Olimex LPC2378-STK Documentation for the Olimex development prototype board
- LPC2377_78 Product Specification (external)
- LPC23xx User Manual (external)
- The Insider's Guide to the NXP LPC2300/2400 based Microcontrollers
- LPC2378 Errata Sheet (external)
-
Programming in C
-
[KOC04] Kochan, S.,
Programming in C, Sams, 2004
A gentle introduction to programming in C. I think it's a better starting point than the much-recommended Kernighan and Ritchie. -
[PRI02] Prinz, P.,
C Pocket Reference, O'Reilly, 2002
A concise C reference. Very cheap. Just over a fiver. I suggest you buy a copy and read it from cover to cover. - C Programming An online course on C Programming from the University of Strathclyde.
- Practical Programming in C A detailed introduction to C from the MIT Open Courseware catalogue. If you skip the material on data structures and concurrency, you're left with a good basic introduction to C. The data structures and concurrency sections cover more advanced material.
-
[KOC04] Kochan, S.,
Programming in C, Sams, 2004
-
Miscellaneous
- EE Times Embedded Design Centre for Electrical Engineers.
- Embedded Gurus A blog from a variety of experts on embedded software.
- The Ganssle Group Jack Ganssle's page has lots of useful embedded systems development information and links to other information sources.
- Sticky Bits Niall Cooling's blog on developing software for real-time and embedded systems.





