ECGR-6185 µC/OS II Nayana Rao University of North Carolina at Charlotte.

Slides:



Advertisements
Similar presentations
Process management Information maintained by OS for process management  process context  process control block OS virtualization of CPU for each process.
Advertisements

Resource management and Synchronization Akos Ledeczi EECE 354, Fall 2010 Vanderbilt University.
0 Synchronization Problem Resource sharing –Requires mutual exclusion –Critical section A code section that should be executed mutually exclusively by.
Real-Time Library: RTX
CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems Resource Access Control Protocols.
Previously… Processes –Process States –Context Switching –Process Queues Threads –Thread Mappings Scheduling –FCFS –SJF –Priority scheduling –Round Robin.
Interprocess Communication
Bilgisayar Mühendisliği Bölümü GYTE - Bilgisayar Mühendisliği Bölümü Multithreading the SunOS Kernel J. R. Eykholt, S. R. Kleiman, S. Barton, R. Faulkner,
Real-Time Kernels and Operating Systems Basic Issue - Purchase commercial “off-the- shelf” system or custom build one Basic Functions –Task scheduling.
Lecture 2. Real-time Systems Concept Prof. Taeweon Suh Computer Science Education Korea University COM609 Topics in Embedded Systems.
HW/SW Interface Operating Systems Design and Implementation.
OS2-1 Chapter 2 Computer System Structures. OS2-2 Outlines Computer System Operation I/O Structure Storage Structure Storage Hierarchy Hardware Protection.
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
5.6 Semaphores Semaphores –Software construct that can be used to enforce mutual exclusion –Contains a protected variable Can be accessed only via wait.
Introduction to Operating Systems – Windows process and thread management In this lecture we will cover Threads and processes in Windows Thread priority.
OS Spring’03 Introduction Operating Systems Spring 2003.
Advanced OS Chapter 3p2 Sections 3.4 / 3.5. Interrupts These enable software to respond to signals from hardware. The set of instructions to be executed.
Real-Time Kernels and Operating Systems. Operating System: Software that coordinates multiple tasks in processor, including peripheral interfacing Types.
Operating system Part three Introduction to computer, 2nd semester, 2010/2011 Mr.Nael Aburas Faculty of Information.
MicroC/OS-II Embedded Systems Design and Implementation.
Performance Evaluation of Real-Time Operating Systems
General System Architecture and I/O.  I/O devices and the CPU can execute concurrently.  Each device controller is in charge of a particular device.
Advanced Embedded Systems Design Pre-emptive scheduler BAE 5030 Fall 2004 Roshani Jayasekara Biosystems and Agricultural Engineering Oklahoma State University.
Real Time Operating System
Introduction to Embedded Systems
Real-Time Kernel (Part 1)
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
Getting Started with the µC/OS-III Real Time Kernel Akos Ledeczi EECE 6354, Fall 2015 Vanderbilt University.
2-1 The critical section –A piece of code which cannot be interrupted during execution Cases of critical sections –Modifying a block of memory shared by.
Real Time Operating Systems
Computers Operating System Essentials. Operating Systems PROGRAM HARDWARE OPERATING SYSTEM.
Embedded Operating System Leo Philip 10/5/ Do we need an OS ?
RTX - 51 Objectives  Resources needed  Architecture  Components of RTX-51 - Task - Memory pools - Mail box - Signals.
Real Time Operating Systems Michael Thomas Date: Rev. 1.00Date.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
MicroC/OS-II S O T R.  MicroC/OS-II (commonly termed as µC/OS- II or uC/OS-II), is the acronym for Micro-Controller Operating Systems Version 2.  It.
1 VxWorks 5.4 Group A3: Wafa’ Jaffal Kathryn Bean.
Processes, Threads, and Process States. Programs and Processes  Program: an executable file (before/after compilation)  Process: an instance of a program.
CSE 153 Design of Operating Systems Winter 2015 Midterm Review.
Chapter 2 Process Management. 2 Objectives After finish this chapter, you will understand: the concept of a process. the process life cycle. process states.
Lab 3 Department of Computer Science and Information Engineering National Taiwan University Lab3 – μC/OS 2015/10/13/ 13 1.
Slides created by: Professor Ian G. Harris Operating Systems  Allow the processor to perform several tasks at virtually the same time Ex. Web Controlled.
Introduction Contain two or more CPU share common memory and peripherals. Provide greater system throughput. Multiple processor executing simultaneous.
CHAPTER 7 CONCURRENT SOFTWARE Copyright © 2000, Daniel W. Lewis. All Rights Reserved.
Chapter 3 RTOS Concepts And Definitions Department of Computer Science Hsu Hao Chen Professor Hsung-Pin Chang.
SOC Consortium Course Material SoC Design Laboratory Lab 8 Real-time OS - 1 Speaker: Yung-Chih Chen Advisor: Prof. Chun-Yao Wang November 17, 2003 Department.
Mutual Exclusion -- Addendum. Mutual Exclusion in Critical Sections.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
Chapter 6 Limited Direct Execution Chien-Chung Shen CIS/UD
2-1 Chapter 2 Real-Time Systems Concepts. 2-2 Foreground/Background Systems BackgroundForeground ISR Time Code execution application consists of an infinite.
Chapter 1: Getting Started with μC/OS-II 1. kernel Introduction 2 LinuxμC/OS-II Task (process) kernel Device driver User mode (0-3G) (Kernel mode) 3G-4G.
Outlines  Introduction  Kernel Structure  Porting.
Real-Time Operating Systems RTOS For Embedded systems.
REAL-TIME OPERATING SYSTEMS
Real time systems RTS Engineering.
Process Management Process Concept Why only the global variables?
Topics Covered What is Real Time Operating System (RTOS)
Getting Started with the µC/OS-III Real Time Kernel
Intro to Processes CSSE 332 Operating Systems
PROCESS MANAGEMENT Information maintained by OS for process management
Lecture 2 Part 2 Process Synchronization
Architectural Support for OS
EE 472 – Embedded Systems Dr. Shwetak Patel.
February 5, 2004 Adrienne Noble
Architectural Support for OS
Process State Model -Compiled by Sheetal for CSIT
CSE 153 Design of Operating Systems Winter 2019
Computer System Laboratory
Akos Ledeczi EECE 6354, Fall 2017 Vanderbilt University
Akos Ledeczi EECE 6354, Fall 2015 Vanderbilt University
Presentation transcript:

