Docsity

Operating Systems and Multi-tasking: Understanding Process Management and Scheduling - Pro, Study Guides, Projects, Research of Aerospace Engineering

Partial preview of the text

Download Operating Systems and Multi-tasking: Understanding Process Management and Scheduling - Pro and more Study Guides, Projects, Research Aerospace Engineering in PDF only on Docsity!

Last Time

  • Communication through buses
    • System buses– Backplane buses– I/O buses
      • I

2 C Bus– 2-wire– Multi-master

  • Project 4

Today

  • Operating systems• Multitasking

Operating Systems

Operating systems are all about

abstraction…

  • Typically multiple layers in the abstraction• Each layer hides some of the details of

what is below

  • A layer will often unify several components

at lower layers

Common OS Layers

  • Device drivers: direct interface to

hardware

  • Kernel: system management activities• Middleware: provides general high-level

services that may be used by customapplications The precise divisions will vary depending on

the OS and system

Device Drivers

Example• Different disk manufacturers use different

protocols for reading/writing from/to theirdisks

  • A device driver for one type of disk can

make it appear to the rest of the system asany other disk

Kernel

System management services:• Process management: allows us to

separate our programs into multiple,separate tasks (or processes)

  • Memory management: controlled sharing

of memory between processes

  • I/O management:
    • Device sharing (across processes)– Providing key abstractions (e.g., files)

Handling Multiple Tasks/ProcessesWith an interrupt, we implemented two

separate tasks:

  • Main code body (our “something else”)• Interrupt handler: deal with the external or

internal event

Handling Multiple Tasks/ProcessesWith an interrupt, we implemented two

separate tasks:

  • Main code body (our “something else”)• Interrupt handler: deal with the external or

internal event

  • These are essentially separate entities• But: with a little bit of communication

between them

The Multi-Tasking Abstraction

This abstraction is key to building complex

systems

  • We can construct our system as a set of

compartmentalized modules

  • Each module can be implemented and

tested separately

  • It is easy to “mix and match” modules

depending on the application

The Multi-Tasking Abstraction

This abstraction is key to building complex

systems

  • Each process has the “illusion” of owning

the processor all of the time

  • Allows for efficient use of the CPU and

other system resources

An Example: USC AFV

Sensors:•^

Downward-orientedsonars: height andattitude

-^

Compass: yawdirection

-^

Rotor encoder:rotational velocity

-^

Downward-lookingcamera: position onfield

An Example: USC AFV

Actuators:• Rotor collective• Rotor torque• Rotor pitch• Rotor yaw• Rudder

AFV Process Architecture

  • df

Multi-Tasking Components

  • Process control block (PCB): data

structure that describes the process

  • Scheduling: deciding which process to

execute now

  • Inter-task communication: moving data

between processes

  • Synchronization: mechanism for safely

coordinating the actions of two or moreprocesses