REAL TIME OPERATING SYSTEMS. Lesson-3:



Similar documents
The Real-Time Operating System ucos-ii

REAL TIME OPERATING SYSTEMS. Lesson-10:

PROGRAMMING CONCEPTS AND EMBEDDED PROGRAMMING IN C, C++ and JAVA: Lesson-4: Data Structures: Stacks

Lesson-16: Real time clock DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK

Operating Systems. Lecture 03. February 11, 2013

Operating Systems Concepts: Chapter 7: Scheduling Strategies

Processes and Non-Preemptive Scheduling. Otto J. Anshus

Real Time Programming: Concepts

Module 8. Industrial Embedded and Communication Systems. Version 2 EE IIT, Kharagpur 1

Comparing RTOS to Infinite Loop Designs

Embedded Systems. 6. Real-Time Operating Systems

Readings for this topic: Silberschatz/Galvin/Gagne Chapter 5

Page 1 of 5. IS 335: Information Technology in Business Lecture Outline Operating Systems

8. MicroC/OS-II Real-Time Operating System

Process Description and Control william stallings, maurizio pizzonia - sistemi operativi

快 速 porting μc/os-ii 及 driver 解 說

Thomas Fahrig Senior Developer Hypervisor Team. Hypervisor Architecture Terminology Goals Basics Details

Lecture 6: Interrupts. CSC 469H1F Fall 2006 Angela Demke Brown

CS414 SP 2007 Assignment 1

SYSTEM ecos Embedded Configurable Operating System

mailboxes and more...

mailboxes and more...

EE8205: Embedded Computer System Electrical and Computer Engineering, Ryerson University. Multitasking ARM-Applications with uvision and RTX

Priority Inversion Problem and Deadlock Situations

Computer-System Architecture

OPERATING SYSTEMS SCHEDULING

Jorix kernel: real-time scheduling

Linux Process Scheduling Policy

Aperiodic Task Scheduling

Tasks Schedule Analysis in RTAI/Linux-GPL

What is an RTOS? Introduction to Real-Time Operating Systems. So what is an RTOS?(contd)

Zing Vision. Answering your toughest production Java performance questions

Operating System: Scheduling

Deciding which process to run. (Deciding which thread to run) Deciding how long the chosen process can run

Introduction. Scheduling. Types of scheduling. The basics

Shared Address Space Computing: Programming

Priority Based Implementation in Pintos

White Paper Perceived Performance Tuning a system for what really matters

Scheduling 0 : Levels. High level scheduling: Medium level scheduling: Low level scheduling

Virtual machine CPU monitoring with Kernel Tracing

Operating Systems Lecture #6: Process Management

Implementing and Using Execution Time Clocks in Ada Hard Real-Time Applications

Operating System Manual. Realtime Communication System for netx. Kernel API Function Reference.

CPU SCHEDULING (CONT D) NESTED SCHEDULING FUNCTIONS

Real-Time Systems Prof. Dr. Rajib Mall Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Embedded Programming in C/C++: Lesson-1: Programming Elements and Programming in C

First-class User Level Threads

Design of Real-Time Software

1. Computer System Structure and Components

Operating Systems 4 th Class

Project 11: FreeRTOS TM Real-Time Control of a Stepper Motor

Debouncing Switches. Mechanical switches are one of the most common interfaces to a uc.

CS0206 OPERATING SYSTEMS Prerequisite CS0201, CS0203

ELEC 377. Operating Systems. Week 1 Class 3

Real-Time Operating Systems With Example PICOS18. What is an Operating System?

Road Map. Scheduling. Types of Scheduling. Scheduling. CPU Scheduling. Job Scheduling. Dickinson College Computer Science 354 Spring 2010.

Process definition Concurrency Process status Process attributes PROCESES 1.3

Chapter 10: Virtual Memory. Lesson 08: Demand Paging and Page Swapping

Red Hat Linux Internals

CSC 2405: Computer Systems II

Crazy Alarm Clock L A K S H M I M E Y Y A P P A N J A M E S K A Y E W I L L I A M D I E H L C O N G C H E N

Processor Scheduling. Queues Recall OS maintains various queues

USING THE FREERTOS REAL TIME KERNEL

Operating Systems. III. Scheduling.

Chapter 11: Input/Output Organisation. Lesson 06: Programmed IO

REAL TIME OPERATING SYSTEM PROGRAMMING-II: II: Windows CE, OSEK and Real time Linux. Lesson-12: Real Time Linux

Embedded Software development Process and Tools:

Linux Scheduler. Linux Scheduler

Lecture Outline Overview of real-time scheduling algorithms Outline relative strengths, weaknesses

REAL TIME OPERATING SYSTEMS. Lesson-18:

Introduction to Operating Systems. Perspective of the Computer. System Software. Indiana University Chen Yu

Lecture 3 Theoretical Foundations of RTOS

