Windows CE Portable Modular Real-time Small footprint Embedded market.

Slides:



Advertisements
Similar presentations
OS/2 Warp Chris Ashworth Cameron Davis John Weatherley.
Advertisements

Operating System Structure
Real-Time Kernels and Operating Systems Basic Issue - Purchase commercial “off-the- shelf” system or custom build one Basic Functions –Task scheduling.
3: OS Structures 1 OPERATING SYSTEM STRUCTURES PROCESS MANAGEMENT A process is a program in execution: (A program is passive, a process active.) A process.
Chapter 13 Embedded Systems Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
ECE 526 – Network Processing Systems Design Software-based Protocol Processing Chapter 7: D. E. Comer.
Page 1 Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
INTRODUCTION OS/2 was initially designed to extend the capabilities of DOS by IBM and Microsoft Corporations. To create a single industry-standard operating.
Introduction to Operating Systems – Windows process and thread management In this lecture we will cover Threads and processes in Windows Thread priority.
2: OS Structures 1 Jerry Breecher OPERATING SYSTEMS STRUCTURES.
Home: Phones OFF Please Unix Kernel Parminder Singh Kang Home:
Embedded Real-time Systems The Linux kernel. The Operating System Kernel Resident in memory, privileged mode System calls offer general purpose services.
1 Operating Systems Ch An Overview. Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, Bare Bones Computer.
Chapter 6 Implementing Processes, Threads, and Resources.
Process Concept An operating system executes a variety of programs
Phones OFF Please Processes Parminder Singh Kang Home:
Chapter 8 Windows Outline Programming Windows 2000 System structure Processes and threads in Windows 2000 Memory management The Windows 2000 file.
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 11 Case Study 2: Windows Vista Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
Process Management. Processes Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication.
Object Oriented Analysis & Design SDL Threads. Contents 2  Processes  Thread Concepts  Creating threads  Critical sections  Synchronizing threads.
Composition and Evolution of Operating Systems Introduction to Operating Systems: Module 2.
MultiThreaded Applications. What is Multithreaded Programming? Having your software appear to perform multiple tasks in parallel –Individual paths of.
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.
© 2004, D. J. Foreman 2-1 Concurrency, Processes and Threads.
CE Operating Systems Lecture 11 Windows – Object manager and process management.
1 Confidential Enterprise Solutions Group Process and Threads.
ITEC 502 컴퓨터 시스템 및 실습 Chapter 2-1: Process Mi-Jung Choi DPNM Lab. Dept. of CSE, POSTECH.
Fall 2013 SILICON VALLEY UNIVERSITY CONFIDENTIAL 1 Introduction to Embedded Systems Dr. Jerry Shiao, Silicon Valley University.
Scott Ferguson Section 1
Chapter 2 Processes and Threads Introduction 2.2 Processes A Process is the execution of a Program More specifically… – A process is a program.
Silberschatz, Galvin and Gagne  Operating System Concepts Process Concept An operating system executes a variety of programs:  Batch system.
Kernel Architecture Process Management Memory Management.
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.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Processes and Threads.
2 Processor(s)Main MemoryDevices Process, Thread & Resource Manager Memory Manager Device Manager File Manager.
What is an Operating System? Various systems and their pros and cons –E.g. multi-tasking vs. Batch OS definitions –Resource allocator –Control program.
4.1 Introduction to Threads Overview Multithreading Models Thread Libraries Threading Issues Operating System Examples Windows XP Threads Linux Threads.
Introduction Contain two or more CPU share common memory and peripherals. Provide greater system throughput. Multiple processor executing simultaneous.
Where Testing Fails …. Problem Areas Stack Overflow Race Conditions Deadlock Timing Reentrancy.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Big Picture Lab 4 Operating Systems C Andras Moritz
Advanced Operating Systems CS6025 Spring 2016 Processes and Threads (Chapter 2)
Threads and Thread Synchronization. Introduction In windows the basic unit of execution is the thread. It is the smallest schedulable unit of execution.
OPERATING SYSTEMS STRUCTURES Jerry Breecher 2: Operating System Structures 1.
Introduction to threads
Chapter 3: Windows7 Part 5.
REAL-TIME OPERATING SYSTEMS
CS 6560: Operating Systems Design
Topics Covered What is Real Time Operating System (RTOS)
Background on the need for Synchronization
OPERATING SYSTEMS CS3502 Fall 2017
Process Management Presented By Aditya Gupta Assistant Professor
Operating Systems: A Modern Perspective, Chapter 6
Real-time Software Design
Chapter 3: Windows7 Part 5.
Chapter 2: System Structures
Mid Term review CSC345.
Lecture Topics: 11/1 General Operating System Concepts Processes
Lecture 2 Part 2 Process Synchronization
Windows Development Dynadata Copyright, 2014 © DynaData S.A. 1/49.
February 5, 2004 Adrienne Noble
Implementing Processes, Threads, and Resources
Chapter 2 Processes and Threads 2.1 Processes 2.2 Threads
OPERATING SYSTEMS STRUCTURES
Concurrency, Processes and Threads
Threads CSE 2431: Introduction to Operating Systems
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

Windows CE Portable Modular Real-time Small footprint Embedded market

