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.

Slides:



Advertisements
Similar presentations
More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
Advertisements

Chapter 3 Process Description and Control
Resource management and Synchronization Akos Ledeczi EECE 354, Fall 2010 Vanderbilt University.
Real-Time Library: RTX
Mark Schaumburg.  Dash Module for Formula Car  Sample pulse from engine for RPM  Display Information  Control gui  Can network interface  Request.
Embedded System Presentation Nguyễn Trần Quang Nguyễn Công Vũ 1µC/OS-II.
Introduction to Operating Systems – Windows process and thread management In this lecture we will cover Threads and processes in Windows Thread priority.
Chapter 11 Operating Systems
Real-Time Kernels and Operating Systems. Operating System: Software that coordinates multiple tasks in processor, including peripheral interfacing Types.
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
MicroC/OS-II Embedded Systems Design and Implementation.
Using Two Queues. Using Multiple Queues Suspended Processes Processor is faster than I/O so all processes could be waiting for I/O Processor is faster.
FreeRTOS.
Real-Time Operating Systems Suzanne Rivoire November 20, 2002
ΜC/OS-III Tasks Akos Ledeczi EECE 354, Fall 2010 Vanderbilt University.
Interrupts. 2 Definition: An electrical signal sent to the CPU (at any time) to alert it to the occurrence of some event that needs its attention Purpose:
Real Time Operating System
SOC Consortium Course Material SoC Design Laboratory Lab 8 Real-time OS - 2 Speaker: Yung-Chih Chen Advisor: Prof. Chun-Yao Wang November 17, 2003 Department.
OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements.
1 Computer System Overview Chapter 1. 2 n An Operating System makes the computing power available to users by controlling the hardware n Let us review.
The  C/OS-II Real-Time Operating System.  C/OS-II Real-time kernel –Portable, scalable, preemptive RTOS –Ported to over 90 processors Pronounced “microC.
Real-Time Systems Design1 Priority Inversion When a low-priority task blocks a higher-priority one, a priority inversion is said to occur Assume that priorities:
SOC Consortium Course Material Real-time OS Speaker: 沈文中 April. 9, 2003 National Taiwan University Adopted from National Chiao- Tung University SOC Course.
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.
The Functions of Operating Systems Interrupts. Learning Objectives Explain how interrupts are used to obtain processor time. Explain how processing of.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Introduction to Concurrency.
CE Operating Systems Lecture 11 Windows – Object manager and process management.
Dhanshree Nimje Smita Khartad
Real Time Operating Systems
Real-time OS Hao-yuan Chin Feb. 18, Institute of Electronics, National Chiao Tung University Real-time OS 1 Outline Introduction to RTOS Introduction.
Chapter 2 Processes and Threads Introduction 2.2 Processes A Process is the execution of a Program More specifically… – A process is a program.
Overview Task State Diagram Task Priority Idle Hook AND Co-Routines
RTX - 51 Objectives  Resources needed  Architecture  Components of RTX-51 - Task - Memory pools - Mail box - Signals.
ECGR-6185 µC/OS II Nayana Rao University of North Carolina at Charlotte.
Real Time Operating Systems Michael Thomas Date: Rev. 1.00Date.
1 VxWorks 5.4 Group A3: Wafa’ Jaffal Kathryn Bean.
Chapter 2 Process Management. 2 Objectives After finish this chapter, you will understand: the concept of a process. the process life cycle. process states.
6.0 INTRODUCTION TO REAL-TIME OPERATING SYSTEMS (RTOS) 6.0 Introduction A more complex software architecture is needed to handle multiple tasks, coordination,
1 Process Description and Control Chapter 3. 2 Process A program in execution An instance of a program running on a computer The entity that can be assigned.
Time Management.  Time management is concerned with OS facilities and services which measure real time.  These services include:  Keeping track of.
Lab 3 Department of Computer Science and Information Engineering National Taiwan University Lab3 – μC/OS 2015/10/13/ 13 1.
Embedded Computer - Definition When a microcomputer is part of a larger product, it is said to be an embedded computer. The embedded computer retrieves.
Copyright © Curt Hill More on Operating Systems Continuation of Introduction.
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.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
Chapter 7: Semaphore Management Seulki Lee 1. Semaphore?  A protocol mechanism offered by most multitasking kernels  Control access to a shared resource.
2-1 Chapter 2 Real-Time Systems Concepts. 2-2 Foreground/Background Systems BackgroundForeground ISR Time Code execution application consists of an infinite.
Real Time Operating Systems Johan Dams
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.
LPC2148's RTOS Bruce Chhuon 4/10/07. What is a Real Time Operating System? ● A Real Time Operating System (RTOS) manages hardware and software resources.
WORKING OF SCHEDULER IN OS
REAL TIME OPERATING SYSTEM
Chapter 1: Getting Started with μC/OS-II
REAL-TIME OPERATING SYSTEMS
Processes and threads.
Topics Covered What is Real Time Operating System (RTOS)
Interrupt and Time Management in µC/OS-III
Getting Started with the µC/OS-III Real Time Kernel
Real Time Operating Systems for Networked Embedded Systems
Introduction What is an operating system bootstrap
Processor Fundamentals
Operating Systems.
Computer System Laboratory
Chapter 3: Process Management
Akos Ledeczi EECE 6354, Fall 2017 Vanderbilt University
Akos Ledeczi EECE 6354, Fall 2015 Vanderbilt University
Akos Ledeczi EECE 6354, Fall 2017 Vanderbilt University
Presentation transcript:

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 is a priority-based real-time multitasking operating system kernel for microprocessors, written mainly in the C programming language.  It is intended for use in embedded systems. INTRODUCTION

 It is a very small real-time kernel.  Memory footprint is about 20KB for a fully functional kernel.  Source code is written mostly in ANSI C.  Highly portable, ROMable, very scalable, preemptive real- time, deterministic, multitasking kernel.  It can manage up to 64 tasks (56 user tasks available).  It has connectivity with μC/GUI and μC/FS (GUI and File Systems for μC/OS II). Features of MicroC/OS-II :

 It is ported to more than 100 microprocessors and microcontrollers.  It is simple to use and simple to implement but very effective compared to the price/performance ratio.  It supports all type of processors from 8-bit to 64-bit. Cont…

