Multitasking. Embedded Systems
|
|
- Dylan Park
- 6 years ago
- Views:
Transcription
1 Multitasking in Embedded Systems 1 / 39 Multitasking in Embedded Systems v1.0
2 Multitasking in ES What is Singletasking? What is Multitasking? Why Multitasking? Different approaches Realtime Operating Systems FreeRTOS Synchronization Example Project Debugging Multitasking Software 2 / 39 Multitasking in Embedded Systems v1.0
3 What is Singletasking? Do only one thing at a time Most efficient way to solve problems Applicable to every algorithm No management overhead No internal synchronization required Easy to code Busy-wait for I/O No Interrupts 3 / 39 Multitasking in Embedded Systems v1.0
4 Singletasking Example while (1) { if ( Byte = receivebyte() ) { // blocks! Buffer[Index++] = Byte; if ( Index >= MessageSize) { M_t* M = (M_t*) Buffer; switch (M->Type) { case mt_commanda:... case mt_commandb: default: break; } Index = 0; } } } 4 / 39 Multitasking in Embedded Systems v1.0
5 What is Multitasking? Aim for multiple targets Switch context often Management overhead Synchronization required Interrupts required Hard to code/ debug Implicit delays Increased memory usage Implementation difficult for many algorithms 5 / 39 Multitasking in Embedded Systems v1.0
6 Multitasking Example main() { int Queue = xqueuecreate(...); ttc_task_create(receive, Queue, ); ttc_task_create(process, Queue, ); } void Process(int Q) { while (1) { M = (M_t*) ttc_queue_pop_front(q); if (M) { switch (M->Type) { case mt_cmda:... case mt_cmdb:... default: break; } } } } void Receive(int Q) { char Buffer[10][100]; int Index = 0; while (1) { char* Writer = &(Buffer[Index,0]); int Remaining = MessageSize; while (Remaining > 0) { if ( Byte = readbyte() ) { // sleeps! *Writer++ = Byte; Remaining--; } ttc_queue_push_back(q, &(Buffer[Index,0]);); Index++; if (Index > 99) Index = 0; } } 6 / 39 Multitasking in Embedded Systems v1.0
7 Why Multitasking? Functions spawnable multiple times Eases handling of slow IO Benefits from multiple CPU-cores Only 1 central Timer required Short Interrupt Service Routines Less global variables required 7 / 39 Multitasking in Embedded Systems v1.0
8 No life without Multitasking! Every Embedded System needs MT MT often implemented via Interrupts Complex Service Routines Data Exchange via Global Variables Difficult to debug Typical approach: Super-Loop Periodically starts set of functions Similar to task scheduler 8 / 39 Multitasking in Embedded Systems v1.0
9 Different Approaches Multiprogramming Ancient mechanism for Periheral Access Realized via Terminal Stay Ready (TSR) Cooperative Multitasking Central Scheduler manages Processes Each process grants CPU to other processes Single process can block whole system Preemptive Multitasking Scheduler interrupts each process periodically Requires central Interrupt-Timer Preemptible Multitasking High priority Applications can interrupt others (OS/2, Linux, FreeRTOS) Allows faster response times 9 / 39 Multitasking in Embedded Systems v1.0
10 Realtime Scheduling Definition of Realtime Real-time computing means a hardware + software system that must response within a strict time constraint. Realtime constraint Hard Violation causes hazardous results Firm Infrequent violations tolerable but degrade system's quality of service Soft Usefullness of results degrade after their deadline 10 / 39 Multitasking in Embedded Systems v1.0
11 FreeRTOS Multitasking Scheduler Premptible Multitasking High triority tasks block low priority ones Inter Thread Communication Semaphores Queues Developed specially for Embedded Systems Open Source FreeWare with Commercial Support Ported to several μc Architectures 11 / 39 Multitasking in Embedded Systems v1.0
12 TTC Queues Base of inter task communication Send message Task Task Interrupt Service Routine Task Call by value Reading from empty queue Function call waits until Queue is filled No CPU time is wasted during Wait Operations ttc_queue_byte_push_back(q, Byte); Byte = ttc_queue_byte_pull_front(q); Task A Task B 12 / 39 Multitasking in Embedded Systems v1.0
13 TTC - Semaphores Task A Task B Counting Implemented as unsigned integer Counter Task A can increase Semaphore by up to N token at once Data in Queue is of no interest ttc_semaphore_take(s, N) ttc_semaphore_give(s, N) 13 / 39 Multitasking in Embedded Systems v1.0
14 TTC - Mutex Implemented as Counter 0 1 Best suited for Resource locking Non recursive Can be locked only once Recursive thread can lock multiple times must be unlocked as often as being locked Task B waits until Task A activates once Operations ttc_mutex_lock(m) ttc_mutex_unlock(m) Task A Task B 14 / 39 Multitasking in Embedded Systems v1.0
15 Multithreading with Queues Activate Extensions for Queues example on STM32-P107 > activate.600_example_threading_queues.sh 15 / 39 Multitasking in Embedded Systems v1.0
16 Multithreading with Queues Spawning Tasks Producer threading_start() Consumer Print 16 / 39 Multitasking in Embedded Systems v1.0
17 Multithreading with Queues Communicate via Queues Producer LED1 PJ PJ PJ Print s8_t Column; s8_t Row; char Text[10]; s16_t Value; Consumer LED2 enqueue/ dequeue setport()/ clrport() 17 / 39 Multitasking in Embedded Systems v1.0
18 Multithreading with Semaphores Activate Extensions for Semaphores example on STM32-P107 > activate.600_example_threading_semaphores.sh 18 / 39 Multitasking in Embedded Systems v1.0
19 Multithreading with Semaphores Spawning Tasks Producer1 Producer2 threading_start() Consumer1 Consumer2 Print 19 / 39 Multitasking in Embedded Systems v1.0
20 Multithreading with Semaphores Communicate via Semaphore Producer1 enqueue/ dequeue setport()/ clrport() 0-10/s Data irrelevant 5/s Consumer1 LED1 5/s Consumer2 LED2 0-10/s Semaphore 5/s Consumer3 Producer2 5/s Consumer4 PJ PJ PJ Print 20 / 39 Multitasking in Embedded Systems v1.0
21 Debugging Multitasking Software Different types of Memories Multitasking & Stacks Watchdogs Binary file formats 21 / 39 Multitasking in Embedded Systems v1.0
22 Different types of Memories Storage RAM Heap Stack Datatypes Constants Global Variables Local Variables 22 / 39 Multitasking in Embedded Systems v1.0
23 Constants Stored in Flash along code Automatically initialized (initial value contained in binary) Reference to value points to address > 0x x Peripherals 0x RAM Example: char* HelloWorld = Hello world ; Hello World 0x Flash 23 / 39 Multitasking in Embedded Systems v1.0
24 RAM Area with read- / write access Multiple Memories possible On chip (start at 0x ) Off Chip via memory controller Static RAM Dynamic RAM 0x Peripherals 0x RAM 0x Flash 24 / 39 Multitasking in Embedded Systems v1.0
25 Stack Located at one end of RAM Grows towards other end by each Function call Local variable Shrinks by each local variable end of scope Return from function call 0x Peripherals 0x RAM Stack 0x Flash 25 / 39 Multitasking in Embedded Systems v1.0
26 Global Variables Stored in RAM Initialized by code at program start Assembled into block by linker Reference to value points to address > 0x Example: int V = 42; void main() { V++; } 0x Peripherals Globals 0x RAM Stack 0x Flash 26 / 39 Multitasking in Embedded Systems v1.0
27 Memory Heap Block of memory in RAM Allocated via malloc() Freed via free() Different managers heap1, heap2, heap3 see corresponding extensions 0x Peripherals Globals Heap 0x RAM Stack 0x Flash 27 / 39 Multitasking in Embedded Systems v1.0
28 Multitasking & Stacks Stacks in Singletask Applications Stacks in Multitasking Applications Stacks in FreeRTOS Stackoverflow 28 / 39 Multitasking in Embedded Systems v1.0
29 Stacks in Singletask Applications One single stack Grows from one end of RAM Efficient memory usage (no holes) Always big egnough Only one stack size to calculate Mostly invisible to developer 0x RAM Stack 29 / 39 Multitasking in Embedded Systems v1.0
30 Stacks in Multitasking Applications One stack per thread Grows at different locations Memory holes between stacks sizes are tradeoff Each size hard to calculate Developer has to re-check size New local variables More function calls 0x RAM Stack Stack Stack Stack 30 / 39 Multitasking in Embedded Systems v1.0
31 Stacks in FreeRTOS Stacks handled by FreeRTOS Stack size defined at stack creation Argument to xtaskcreate() Cannot be changed during task execution Tasks normally do not end Stacks allocated on memory heap 31 / 39 Multitasking in Embedded Systems v1.0
32 Stackoverflow Two detection schemes in FreeRTOS Activated in FreeRTOSConfig.h Stack size checked whenever a task is put to sleep activate.300_scheduler_free_rtos_stack_check_1.sh Checks stack pointer to be within allowed boundaries Cannot find overflow occured during task run time Fast check (only two pointer comparisons) activate.300_scheduler_free_rtos_stack_check_2.sh First checks stack pointer via method 1 Each stack filled with known value Last 16 bytes of stack checked for changed values Will find out if stack has grown into last 16 bytes Slower than method 1 but more reliable 32 / 39 Multitasking in Embedded Systems v1.0
33 Stack size calculation Three step approach 1) Double stack sizes until no overflow occurs 2) Run application 3) Use high water marks to minimize sizes Problems How to force tasks to use maximum memory? Global variable: bool TestMode Recalculate after code changes 33 / 39 Multitasking in Embedded Systems v1.0
34 High Water Marks Configured in #define INCLUDE_uxTaskGetStackHighWaterMark 1 Activate via activate.300_scheduler_free_rtos_high_watermarks.sh FreeRTOS - HighWaterMark 34 / 39 Multitasking in Embedded Systems v1.0
35 Hardfault Handler CPU reads/ writes illegal memory address bus fault error generates interrupt calls cm3_hard_fault_handler_c() cm3_hard_fault_handler_c() Gathers information about fault reason Calls Assert_Halt_EC(ec_HardFault) Assert_Halt_EC() Stops execution in endless loop Contains Breakpoint 35 / 39 Multitasking in Embedded Systems v1.0
36 Debugging a Hardfault 36 / 39 Multitasking in Embedded Systems v1.0
37 Memfault Handler 37 / 39 Multitasking in Embedded Systems v1.0
38 Watchdogs 38 / 39 Multitasking in Embedded Systems v1.0
39 Binary file formats objdump 39 / 39 Multitasking in Embedded Systems v1.0
Embedded Systems. 5. Operating Systems. Lothar Thiele. Computer Engineering and Networks Laboratory
Embedded Systems 5. Operating Systems Lothar Thiele Computer Engineering and Networks Laboratory Embedded Operating Systems 5 2 Embedded Operating System (OS) Why an operating system (OS) at all? Same
More informationSlide 6-1. Processes. Operating Systems: A Modern Perspective, Chapter 6. Copyright 2004 Pearson Education, Inc.
Slide 6-1 6 es Announcements Slide 6-2 Extension til Friday 11 am for HW #1 Previous lectures online Program Assignment #1 online later today, due 2 weeks from today Homework Set #2 online later today,
More informationUNIT -3 PROCESS AND OPERATING SYSTEMS 2marks 1. Define Process? Process is a computational unit that processes on a CPU under the control of a scheduling kernel of an OS. It has a process structure, called
More informationLast 2 Classes: Introduction to Operating Systems & C++ tutorial. Today: OS and Computer Architecture
Last 2 Classes: Introduction to Operating Systems & C++ tutorial User apps OS Virtual machine interface hardware physical machine interface An operating system is the interface between the user and the
More informationReal-Time Programming
Real-Time Programming Week 7: Real-Time Operating Systems Instructors Tony Montiel & Ken Arnold rtp@hte.com 4/1/2003 Co Montiel 1 Objectives o Introduction to RTOS o Event Driven Systems o Synchronization
More informationLesson 5: Software for embedding in System- Part 2
Lesson 5: Software for embedding in System- Part 2 Device drivers, Device manager, OS, RTOS and Software tools 1 Outline Device drivers Device manager Multitasking using an operating system (OS) and Real
More informationSynchronization I. Jo, Heeseung
Synchronization I Jo, Heeseung Today's Topics Synchronization problem Locks 2 Synchronization Threads cooperate in multithreaded programs To share resources, access shared data structures Also, to coordinate
More informationVORAGO VA108xx FreeRTOS port application note
VORAGO VA108xx FreeRTOS port application note Oct 21, 2016 Version 1.0 (Initial release) VA10800/VA10820 Abstract Real-Time Operating System (RTOS) is a popular software principle used for real-time applications
More informationEE4144: Basic Concepts of Real-Time Operating Systems
EE4144: Basic Concepts of Real-Time Operating Systems EE4144 Fall 2014 EE4144 EE4144: Basic Concepts of Real-Time Operating Systems Fall 2014 1 / 10 Real-Time Operating System (RTOS) A Real-Time Operating
More informationOperating Systems CMPSCI 377 Spring Mark Corner University of Massachusetts Amherst
Operating Systems CMPSCI 377 Spring 2017 Mark Corner University of Massachusetts Amherst Last Class: Intro to OS An operating system is the interface between the user and the architecture. User-level Applications
More informationCS 571 Operating Systems. Midterm Review. Angelos Stavrou, George Mason University
CS 571 Operating Systems Midterm Review Angelos Stavrou, George Mason University Class Midterm: Grading 2 Grading Midterm: 25% Theory Part 60% (1h 30m) Programming Part 40% (1h) Theory Part (Closed Books):
More informationThreads Tuesday, September 28, :37 AM
Threads_and_fabrics Page 1 Threads Tuesday, September 28, 2004 10:37 AM Threads A process includes an execution context containing Memory map PC and register values. Switching between memory maps can take
More informationProcesses. OS Structure. OS Structure. Modes of Execution. Typical Functions of an OS Kernel. Non-Kernel OS. COMP755 Advanced Operating Systems
OS Structure Processes COMP755 Advanced Operating Systems An OS has many parts. The Kernel is the core of the OS. It controls the execution of the system. Many OS features run outside of the kernel, such
More informationOperating Systems Design Fall 2010 Exam 1 Review. Paul Krzyzanowski
Operating Systems Design Fall 2010 Exam 1 Review Paul Krzyzanowski pxk@cs.rutgers.edu 1 Question 1 To a programmer, a system call looks just like a function call. Explain the difference in the underlying
More informationFreeRTOS X. Task Notifications Semaphores Family Critical Section FreeRTOS Producer Consumer Tasks
FreeRTOS X Task Notifications Semaphores Family Critical Section FreeRTOS Producer Consumer Tasks Task Notifications Semaphores Family Binary Semaphore Counting Semaphore Mutex Recursive Mutex Critical
More informationIntroduction to Real-Time Systems and Multitasking. Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff
Introduction to Real-Time Systems and Multitasking Real-time systems Real-time system: A system that must respond to signals within explicit and bounded time requirements Categories Soft real-time system:
More informationRT3 - FreeRTOS Real Time Programming
Formation FreeRTOS Real Time Programming: Real-time programming applied to the FreeRTOS operating system - Systèmes d'exploitation: RTOS RT3 - FreeRTOS Real Time Programming Real-time programming applied
More informationMultithreading and Interactive Programs
Multithreading and Interactive Programs CS160: User Interfaces John Canny. Last time Model-View-Controller Break up a component into Model of the data supporting the App View determining the look of the
More informationMARUTHI SCHOOL OF BANKING (MSB)
MARUTHI SCHOOL OF BANKING (MSB) SO IT - OPERATING SYSTEM(2017) 1. is mainly responsible for allocating the resources as per process requirement? 1.RAM 2.Compiler 3.Operating Systems 4.Software 2.Which
More informationArdOS The Arduino Operating System Reference Guide Contents
ArdOS The Arduino Operating System Reference Guide Contents 1. Introduction... 2 2. Error Handling... 2 3. Initialization and Startup... 2 3.1 Initializing and Starting ArdOS... 2 4. Task Creation... 3
More informationChapter 9: Virtual-Memory
Chapter 9: Virtual-Memory Management Chapter 9: Virtual-Memory Management Background Demand Paging Page Replacement Allocation of Frames Thrashing Other Considerations Silberschatz, Galvin and Gagne 2013
More informationUniversity of Washington EE 472: Microcomputer Systems Exam Autumn 2015
University of Washington EE 472: Microcomputer Systems Exam Autumn 2015 November 26, 2015 Name: Student ID: Exam Information: The test is closed book, and no calculators/devices are allowed. There are
More informationProcesses Prof. James L. Frankel Harvard University. Version of 6:16 PM 10-Feb-2017 Copyright 2017, 2015 James L. Frankel. All rights reserved.
Processes Prof. James L. Frankel Harvard University Version of 6:16 PM 10-Feb-2017 Copyright 2017, 2015 James L. Frankel. All rights reserved. Process Model Each process consists of a sequential program
More informationIntroduction to the ThreadX Debugger Plugin for the IAR Embedded Workbench C-SPYDebugger
C-SPY plugin Introduction to the ThreadX Debugger Plugin for the IAR Embedded Workbench C-SPYDebugger This document describes the IAR C-SPY Debugger plugin for the ThreadX RTOS. The ThreadX RTOS awareness
More informationTimers 1 / 46. Jiffies. Potent and Evil Magic
Timers 1 / 46 Jiffies Each timer tick, a variable called jiffies is incremented It is thus (roughly) the number of HZ since system boot A 32-bit counter incremented at 1000 Hz wraps around in about 50
More informationProcess Concepts. CSC400 - Operating Systems. 3. Process Concepts. J. Sumey
CSC400 - Operating Systems 3. Process Concepts J. Sumey Overview Concurrency Processes & Process States Process Accounting Interrupts & Interrupt Processing Interprocess Communication CSC400 - Process
More informationEmbedded System Curriculum
Embedded System Curriculum ADVANCED C PROGRAMMING AND DATA STRUCTURE (Duration: 25 hrs) Introduction to 'C' Objectives of C, Applications of C, Relational and logical operators, Bit wise operators, The
More informationCS370 Operating Systems
CS370 Operating Systems Colorado State University Yashwant K Malaiya Fall 2017 Lecture 23 Virtual memory Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 FAQ Is a page replaces when
More informationCS 5460/6460 Operating Systems
CS 5460/6460 Operating Systems Fall 2009 Instructor: Matthew Flatt Lecturer: Kevin Tew TAs: Bigyan Mukherjee, Amrish Kapoor 1 Join the Mailing List! Reminders Make sure you can log into the CADE machines
More informationAn Interrupt is either a Hardware generated CALL (externally derived from a hardware signal)
An Interrupt is either a Hardware generated CALL (externally derived from a hardware signal) OR A Software-generated CALL (internally derived from the execution of an instruction or by some other internal
More informationProcess Coordination and Shared Data
Process Coordination and Shared Data Lecture 19 In These Notes... Sharing data safely When multiple threads/processes interact in a system, new species of bugs arise 1. Compiler tries to save time by not
More informationIntroduction. CS3026 Operating Systems Lecture 01
Introduction CS3026 Operating Systems Lecture 01 One or more CPUs Device controllers (I/O modules) Memory Bus Operating system? Computer System What is an Operating System An Operating System is a program
More informationCSE 451: Operating Systems Winter Lecture 7 Synchronization. Steve Gribble. Synchronization. Threads cooperate in multithreaded programs
CSE 451: Operating Systems Winter 2005 Lecture 7 Synchronization Steve Gribble Synchronization Threads cooperate in multithreaded programs to share resources, access shared data structures e.g., threads
More informationEECS 482 Introduction to Operating Systems
EECS 482 Introduction to Operating Systems Winter 2018 Baris Kasikci Slides by: Harsha V. Madhyastha Use of CVs in Project 1 Incorrect use of condition variables: while (cond) { } cv.signal() cv.wait()
More informationConcurrent Programming
Concurrent Programming Real-Time Systems, Lecture 2 Martina Maggio 19 January 2017 Lund University, Department of Automatic Control www.control.lth.se/course/frtn01 Content [Real-Time Control System: Chapter
More informationConcurrent Programming. Implementation Alternatives. Content. Real-Time Systems, Lecture 2. Historical Implementation Alternatives.
Content Concurrent Programming Real-Time Systems, Lecture 2 [Real-Time Control System: Chapter 3] 1. Implementation Alternatives Martina Maggio 19 January 2017 Lund University, Department of Automatic
More informationC09: Process Synchronization
CISC 7310X C09: Process Synchronization Hui Chen Department of Computer & Information Science CUNY Brooklyn College 3/29/2018 CUNY Brooklyn College 1 Outline Race condition and critical regions The bounded
More informationOperating System. Operating System Overview. Structure of a Computer System. Structure of a Computer System. Structure of a Computer System
Overview Chapter 1.5 1.9 A program that controls execution of applications The resource manager An interface between applications and hardware The extended machine 1 2 Structure of a Computer System Structure
More information3.1 Introduction. Computers perform operations concurrently
PROCESS CONCEPTS 1 3.1 Introduction Computers perform operations concurrently For example, compiling a program, sending a file to a printer, rendering a Web page, playing music and receiving e-mail Processes
More informationOperating Systems. Designed and Presented by Dr. Ayman Elshenawy Elsefy
Operating Systems Designed and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com Email : eaymanelshenawy@yahoo.com Reference
More informationComputer Systems A Programmer s Perspective 1 (Beta Draft)
Computer Systems A Programmer s Perspective 1 (Beta Draft) Randal E. Bryant David R. O Hallaron August 1, 2001 1 Copyright c 2001, R. E. Bryant, D. R. O Hallaron. All rights reserved. 2 Contents Preface
More informationMCUXpresso IDE FreeRTOS Debug Guide. Rev November, 2017
MCUXpresso IDE FreeRTOS Debug Guide User guide 14 November, 2017 Copyright 2017 All rights reserved. ii 1. Introduction... 1 2. LinkServer FreeRTOS Thread Aware Debugging... 2 2.1. Behavior when thread
More informationMemory: Overview. CS439: Principles of Computer Systems February 26, 2018
Memory: Overview CS439: Principles of Computer Systems February 26, 2018 Where We Are In the Course Just finished: Processes & Threads CPU Scheduling Synchronization Next: Memory Management Virtual Memory
More informationWhat s An OS? Cyclic Executive. Interrupts. Advantages Simple implementation Low overhead Very predictable
What s An OS? Provides environment for executing programs Process abstraction for multitasking/concurrency scheduling Hardware abstraction layer (device drivers) File systems Communication Do we need an
More informationIntroduction to Real-Time Operating Systems
Introduction to Real-Time Operating Systems GPOS vs RTOS General purpose operating systems Real-time operating systems GPOS vs RTOS: Similarities Multitasking Resource management OS services to applications
More informationShort Notes of CS201
#includes: Short Notes of CS201 The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with < and > if the file is a system
More informationInterrupts Peter Rounce
Interrupts Peter Rounce P.Rounce@cs.ucl.ac.uk 22/11/2011 11-GC03 Interrupts 1 INTERRUPTS An interrupt is a signal to the CPU from hardware external to the CPU that indicates than some event has occured,
More informationCS 333 Introduction to Operating Systems. Class 3 Threads & Concurrency. Jonathan Walpole Computer Science Portland State University
CS 333 Introduction to Operating Systems Class 3 Threads & Concurrency Jonathan Walpole Computer Science Portland State University 1 Process creation in UNIX All processes have a unique process id getpid(),
More informationMidterm Exam. October 20th, Thursday NSC
CSE 421/521 - Operating Systems Fall 2011 Lecture - XIV Midterm Review Tevfik Koşar University at Buffalo October 18 th, 2011 1 Midterm Exam October 20th, Thursday 9:30am-10:50am @215 NSC Chapters included
More informationMain Points of the Computer Organization and System Software Module
Main Points of the Computer Organization and System Software Module You can find below the topics we have covered during the COSS module. Reading the relevant parts of the textbooks is essential for a
More informationFreeRTOS. Alberto Bosio. February 27, Université de Montpellier Alberto Bosio (UM) FreeRTOS February 27, / 52
FreeRTOS Alberto Bosio Université de Montpellier bosio@lirmm.fr February 27, 2017 Alberto Bosio (UM) FreeRTOS February 27, 2017 1 / 52 Outlook 1 Introduction 2 Task Management 3 Scheduler 4 Queue Management
More informationCS201 - Introduction to Programming Glossary By
CS201 - Introduction to Programming Glossary By #include : The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with
More informationEmbedded Systems. 6. Real-Time Operating Systems
Embedded Systems 6. Real-Time Operating Systems Lothar Thiele 6-1 Contents of Course 1. Embedded Systems Introduction 2. Software Introduction 7. System Components 10. Models 3. Real-Time Models 4. Periodic/Aperiodic
More informationECE 3055: Final Exam
ECE 3055: Final Exam Instructions: You have 2 hours and 50 minutes to complete this quiz. The quiz is closed book and closed notes, except for one 8.5 x 11 sheet. No calculators are allowed. Multiple Choice
More informationFreeRTOS. A Brief Overview. Christopher Kenna. October 1, Avionics. FreeRTOS 1 / 34
A Brief Overview Christopher Kenna Avionics October 1, 2010 1 / 34 Introduction Outline 1 Introduction About Kernel Overview 2 Tasks Tasks versus Co-Routines Task Details 3 IPC and Synchronization Queues
More informationCS 333 Introduction to Operating Systems. Class 3 Threads & Concurrency. Jonathan Walpole Computer Science Portland State University
CS 333 Introduction to Operating Systems Class 3 Threads & Concurrency Jonathan Walpole Computer Science Portland State University 1 The Process Concept 2 The Process Concept Process a program in execution
More informationPreview. Memory Management
Preview Memory Management With Mono-Process With Multi-Processes Multi-process with Fixed Partitions Modeling Multiprogramming Swapping Memory Management with Bitmaps Memory Management with Free-List Virtual
More informationFreeRTOS. A Brief Overview. Christopher Kenna. October 1, Avionics. FreeRTOS 1 / 34
FreeRTOS A Brief Overview Christopher Kenna Avionics October 1, 2010 FreeRTOS 1 / 34 Background Information The FreeRTOS Project supports 25 official architecture ports, with many more community developed
More informationCSE 153 Design of Operating Systems Fall 2018
CSE 153 Design of Operating Systems Fall 2018 Lecture 5: Threads/Synchronization Implementing threads l Kernel Level Threads l u u All thread operations are implemented in the kernel The OS schedules all
More informationCS516 Programming Languages and Compilers II
CS516 Programming Languages and Compilers II Zheng Zhang Spring 2015 Mar 12 Parallelism and Shared Memory Hierarchy I Rutgers University Review: Classical Three-pass Compiler Front End IR Middle End IR
More informationCP2 Revision. theme: dynamic datatypes & data structures
CP2 Revision theme: dynamic datatypes & data structures structs can hold any combination of datatypes handled as single entity struct { }; ;
More informationCS 5523 Operating Systems: Midterm II - reivew Instructor: Dr. Tongping Liu Department Computer Science The University of Texas at San Antonio
CS 5523 Operating Systems: Midterm II - reivew Instructor: Dr. Tongping Liu Department Computer Science The University of Texas at San Antonio Fall 2017 1 Outline Inter-Process Communication (20) Threads
More informationChapter 1 Computer System Overview
Operating Systems: Internals and Design Principles Chapter 1 Computer System Overview Seventh Edition By William Stallings Objectives of Chapter To provide a grand tour of the major computer system components:
More informationModule 9: Virtual Memory
Module 9: Virtual Memory Background Demand Paging Performance of Demand Paging Page Replacement Page-Replacement Algorithms Allocation of Frames Thrashing Other Considerations Demand Segmenation 9.1 Background
More informationProblem Set 2. CS347: Operating Systems
CS347: Operating Systems Problem Set 2 1. Consider a clinic with one doctor and a very large waiting room (of infinite capacity). Any patient entering the clinic will wait in the waiting room until the
More informationOptimal Algorithm. Replace page that will not be used for longest period of time Used for measuring how well your algorithm performs
Optimal Algorithm Replace page that will not be used for longest period of time Used for measuring how well your algorithm performs page 1 Least Recently Used (LRU) Algorithm Reference string: 1, 2, 3,
More informationUniversidad Carlos III de Madrid Computer Science and Engineering Department Operating Systems Course
Exercise 1 (20 points). Autotest. Answer the quiz questions in the following table. Write the correct answer with its corresponding letter. For each 3 wrong answer, one correct answer will be subtracted
More informationCSE 451: Operating Systems Winter Lecture 7 Synchronization. Hank Levy 412 Sieg Hall
CSE 451: Operating Systems Winter 2003 Lecture 7 Synchronization Hank Levy Levy@cs.washington.edu 412 Sieg Hall Synchronization Threads cooperate in multithreaded programs to share resources, access shared
More informationCS 471 Operating Systems. Yue Cheng. George Mason University Fall 2017
CS 471 Operating Systems Yue Cheng George Mason University Fall 2017 Outline o Process concept o Process creation o Process states and scheduling o Preemption and context switch o Inter-process communication
More informationMotivation. Threads. Multithreaded Server Architecture. Thread of execution. Chapter 4
Motivation Threads Chapter 4 Most modern applications are multithreaded Threads run within application Multiple tasks with the application can be implemented by separate Update display Fetch data Spell
More informationCS 550 Operating Systems Spring Interrupt
CS 550 Operating Systems Spring 2019 Interrupt 1 Revisit -- Process MAX Stack Function Call Arguments, Return Address, Return Values Kernel data segment Kernel text segment Stack fork() exec() Heap Data
More informationChapter 3 Process Description and Control
Operating Systems: Internals and Design Principles Chapter 3 Process Description and Control Seventh Edition By William Stallings Process Control Block Structure of Process Images in Virtual Memory How
More informationEmbedded Systems: OS. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University
Embedded Systems: OS Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Standalone Applications Often no OS involved One large loop Microcontroller-based
More informationChapters 9 & 10: Memory Management and Virtual Memory
Chapters 9 & 10: Memory Management and Virtual Memory Important concepts (for final, projects, papers) addressing: physical/absolute, logical/relative/virtual overlays swapping and paging memory protection
More informationParallel Assertion Processing using Memory Snapshots
Parallel Assertion Processing using Memory Snapshots Junaid Haroon Siddiqui Muhammad Faisal Iqbal Derek Chiou UCAS5 26 April 2009 Motivation Importance of Assertions Parallel Assertion Processing Memory
More informationNanoRK. EECE 494 Sathish Gopalakrishnan
NanoRK EECE 494 Sathish Gopalakrishnan Outline Hardware platform for sensor networks The NanoRK operating system Developing applications with NanoRK Some tips and tricks 2 NanoRK feature list C GNU tool
More informationAN HONORS UNIVERSITY IN MARYLAND UMBC. AvrX. Yousef Ebrahimi Professor Ryan Robucci
AvrX https://github.com/kororos/avrx Yousef Ebrahimi Professor Ryan Robucci Introduction AvrX is a Real Time Multitasking Kernel written for the Atmel AVR series of micro controllers. The Kernel is written
More informationHazard Pointers. Number of threads unbounded time to check hazard pointers also unbounded! difficult dynamic bookkeeping! thread B - hp1 - hp2
Hazard Pointers Store pointers of memory references about to be accessed by a thread Memory allocation checks all hazard pointers to avoid the ABA problem thread A - hp1 - hp2 thread B - hp1 - hp2 thread
More informationChapter 8: Virtual Memory. Operating System Concepts
Chapter 8: Virtual Memory Silberschatz, Galvin and Gagne 2009 Chapter 8: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating
More informationSynchronization I. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University
Synchronization I Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Today s Topics Synchronization problem Locks 2 Synchronization Threads cooperate
More informationDSP/BIOS Kernel Scalable, Real-Time Kernel TM. for TMS320 DSPs. Product Bulletin
Product Bulletin TM DSP/BIOS Kernel Scalable, Real-Time Kernel TM for TMS320 DSPs Key Features: Fast, deterministic real-time kernel Scalable to very small footprint Tight integration with Code Composer
More informationMidterm Exam Amy Murphy 6 March 2002
University of Rochester Midterm Exam Amy Murphy 6 March 2002 Computer Systems (CSC2/456) Read before beginning: Please write clearly. Illegible answers cannot be graded. Be sure to identify all of your
More informationModule 9: Virtual Memory
Module 9: Virtual Memory Background Demand Paging Performance of Demand Paging Page Replacement Page-Replacement Algorithms Allocation of Frames Thrashing Other Considerations Demand Segmentation Operating
More informationEECS 482 Introduction to Operating Systems
EECS 482 Introduction to Operating Systems Winter 2018 Harsha V. Madhyastha Monitors vs. Semaphores Monitors: Custom user-defined conditions Developer must control access to variables Semaphores: Access
More informationBackground. Virtual Memory (2/2) Demand Paging Example. First-In-First-Out (FIFO) Algorithm. Page Replacement Algorithms. Performance of Demand Paging
Virtual Memory (/) Background Page Replacement Allocation of Frames Thrashing Background Virtual memory separation of user logical memory from physical memory. Only part of the program needs to be in memory
More informationChapter 9: Virtual Memory
Chapter 9: Virtual Memory Multiprogramming Memory Management so far 1. Dynamic Loading The main Program gets loaded into memory Routines are stored in Relocatable Load format on disk As main program (or
More informationTCSS 422: OPERATING SYSTEMS
TCSS 422: OPERATING SYSTEMS fork() Process API, Limited Direct Execution Wes J. Lloyd Institute of Technology University of Washington - Tacoma Creates a new process - think of a fork in the road Parent
More informationPredictable Interrupt Management and Scheduling in the Composite Component-based System
Predictable Interrupt Management and Scheduling in the Composite Component-based System Gabriel Parmer and Richard West Computer Science Department Boston University Boston, MA 02215 {gabep1, richwest}@cs.bu.edu
More informationChapter 4. Enhancing ARM7 architecture by embedding RTOS
Chapter 4 Enhancing ARM7 architecture by embedding RTOS 4.1 ARM7 architecture 4.2 ARM7TDMI processor core 4.3 Embedding RTOS on ARM7TDMI architecture 4.4 Block diagram of the Design 4.5 Hardware Design
More informationComputer System Overview
Computer System Overview Chapter 1 Muhammad Adri, MT 1 Operating System Exploits the hardware resources of one or more processors Provides a set of services to system users Manages secondary memory and
More informationDealing with Issues for Interprocess Communication
Dealing with Issues for Interprocess Communication Ref Section 2.3 Tanenbaum 7.1 Overview Processes frequently need to communicate with other processes. In a shell pipe the o/p of one process is passed
More informationProcesses and Non-Preemptive Scheduling. Otto J. Anshus
Processes and Non-Preemptive Scheduling Otto J. Anshus Threads Processes Processes Kernel An aside on concurrency Timing and sequence of events are key concurrency issues We will study classical OS concurrency
More informationMemory management. Requirements. Relocation: program loading. Terms. Relocation. Protection. Sharing. Logical organization. Physical organization
Requirements Relocation Memory management ability to change process image position Protection ability to avoid unwanted memory accesses Sharing ability to share memory portions among processes Logical
More informationCSC 2405: Computer Systems II
CSC 2405: Computer Systems II Dr. Mirela Damian http://www.csc.villanova.edu/~mdamian/csc2405/ Spring 2016 Course Goals: Look under the hood Help you learn what happens under the hood of computer systems
More informationMicrium µc/os II RTOS Introduction EE J. E. Lumpp
Micrium µc/os II RTOS Introduction (by Jean Labrosse) EE599 001 Fall 2012 J. E. Lumpp μc/os II μc/os II is a highly portable, ROMable, very scalable, preemptive real time, deterministic, multitasking kernel
More informationUsing the FreeRTOS Real Time Kernel
Using the FreeRTOS Real Time Kernel NXP LPC17xx Edition Richard Barry iii Contents List of Figures... vi List of Code Listings... viii List of Tables... xi List of Notation... xii Preface FreeRTOS and
More informationPhysical memory vs. Logical memory Process address space Addresses assignment to processes Operating system tasks Hardware support CONCEPTS 3.
T3-Memory Index Memory management concepts Basic Services Program loading in memory Dynamic memory HW support To memory assignment To address translation Services to optimize physical memory usage COW
More informationEmbedded Systems: OS
Embedded Systems: OS Jinkyu Jeong (Jinkyu@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu ICE3028: Embedded Systems Design, Fall 2018, Jinkyu Jeong (jinkyu@skku.edu) Standalone
More informationThis section covers the MIPS instruction set.
This section covers the MIPS instruction set. 1 + I am going to break down the instructions into two types. + a machine instruction which is directly defined in the MIPS architecture and has a one to one
More informationOPERATING SYSTEM CONCEPTS UNDERSTAND!!! IMPLEMENT!!! ANALYZE!!!
OPERATING SYSTEM CONCEPTS UNDERSTAND!!! IMPLEMENT!!! Processor Management Memory Management IO Management File Management Multiprogramming Protection and Security Network Management UNDERSTAND!!! IMPLEMENT!!!
More information