D0003E: Real-time Systems


Spring 2011
Old web page from 2010

News

News and updates will always be announced here, with latest news on topmost row:
2011-03-11Idag gick vi igenom en gammal tenta. Denna ligger inte uppe på gamla tentor på webben, men det kommer att fixas. Det ligger även en tenta från en annan kurs uppe; detta kommer också att fixas.
2011-03-07Som tidigare utannonserats så ställer vi in en av veckans föreläsningar (överbokat i schemat), nämligen den imorgon tisdag. Sista föreläsningen blir alltså fredag, då vi tar repetition och går igenom en gammal tenta.
2011-03-02Förtydligande om javas monitorer: Det är inte nödvändigt att använda monitorn för det objekt man deklaretat metoden i, utan det går bra att använda något annat objekts monitor också, detta görs då med synchronized(monitor) {}, där man kan specificera vilken monitor man vill använda. Det finns fortfarande dock bara en villkorsvariabel per monitor. Läs mer i kapitel 17 i java language specification. I paketet java.util.concurrent finns en uppsättning andra primitiv (t.ex. semaforer).
2011-03-01Föreläsning 13 uppdaterad (bilden om semaforer är tydligare).
2011-01-28Schemalänkarna är nu separerade i luleå och skellefteå.
2011-01-28Det är för tidigt! Föreläsning 4 uppdaterad (ingen ändring)...
2011-01-25Föreläsning 3 uppdaterad (rättat stav/språkfel).
2011-01-25Ljudproblemen till skellefteå är utredda och tros ha berott på påslagen mikrofon i skellefteå. Studion har framgångsrikt använts utan problem efter torsdagen och vi förväntar oss att det fungerar idag.
2011-01-24Ljudet till skellefteå funkade, som alla märkte, inte alls i fredags. Det är ingen större fara för kursinnehållet,  eftersom ni i skellefteå redan kan en del C. Det vore dock olyckligt om det funkar lika dåligt imorgon, då vi börjar med mer nytt material. Jag har lyft upp den här frågan till utbildningsledarna för att få det åtgärdat.
2011-01-21Föreläsning 2 uppdaterad (ingen förändring).
2011-01-18Föreläsning 1 uppdaterad!
2011-01-18Deadlines för labbarna uppdaterade!
2011-01-17 Välkomna allihopa till 2011 års kurs! Jag håller på att uppdatera webbsidan... det är inte riktigt klart ännu!

Lab results:

Lab results

Course aim

The aim of the course is to give competence in the development of real time systems in high level programming
languages, to discuss various models of synchronization and communication between concurrent processes in such
systems, and to study the characteristics of real time systems and their constructions.  The central concepts of the
course are concurrency - where programs are built using several concurrent threads of execution, reactivity  -
where external input is reacted to rather than requested, and real-time - where the timing behavior of a reactive
system is also of interest.

Course content

Concurrent Programming:
Reactive Programming:
Real Time Systems:
Course description from the course catalog

Course litterature

Alan Burns and Andy Wellings.
Real-Time Systems and Programming Languages.
Addison-Wesley, third edition, 2001.
ISBN: 0-201-72988-1.

Schedule

Schedule for luleå
Schedule for skellefteå

Lectures


Updated for 2011?

Recommended exercises
Lecture 1: 18/1
updated!Introduction to real-time systems and C slides (pdf)

Lecture 2: 21/1
updatedBit manipulation and hardware interfacing
slides (pdf)

Lecture 3: 25/1
updated!Concurrent threads and mutual exclusion
slides (pdf)

Lecture 4: 28/1
updated!The inner workings of a kernel
main slides (pdf), extra slides (pdf)

Lecture 5:
updated!Events, interrupts & reactions
slides (pdf)

Lecture 6:
updated!A model of reactive objects
slides (pdf)

Lecture 7:
updated!Continuation of lecture 6


Lecture 8:
updatedClocks, timers, and periodic execution slides (pdf)
Lecture 9:
updatedDeadlines and priorities slides (pdf), examples (pdf)

Lecture 10:
updatedScheduling and feasability slides (pdf) 13.1; 13.2; 13.3; 13.7; 13.9
Lecture 11:
updatedPriority Inversion slides (pdf)
Lecture 12:
updatedPOSIX threads slides (pdf)
Lecture 13:
updatedMore inter-process communication
slides (pdf)

Lecture 14:
not updatedReal-Time Languages and synchronization
slides(pdf)

Lecture 15:
not updatedRepeatiotion and infamous realtime systems
slides (pdf), infamous systems (pdf)

Lecture 16:
Spare



Examiner & lecturer

Fredrik Bengtsson
E-mail: bson@ltu.se
Office: A3308
Phone: 49 24 31

Lab supervisor

Pawel Pietrzak
E-mail: pawel.pietrzak@ltu.se

Lab assignments

Rules (Must read!)


It is very easy to get started with the new equipment. Just connect the AVR JTAG ICE programmer to the computer by USB and to the butterfly board with the flat cable. Programming is performed in "AVR Studio". You will probably need to select programming device from the dialog found in the menu "debug->select platform and device". AVR studio might ask you if tou want to update the firmware of the jtag-programmer. Select that you do want to update the firmware if asked. Be sure to work in your home directory and not on the local computer.

Lab 1: C programming on bare metal
deadline February, 2:nd, 24:00
Lab 2: A lightweight multi-threading kernel
deadline Febryary, 10:th, 24:00
Lab 3: A threaded reformulation of lab 1
deadline February, 21:th, 24:00
Lab 4: Dual pulse generators with a GUI
deadline Febryary, 28:th 24:00
Lab 5: Traffic light control and simulation
deadline Mars, 10:th 24:00
Extra: Lab 6: Commanding a robot
You will get 5% of total exam points added to your result on the exam.
deadline before exam

Target platform documentation

The AVR Butterfly User's Guide describes the features of the platform (an evaluation kit) in overall terms.

The ATmega169 datasheet gives detailed information about the microcontroller that powers the Butterfly board.

The AVR instruction set explains the assembly language instructions that the ATmega169 uses.

The AVR065 application note provides details about the LCD driver on the Butterfly board.

The ATmega32 datasheet gives detailed information about the microcontroller that powers the miniature robots.

The AVR-P40-USB notes provide an overview of the development circuit board on the miniature robots.

Target platform resources

Lawicel, online supplier of AVR Butterfly cards.

Software Crew, another AVR Butterfly supplier.

Smiley Micros, USA-based supplier of AVR material.

WinAVR, open source C cross-compiler, libraries and download utilities (for Windows).

AVR Studio, optional AVR integrated development environment for Windows that installs on top of WinAVR.

Darwinports avr-gcc, open source C cross-compiler, libraries and download utilities (MacOS X)

AVR freaks, miscellaneous AVR-related info.

Links to related information

Johan Nordlander, Programming with the TinyTimber kernel

POSIX Threads Programming,
Livermore Computer Traning,
Lawrence Livermore National Laboratory.

Ken Tindell & Hans Hansson,
Real-Time Systems by Fixed Priority Scheduling
Tech. report, Uppsala University, 1996.
Dave Marshall, Programming in C

Steve Holmes, C Programming

Steve Summit, C Programming Notes

Marshall Brain, How C Programming Works

Lee Tauck, C Tutorial

Mikael Sundström, Some C-tricks and Tips for Real-time Programming

Java and C Comparison Chart

The POSIX specification

POSIX in realtime

UnixWare 7 online manual pages

ANSI terminal control codes

Cygwin documentation

Ariane 5 Launch Failure

Apollo 11 Program Alarms

Mars Pathfinder Priority Inversion

Therac-25 Accidents