ECGR-6185 µC/OS II Nayana Rao University of North Carolina at Charlotte

Introduction and Features Very small real time OS kernel: OS that enforces timing constraints Memory footprint is small ~ 20 KB OS source code is written in C-open source but not free for commercial use

MULTITASKING Process of switching CPU and scheduling between several tasks Resources are shared Each task is an infinite loop

KERNEL Responsible for managing tasks and initiate context switching Pre-emptive kernel

SCHEDULING Preemptive priority driven real time scheduling 64 priority levels which means maximum allowed tasks = 64 Priority inversion problem: When a task with lower priority holds a resource required by high priority task.

Priority Inversion problem:

Solution: Priority Inheritance

MUTUAL EXCLUSION Avoidance of simultaneous use of resources Interrupt Handlers: Enabling and disabling interrupts to manipulate and protect critical sections so that no other ISR or context switch occurs Semaphores: binary or counting If Deadlock-> Set timeout

SYNCHRONIZATION AND INTERRUPTS Between two tasks or between task and ISR Interrupt informs the CPU of asynchronous events Interrupt latency is important and should be kept low to improve responsiveness Interrupt latency = max duration for which interrupts are disabled+ time to start executing first instruction in ISR

µC/OS II File Structure

Tasks Small piece of code that performs some function: infinite loop Several tasks controlled by a Task Control Block. Also maintains state of task Task information maintained by OS-Task’s Context Each task has a unique priority

Dormant: Procedure residing on RAM/ROM. Not a task till it is called to execute Ready: Not delayed or waiting. Contained in a ready list Running: Task ready or schedule to run on the CPU Waiting: Task is waiting for an event to occur eg: timeout or for semaphore ISR: A task may be pre empted by an ISR

Each task could be in 1 of 5 states: Dormant, Ready, Running, Waiting, ISR

Example of Task

Task level Scheduling, Context Switching and Clock Ticks Scheduler schedules highest priority task to run- Interrupts are disabled during scheduling so that new tasks are not added by other interrupts to the ready list Context Switching (handled at interrupt level) must save CPU registers of the pre-empted task to its stack and be able to restore highest priority task from its task Clock Ticks: Special interrupt that keeps track of timing and delays in tasks

µC/OS II and the Renesas µC Can be ported to several existing µC architectures Download the port to run the Renesas board from and installed C:\renesas\NC30WA

Modify contents of main.c file (located in test folder) to build the required application /*Constants, Macros, Globals, Prototypes*/ void main (void) { OSInit(); OSTaskCreate(TaskStart, (void*)0x5aa5, (void*)&TaskStartStk[TASK_STK_SIZE - 1], 0); OSStart(); } /*Startup Task*/ /*Task List*/ /*System Tick*/ /*Other Initializations*/ /*Interrupts*/

Make changes to and execute the mk.bat file Set up Flash over USB (v2.4) Compile main file to main.mot using flash over USB and load to board