Objectives. Chapter 5: CPU Scheduling. CPU Scheduler. Non-preemptive and preemptive. Dispatcher. Alternating Sequence of CPU And I/O Bursts

CPU Scheduling. Core Definitions

Real- Time Scheduling

Timer A (0 and 1) and PWM EE3376

BLOCK OCCUPANCY DETECTOR WITH SEMAPHORE OPERATION BOD1/DAP4-BR

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

Linux scheduler history. We will be talking about the O(1) scheduler

Multiprocessor Scheduling and Scheduling in Linux Kernel 2.6

Interrupts and the Timer Overflow Interrupts Huang Sections What Happens When You Reset the HCS12?

POSIX. RTOSes Part I. POSIX Versions. POSIX Versions (2)

A Survey of Parallel Processing in Linux

Chapter 6, The Operating System Machine Level

Timer Value IRQ IACK

Keil C51 Cross Compiler

AVR131: Using the AVR s High-speed PWM. Introduction. Features. AVR 8-bit Microcontrollers APPLICATION NOTE

949 Crestview Circle Weston, FL U.S.A. The Real-Time kernel V2.90. Release Notes. Copyright 2010, Micriµm All Rights reserved

Multi-core Programming System Overview

Chapter 5: CPU Scheduling. Operating System Concepts 8 th Edition

Transcription:

REAL TIME OPERATING SYSTEMS Lesson-3: Timer Functions 1

1. Timer Functions 2

Timer Functions Real time clock system clock, on each tick SysClkIntr interrupts Based on each SysClkIntr interrupts there are number of OS timer functions 3

Timer functions at OS OS_TICK_PER_SEC to set the system clock ticks and hence SysClkIntr interrupts per s OSTickInit ( ) to initiate system clock ticks 4

Timer functions at OS OSTimeDelay ( ) to delay the process making call by a fixed number of system clock ticks specified in argument OSTimeDelay-Resume ( ) to resume a delayed process specified in the argument 5

Timer functions at OS OSTimeSet ( ) to set the counts of system clock ticks OSTimeGet ( ) to read the counts of system clock ticks to find the time interval from the previous read or write of the counts 6

Timer functions at OS OSSemPend (semval, twait, *semerr) to wait for a semaphore release OSMboxPend (semval, twait, *mboxerr) to wait for a message in mailbox (wait for message pointed not Null) 7

2. System clock ticks and hence SysClkIntr interrupts 8

SysClkIntr interrupts Before servicing of SysClkIntr, the presently running task or thread or process context saves on the TCB or thread stack or PCB data structure, System switches to supervisory mode SysClkIntr service routine call the OS to increment system time and to find the new messages or IPCs, which the OS event control blocks received from the system call for the IPC functions, 9

SysClkIntr service routine call the OS functions (i) to increment system time and (ii) to find the new messages or IPCs, which the OS event control blocks received from the system call for the IPC functions, (iii) call the OS function as per the message or system call 10

SysClkIntr service routine (iv) Then OS either selects the same task or selects new task or thread [by preemption in case of preemptive scheduling and switches the context to the new one, and Then after return from the interrupt the new task runs from the code, which was blocked from running 11

2. Examples of Timer functions 12

OS_TICK_PER_SEC # define OS_TICK_PER_SEC 100 /* COS-II function to define the number of ticks per second = 100 before the beginning of the main ( ) and the initiating the OS by OSInit ( ) function* 13

OSTickInit ( ) OSTickInit ( ) /* COS-II function to initiate the defined number of ticks per second after the beginning of the first task and creating all the tasks to which the context will be switched by the OS on the tick. It initiates SysClkIntr interrupts every 10 ms when number of ticks = 100 per s*/. 14

OSTimeDelay (n ) OSTimeDelay (n ) by period equal to period of n clock ticks OSTimeDelay (100); /* Code for finding the coins amount after every 100 clock ticks, which means every 1 s*/ ; } 15

OSTimeSet (Count) and OSTimeGet () count =0; OSTimeSet (Count); while (count < = 6000) /* While loop waits for the coins amount upto 60000 ms = 1 minute */ {Count = OSTimeGet ( ); /*Calling OSTimeGet ( ), finding the count, count1, running a section of codes and then calling OSTimeGet ( ), finding the new count, count2 give us the interval, T spent by the system in between the two function calls of OSTimeGet ( ). T = (count2 count1) interval between two clock ticks gives the interval*/ 16

Summary 17

We learnt SysClkIntr interrupts OS_TICK_PER_SEC OSTickInit ( ) OSTimeDelay ( ) OSTimeDelay-Resume ( ) 18

We learnt OSTimeSet ( ) OSTimeGet ( ) OSSemPend (semval, twait, *semerr) OSMboxPend (semval, twait, *mboxerr) 19

End of Lesson 3 of Chapter 8 20