Presentation is loading. Please wait.

Presentation is loading. Please wait.

Intro and System Overview

Similar presentations


Presentation on theme: "Intro and System Overview"— Presentation transcript:

1 Intro and System Overview
Operating Systems Intro and System Overview Operating Systems: Internals and Design Principles, 8th ed., Stallings Modern Operating Systems, 5th ed., Tanenbaum and Bos

2 Intro Intros Course Policy Syllabus, Textbook Learning Objectives

3 Outline OS Evolution Modern OS Developments System Components
The Execution Cycle Interrupts The Memory Hierarchy Input and Output Multiprocessors

4 Learning Objectives Describe the key functions of an OS
Discuss the evolution of operating systems, and explain each major achievement Define and discuss virtual machines Explain OS design issues raised by multiprocessing

5 Learning Objectives Name and describe the function of common components in a computer system Describe the typical CPU instruction cycle Explain the operation of CPU interrupts Describe the memory hierarchy, and how its various elements interact Explain the difference between programmed I/O, interrupt-driven I/O, and DMA Understand multiprocessor architecture differences

6 OS Evolution

7 Operating System A program that controls the execution of application programs An interface between applications and hardware Main objectives of an OS Convenience Efficiency Adaptability (image: XKCD)

8 Operating System Services
Program development Program execution Access to I/O devices Controlled access to files System access Error detection and response Accounting A computer is a set of resources for the movement, storage, and processing of data The OS is responsible for managing these resources. (image: XKCD)

9 Evolution of Operating Systems
Serial processing No OS: programmers work directly with hardware Users have access to the computer in “series” Lots of setup time required Simple batch systems Multiprogrammed batch systems Time-sharing systems

10 Simple Batch Systems Monitor: program that switches jobs
User no longer has direct access to the processor Monitor is always in memory Operator batches jobs together and places them on an input device Each program branches back to the monitor when finished Monitor runs in kernel mode, user jobs run in user mode Example: IBM 701 (~1953) IBM 701 (image: IBM)

11 Batch Multiprogramming
Memory is expanded to hold multiple programs Programs, or "jobs," are not interactive with terminal/user Controller switches between them without waiting for program completion Example: UNIVAC 1107 / EXEC II (~1962) UNIVAC 1107 (image: fourmilab.ch)

12 Time-Sharing Systems Can be used to handle multiple interactive jobs
Processor time is shared among multiple users Multiple users simultaneously access system terminals OS interleaves the execution of each user program in a short burst, or quantum, of computation Example: CTSS / IBM7094 (mid-late 1960s) Comparison of Multiprogramming Systems IBM (image: IBM)

13 Modern OS Developments

14 Process Fundamental to the structure of operating systems
A process can be defined as: A program in execution An instance of a running program The entity that can be assigned to, and executed on, a processor A unit of activity characterized by at least one sequential thread of execution, a current state, and an associated set of system resources

15 Components of a Process
A process contains three components: An executable program The associated data needed by the program The execution context of the program Execution Context Internal data the OS uses to supervise and control a process Register contents Process priority Status: run, suspend, blocked, etc.

16 Modern OS Developments
Monolithic Kernel Common until ~1990s Single process for everything - scheduling, file system, device drivers, memory management, etc. Single shared address space Microkernel Kernel has only the most essential functions: scheduling, address space, IPC, etc. All other OS services implemented separately, called as needed Microkernel Advantages Flexibility Fault tolerance Speed Simpler implementation

17 Microkernels Most OS services run as modules that the kernel can load as needed The kernel contains only the most vital OS components Simplified structure of the MINIX 3 system

18 Modern OS Developments
Multithreading: a process is divided into threads, which may run concurrently Process: a collection of one or more threads, and associated system resources Thread: a dispatchable unit of work, which includes the process' context Symmetric Multiprocessing (SMP) OS may take advantage of SMP by scheduling threads appropriately

19 Modern OS Developments
Distributed operating system Provides the illusion of: A single main memory space A single secondary memory space Unified file system and other features Object oriented design Improves OS extensibility, eases development Examples: .NET framework, Objective-C/Cocoa

20 Virtualization Enables a single PC or server to simultaneously run multiple OS's or sessions of an OS A machine can host numerous applications, including those for a different OS, on one platform Host OS can support a number of VMs

21 Type I VMM - sees hardware state
Virtualization Type I - VMM/Hypervisor runs on hardware Examples: VMware ESX, Xen Type II - VMM/Hypervisor is 'hosted' Examples: VMware Workstation, Parallels, VirtualBox Hardware Type II VMM Guest OS #1 #2 Apps for OS #1 OS #2 Apps for Host OS Host Operating System Hardware Type I VMM - sees hardware state Guest OS #1 #2 #3 Apps for OS #1 OS #2 Apps for OS #3

22 OS Design for Multiprocessing
Concurrent processes or threads Re-entrant kernel routines, etc. Scheduling Synchronization Mutual exclusion and event ordering Memory management Reliability Graceful degradation if a processor fails (image: yogamammaexhales.blogspot.com)