OS Spectrum Real-time General Purpose Specialized, Small Footprint, Short Interrupt latency, Deterministic scheduling, No memory protection, Limited API, Hard realtime requirements General Purpose Large Footprint Longer Interrupt Latency Det/Non-det. Sched. Memory Protection Rich API Soft real-time CE

Requirements and Features 32-bit 350 KB minimum memory ROM-able Processes, kernel mode threads, inter-task communication and sync. Pre-emptive kernel Priority scheduling and priority inheritance Paging Memory management File System support Interrupt latency = us, no nested interrupts Networking stacks, Device drivers, GUI, etc.

Overall Architecture OEM Hardware OEM Adaptation Layer Native Drivers Stream Interface Drivers Kernel Graphics, Windowing and Event Subsystem Device Manager Core System APIFile SystemCommunications Add-ons (OLE, Java, …)Shell Win32 Applications

Processes Each appln. runs as a process Process = address space + threads + kernel objects of that process (mutex, events, file descriptors, …) Address space = code+data+stack+heap Address space isolation makes a system more robust But makes context switching expensive CE restricts no. of processes to 32.

Threads Lightweight counterpart of processes Entities within a process that are only associated with a stack (no code/data/heap) Switching is cheap Several threads within a process can cooperate to provide concurrency Makes it easier to program non-blocking programs. When a process is created, there is 1 primary thread, starts executing WinMain() in.EXE file. You can create more threads subsequently if needed.

Creating a Process Rc = CreateProcess( TEXT(“Hello.exe”), // Appln. Name NULL, // Command Line Args NULL, // Process attributes NULL,// Thread attributes FALSE,// Handle inheritance 0,// Special flags NULL,// Environment NULL,// Current directory NULL,// Startup info &ProcInfo); // Get info about created process Returns TRUE if successful, FALSE if failed. Handle is used to denote process in OS calls GetCurrentProcess(), GetCurrentProcessId()

Creating Secondary Threads HANDLE hThread = CreateThread( NULL,//Thread attributes 0,// Specify stack size funcName,// Thread starts there &param,// Parameters 0,// Special creation flags &threadId);// Thread ID GetCurrentThread(), GetCurrentThreadId(). Unlimited number of threads

Scheduling Preemptive scheduler Each thread is assigned a priority Normally a thread is created with priority THREAD_PRIORITY_NORMAL Priority levels –THREAD_PRIORITY_TIME_CRITICAL (real-time apps) –THREAD_PRIORITY_HIGHEST (Device drivers) –THREAD_PRIORITY_ABOVE_NORMAL (very responsive applns.) –THREAD_PRIORITY_NORMAL (most applns.) –THREAD_PRIORITY_BELOW_NORMAL (secondary, less important) –THREAD_PRIORITY_LOWEST (backup, file download, etc.) –THREAD_PRIORITY_ABOVE_IDLE (Disk maintenance utils) –THREAD_PRIORITY_IDLE (rarely used)

A single queue for each level Scan from the highest priority to lowest priority queues As soon as you find a non-NULL queue, schedule thread at its head. After time-quantum you put it at the end of that queue and repeat (round- robin within each queue)

Priority Inversion Problem Consider 2 threads T1 and T2 where T1d is running currently and T2 is blocked on I/O, and priority(T2) > priority(T1) Say T1 acquires a critical section I/O is now complete and T2 becomes ready T2 is immediately scheduled, and it in turn asks for the critical section (say it is a spinning request) Problem: T1 will not be scheduled to release the critical section for T2 to process => Higher priority thread will not progress till lower priority thread is scheduled

Solution When T2 becomes awake and asks for critical section, temporarily boost the priority of T1 to be that of T2 Once T1 is done with critical section it reverts back to its old priority. (NOTE: This problem can occur even in blocking request implementations)

Need for Synchronization Race conditions can occur when multiple activities (threads in this case) read and write shared variables possibly leading to states that the user did not intend Guard statements (critical section) with synchronization constructs to restrict the possible executions.

Synchronization Constructs in CE Critical section objects Mutex objects Event objects Interlock functions

Critical section object Only one thread can be allowed (to executed) in a critical section object at a time. A process can have any number of critical section objects. These objects are not sharable across processes.

Critical section object usage CRITICAL_SECTION m_CritSect; EnterCriticalSection(&m_CritSect); …… Critical section code goes here …… LeaveCriticalSection(&m_CritSect); InitializeCriticalSection(&m_CritSect) and DeleteCriticalSection(&m_CritSect) calls.

Mutex Objects Similar to critical section objects with the difference being that they can be used across processes as well. HANDLE m_hMutex; M_hMutex = CreateMutex( NULL; // security attributes FALSE; // Not owned by any thread NULL); // Name if used across processes WaitForSingleObject(m_hMutex,INFINITE); …. Critical section … ReleaseMutex(m_hMutex);

Event Objects Has signalled and non-signalled states You can either automatically reset it after the waiting process gets a signal or can manually reset it. Can also be used across processes.

Interlocked Functions Atomic functions to implement some simple operations InterlockedIncrement(&count) – Reads the count variable and increments it InterlockedDecrement(&count) InterlockedExchange(&v1,&v2) – returns value in v1 and sets v1=v2.