µC/OS-II is a multitasking operating system. Each task is an infinite loop and can be in any one of the following five states:  Dormant  Ready  Running  Waiting  ISR (Interrupt Service Routine) Task states:

 Task Feature  Task Creation  Task Stack & Stack Checking  Task Deletion  Change a Task’s Priority  Suspend and Resume a Task  Get Information about a Task Task Management (Services):

 μC/OS-II can manage up to 64 tasks.  The four highest priority tasks and the four lowest priority tasks are reserved for its own use. This leaves 56 tasks for applications.  The lower the value of the priority, the higher the priority of the task. (Something on the lines of Rate Monotonic Scheduling).  The task priority number also serves as the task identifier. Task Feature :

PROCESS CYCLE :

There are two functions for creating a task: OSTaskCreate() OSTaskCreateExt(). Task Creation :

Task Management :

 After the task is created, the task has to get a stack in which it will store its data.  A stack must consist of contiguous memory locations.  It is necessary to determine how much stack space a task actually uses.  Deleting a task means the task will be returned to its dormant state and does not mean that the code for the task will be deleted. The calling task can delete itself.

 If another task tries to delete the current task, the resources are not freed and thus are lost. So the task has to delete itself after it uses its resources  Priority of the calling task or another task can be changed at run time.  A task can suspend itself or another task, a suspended task can resume itself.  A task can obtain information about itself or other tasks. This information can be used to know what the task is doing at a particular time. Task Management (cont…):

The services of Memory management includes: Initializing the Memory Manager. Creating a Memory Partition. Obtaining Status of a Memory Partition. Obtaining a Memory Block. Returning a Memory Block. Waiting for Memory Blocks from a Memory Partition. Memory Management :

 Each memory partition consists of several fixed-sized memory blocks.  A task obtains memory blocks from the memory partition. A task must create a memory partition before it can be used.  Allocation and de-allocation of these fixed-sized memory blocks is done in constant time and is deterministic.  Multiple memory partitions can exist, so a task can obtain memory blocks of different sizes.  A specific memory block should be returned to its memory partition from which it came. Memory Management :

Clock Tick : A clock tick is a periodic time source to keep track of time delays and time outs.  Here, tick intervals varies from 10 ~ 100 ms.  The faster the tick rate, the higher the overhead imposed on the system.  Whenever a clock tick occurs μC/OS-II increments a 32- bit counter, the counter starts at zero, and rolls over to 4,294,967,295 (2^32-1) ticks.  A task can be delayed and a delayed task can also be resumed. Time Management :

It involves five services that includes: OSTimeDLY() OSTimeDLYHMSM() OSTimeDlyResume() OSTimeGet() OSTimeSet() Time Management :

 Inter-task or inter process communication in μC/OS takes place using: Semaphores Message mailbox Message queues  Tasks and Interrupt service routines (ISR). They can interact with each other through an ECB (event control block). Inter-Task Communication :

 Single task waiting

Inter-Task Communication :  Multiple tasks waiting and signaling

Inter-Task Communication :  Tasks can wait and signal along with an optional time out

Inter-Task Communication :  μC/OS-II semaphores consist of two elements 16-bit unsigned integer count list of tasks waiting for semaphore  μC/OSII provides Create, post, pend accept and query services

Inter-Task Communication :  μC/OS-II messag boxes: an μC/OSII object that allows a task or ISR to send a pointer sized variable (pointing to a message) to another task.

Inter-Task Communication :  μC/OS-II message-queues  Available services: Create, Post (FIFO), PostFront (LIFO), Pend, Accept, Query, Flush  N = #of entries in the queue: Queue full if Post or PostFront called N times before a Pend or Accept

Inter-Task Communication :  μC/OS-II message-queues organized as circular buffers.

Tasks running under a multitasking kernel should be written in one of two ways: 1.A non-returning forever loop. For example: void Task (void *) { DoInitStuff(); while (1) { do this; do that; do the other thing; call OS service (); // e.g. OSTimeDelay, OSSemPend, etc. } Writing Applications Under μ C/OS -II:

2. A task that deletes itself after running. For example: void Task (void *) { do this; do that; do the other thing; call OS service (); // e.g. OSTimeDelay, OSSemPend, etc. OSTaskDelete(); // Ask the OS to delete the task }