23

24 Computer System Overview

25 Operating System Functions
Employs hardware resources of one or more processors Provides a set of services to system users Manages secondary memory and I/O devices

26 Key Interfaces Instruction set architecture (ISA)
Components: registers, flags, timers, interrupts, etc. Machine code instruction definitions Examples: IA64, x86, MIPS, SPARC Application binary interface (ABI) Conventions: e.g. 2's complement, big endian, etc. How functions are called and arguments are passed How the OS should manage syscalls Format of binary executable files Application programming interface (API) Exported to applications by the OS

27 Computer System Elements
Processor (or CPU) Controls system operation Main Memory Volatile, stores data and programs Also called "real memory" or "primary memory" I/O Modules Move data between computer and external environment, such as hard disk, display, keyboard, etc. System Bus Facilitates communication among processors, main memory, and I/O modules

28 Special-Purpose Processors
GPUs - graphical processing units Efficient computation on arrays using Single-Instruction Multiple Data (SIMD) Numeric processing, physics simulations, games, large spreadsheet computation Parallel computing standards: CUDA, OpenCL DSPs - digital signal processors Streaming audio or video ('codecs'), encryption Radeon HD 7970M (image: diit.cz) 28nm, OpenGL, DirectX, 2.2 TFLOPS, 75W (image: ti.fleishman.de)

29 Special-Purpose Processors
SoC - system on chip Components like DSP, GPU, main memory, cache, and I/O controllers can all go onto a single chip (or "die") May include analog and mixed-signal components Often used in embedded applications A8X SoC for iPad Air 2: Tri-core ARM v8 CPU Eight-core PowerVR GPU (image: anandtech.com)

30 CPU and Execution

31 CPU Components Registers Program Status Word (PSW) Execution Pipeline
General Purpose (x86: $EAX, $EBX, $ECX, $EDX) Base Pointer ($EBP in x86) Instruction Pointer ($EIP in x86) May be called Program Counter Stack Pointer ($ESP in x86) Program Status Word (PSW) Conditions, flags, etc. Set by instructions, comparisons, CPU mode, etc. Execution Pipeline

32 Execution Pipeline Simple Processor Superscalar Execution

33 Memory

34 Memory Going down the hierarchy: Decreasing cost per bit
Increasing capacity Increasing access time Decreasing frequency of access by the processor

35 Memory Levels CPU Registers Cache Internal Memory Secondary Storage
Access in as little as 1 clock cycle Cache Invisible to the OS Exploits the principle of locality Internal Memory Usually volatile Secondary Storage Usually external, non-volatile Used for programs and files

36 Cache Principles Contains a copy of a portion of main memory
Processor first checks cache If not found, a block of memory is read into the cache single-level cache multi-level cache

37 Memory (a) A quad-core chip with a shared L2 cache (b) A quad-core chip with separate L2 caches

38 Memory Performance 5:1 106:1 Main Memory Cache (RAM vs. Cache)
Virtual Memory (Paging) (Disk vs. RAM) Disk Cache (Disk swapfile) Typical Access Time Ratios 5:1 106:1 Management System Hardware Hardware and Software Software Typical Block Size 4-128 bytes bytes Processor Access Direct Indirect

39 Locality Spatial Locality Temporal Locality
Tendency of execution to involve a number of memory locations that are clustered Temporal Locality Tendency for a processor to access memory locations that have been used recently

40 Input and Output

41 Programmed I/O The I/O module performs the requested action then sets the appropriate bits in the I/O status register The processor polls the I/O module status System performance is severely degraded

42 Interrupt-Driven I/O Processor issues an I/O command to a module, then goes on to do some other useful work I/O module interrupts processor when it has acquired the data in a buffer Processor transfers the data from buffer to memory More efficient than Programmed I/O, but still requires the processor to transfer the data

43 Direct Memory Access (DMA)
Performed by a separate module on the system bus Transfers the entire block of data directly to and from memory without going through the processor More efficient than interrupt-driven or programmed I/O Processor issues a command to the DMA module containing: Read or write I/O device address Starting address in memory Number of words to be read/written

44 Intel x86 System Structure Example
Buses Intel x86 System Structure Example

45 Multiprocessor Architectures

46 Multiprocessing SMP - Symmetric multiprocessors Advantages
Two or more similar processors of comparable capability All processors can perform the same functions Interconnected, share main memory and I/O Advantages Performance Scalability Fault tolerance

47 Multiprocessing Multicore
Two or more processors (cores) on a single die Each core has execution unit, registers, local cache Core may employ multiple threads Intel Core-i7 990X

48

49 Multiprocessing Challenges Workload balance (scheduling)
Fault redundancy Scalability of intercommunications (bus traffic) Coherency of distributed operations Cache coherency Instruction ordering

50 Summary OS Evolution Modern OS Developments System Components
The Execution Cycle Interrupts The Memory Hierarchy Input and Output Multiprocessors


Download ppt "Intro and System Overview"

Similar presentations


Ads by Google