Download presentation
Presentation is loading. Please wait.
Published byCatherine Goodwin Modified over 6 years ago
1
EE 472 – Embedded Systems Dr. Shwetak Patel
2
Agenda Lab 2 overview Operating System Tasks Threads Interrupts
Scheduling 2 Shwetak N. Patel - EE 472
3
Embedded Software Execute a specialized program Perform calculations
Access memory Communicate with external devices 3 Shwetak N. Patel - EE 472
4
Operating System Makes your life easier! Executes your code
Does memory management Handles I/O and communications within your program 4 Shwetak N. Patel - EE 472
5
An Embedded Program Task Unit of code Think of it as a C function 5
Shwetak N. Patel - EE 472
6
Scheduler Part of the OS that execute the tasks so they all get a turn. Make decisions about when to run the tasks 6 Shwetak N. Patel - EE 472
7
Types of Tasks Periodic Found in hard-real time applications
Three attributes: P, Period C, Computing Resources D, Deadline 7 Shwetak N. Patel - EE 472
8
Types of Tasks Intermittent Found in all applications Two attributes:
C, Computing Resources D, Deadline 8 Shwetak N. Patel - EE 472
9
Types of Tasks Background Soft-real time Lower priority One attribute:
C, Computing Resources 9 Shwetak N. Patel - EE 472
10
Types of Tasks Complex Continuous need for CPU
Frequent requests for I/O Wait for user input 10 Shwetak N. Patel - EE 472
11
Multitasking Multiple processes running in a program 11
Shwetak N. Patel - EE 472
12
Task States Ready Running Waiting (for something other than CPU)
Preempted or blocked Inactive/Terminated 12 Shwetak N. Patel - EE 472
13
Context Switch A new task is switched in
Need to save the current context Code Data Registers Resources (memory, io, etc) 13 Shwetak N. Patel - EE 472
14
Threads Smaller unit of computation Owned by a process
Like pieces within a process Smaller context 14 Shwetak N. Patel - EE 472
15
Threads Example Web server 15 Shwetak N. Patel - EE 472
16
Processes and Threads 16 Shwetak N. Patel - EE 472
17
Real-Time Operating System
Deterministic Rigid time constraints 17 Shwetak N. Patel - EE 472
18
Scheduler Responsible for dispatching/executing tasks
When and how long to run a task Scheduling strategies Time sharing Priorities 18 Shwetak N. Patel - EE 472
19
Representing a Task Task Control Block (TCB)
Contains information about a task Think of a struct 19 Shwetak N. Patel - EE 472
20
TCB
21
TCB
22
Task or Job Queue Holds a collection of TCBs when a task enters a system Array or list of structs 22 Shwetak N. Patel - EE 472
25
Problems with this approach?
26
Problems with this approach?
Wastes time waiting for input Need to use interrupts
27
Interrupts External event Causes a context switch
Each interrupt has a specific ID Interrupts are found in a interrupt vector table
28
Interrupt Vector Table
Interrupt number Interrupt service routines (ISR)
29
Questions? Next time: Scheduling algorithms
Print out scheduling worksheet Shwetak N. Patel - EE 472
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.