Implementation of Cyclic Executive

Slides:



Advertisements
Similar presentations
Chapter 3 Memory Management
Advertisements

Process management Information maintained by OS for process management  process context  process control block OS virtualization of CPU for each process.
HW/Study Guide. Synchronization Make sure you understand the HW problems!
ECE 493T9 Real Time Embedded System Tutorial Set 5 July 14, Spring 2008.
Real-Time Library: RTX
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 3 Memory Management Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
An introduction to: The uRT51 Microprocessor and Real-Time Programming Suite.
P449. p450 Figure 15-1 p451 Figure 15-2 p453 Figure 15-2a p453.
Lock Inference for Systems Software John Regehr Alastair Reid University of Utah March 17, 2003.
1 Virtual Memory Management B.Ramamurthy Chapter 10.
CprE 458/558: Real-Time Systems
Figure Figure 18-1 part 1 Figure 18-1 part 2.
External & internal Interrupts. Interrupt Sources There are 21 different interrupts and each one has its own vector located in a predefined location at.
EMBEDDED SOFTWARE Team victorious Team Victorious.
BINA RAMAMURTHY UNIVERSITY AT BUFFALO System Structure and Process Model 5/30/2013 Amrita-UB-MSES
Parallel Processing (CS526) Spring 2012(Week 8).  Thread Status.  Synchronization in Shared Memory Programming(Java threads ) ◦ Locks ◦ Barriars.
CORTEX-M0 Structure Discussion 2 – Core Peripherals
Event Driven Programming
CHAPTER 4 10/29/ RTS: Kernel Design and Cyclic Executives CE321-fall2013.
2 2009/10 Object Oriented Technology 1 Topic 2: Introduction to Object-Oriented Approach Reference: u Ch.16 Current Trends in System Development (Satzinger:
B. RAMAMURTHY Simulating Motion and Implementing Animation.
1 CS 501 Spring 2004 CS 501: Software Engineering Lecture 2 Software Processes.
Version 6.1 ICONICS World Wide Sales Conference 1998.
6/1/ More on Cyclic Executives Simple loop cyclic executive Frame/slots Table-based predetermined schedule cyclic executive Periodic, aperiodic and.
SE-3910 Real-time Systems Week 5, Class 2 – Lab turn-in page is up! – Use interrupts in a Linux/C environment – Scheduling – Watchdog follow-up Watchdog.
B. RAMAMURTHY 12/25/2015 Realtime System Fundamentals : Scheduling and Priority-based scheduling Pag e 1.
Real time scheduling G.Anuradha Ref:- Stallings. Real time computing Correctness of the system depends not only on the logical result of computation,
3/1/2016Page 1 Realtime System Fundamentals : Scheduling B. Ramamurthy.
Clock Driven Schedulers
Timers and Time Management Ok-Kyun Ha
Clock-Driven Scheduling (in-depth) Task Scheduler: i := 0; k := 0; BEGIN LOOP i := i+1; k:= i mod N; IF J(t k-1 )is empty THEN wakeup(aperiodic) ELSE wakeup(J(t.
Process Tables; Threads
Session 3 Memory Management
RTS: Kernel Design and Cyclic Executives
Elaine Cheong Yang Zhao December 8, 2001
Process Description and Control
Realtime System Fundamentals : Scheduling and Priority-based scheduling B. Ramamurthy cse321-fall2014 9/20/2018.
System Structure and Process Model
RTS: Kernel Design and Cyclic Executives
System Structure and Process Model
CMSC 341 Lecture 5 Stacks, Queues
System Structure B. Ramamurthy.
Realtime System Fundamentals : Scheduling and Priority-based scheduling B. Ramamurthy 11/22/2018.
2.1 Processes process = abstraction of a running program
Realtime System Fundamentals : Scheduling and Priority-based scheduling B. Ramamurthy cse321-fall /27/2018.
Clock-driven Static scheduling
Process Tables; Threads
RTS: Kernel Design 11/30/2018.
Clock-driven Static scheduling
Event Driven Programming
Clock-driven Static scheduling
PROCESS MANAGEMENT Information maintained by OS for process management
RTS: Kernel Design and Cyclic Executives
RTS: Kernel Design 1/2/2019.
RTS: Kernel Design and Cyclic Executives
Realtime System Fundamentals : Scheduling and Priority-based scheduling B. Ramamurthy Amrita-UB-MSES /11/2013.
Clock-driven Static scheduling
RTS: Kernel Design and Cyclic Executives
Process Control B.Ramamurthy 2/22/2019 B.Ramamurthy.
Chapter 8: Memory Management strategies
Practical Session 8, Memory Management 2
Unix Process Control B.Ramamurthy 4/11/2019 B.Ramamurthy.
Cyclic executives for Bare Hardware
Figure 9.1.
Process Description and Control in Unix
Real-Time Process Scheduling Concepts, Design and Implementations
Process Description and Control in Unix
Real-Time Process Scheduling Concepts, Design and Implementations
Practical Session 9, Memory Management continues
Presentation transcript:

Implementation of Cyclic Executive B. Ramamurthy

Cyclic Executive Design 1 (pages 81-87) Base tasks, clock tasks, interrupt tasks Base: no strict requirements, background activity Clock: periodic with fixed runtime Interrupt: event-driven preemption, rapid response but little processing Design the slots Table-driven cyclic executive 11/15/2018 CE321-fall2014

Cyclic executive Each task implemented as a function All tasks see global data and share them Cyclic executive for three priority level The execution sequence of tasks within a cyclic executive will NOT vary in any unpredictable manner (such as in a regular fully featured Operating Systems) Clock tasks, clock sched, base tasks, base sched, interrupt tasks Each clock slot executes, clock tasks, at the end a burn task that is usually the base task Study the figures in pages 83-86 of your text 11/15/2018 CE321-fall2014

RT Cyclic Executive Program Lets examine the code: Identify the tasks Identify the cyclic schedule specified in the form of a table Observe how the functions are specified as table entry Understand the scheduler is built-in Learn how the function in the table are dispatched 11/15/2018 CE321-fall2014

Task Specification to Cyclic Executive Transform into hyperperiod, frame, slots Design the cyclic executive Then cyclic executive can be implemented by a table-driven Or function-driven (simply a series of function calls). We will look at a table-driven implementation.

Implementation of a cyclic executive #include <stdio.h> #include <ctype.h> #include <unistd.h> #include <sys/times.h> #define SLOTX 4 #define CYCLEX 5 #define SLOT_T 5000 int tps,cycle=0,slot=0; clock_t now, then; struct tms n; void one() { printf("Task 1 running\n"); sleep(1); } void two() { printf("Task 2 running\n"); sleep(1); } 11/15/2018 CE321-fall2014

Implementation (contd.) void three() { printf("Task 3 running\n"); sleep(1); } void four() { printf("Task 4 running\n"); void five() { printf("Task 5 running\n"); 11/15/2018 CE321-fall2014

Implementation (contd.) void burn() { clock_t bstart = times(&n); while ((( now = times(&n)) - then) < SLOT_T * tps / 1000) { } printf (" brn time = %2.2dms\n\n", (times(&n)- bstart)*1000/tps); then = now; cycle = CYCLEX; } 11/15/2018 CE321-fall2014

Implementation (contd.) void (*ttable[SLOTX][CYCLEX])() = { {one, two, burn, burn, burn}, {one, three, four, burn, burn}, {one, five, four, burn, burn}}; main() { tps = sysconf(_SC_CLK_TCK); printf("clock ticks/sec = %d\n\n", tps); then = times(&n); while (1) { for (slot=0; slot <SLOTX; slot++) for (cycle=0; cycle<CYCLEX; cycle++) (*ttable[slot][cycle])(); }} 11/15/2018 CE321-fall2014

Summary The cyclic executive discussed the scheduler is built-in. You can also use clock ticks RTC etc to schedule the tasks In order use the cyclic executive discussed here in other applications simply change table configuration, and rewrite the dummy functions we used. 11/15/2018 CE321-fall2014