Chapter 10 Operating Systems. Chapter Goals A little History of Operating Systems Be familiar with current Major Operating Systems Contrast Applications.

Slides:



Advertisements
Similar presentations
Objectives Overview Define an operating system
Advertisements

Operating System CS105. Objectives Role of an operating system Manages resources – Memory – CPU – Secondary storage – I/O devices Memory CPU Hard Disk.
Chapter 10 Operating Systems.
Chapter 10 Operating Systems. 2 Chapter Goals Describe the two main responsibilities of an operating system Define memory and process management Explain.
Operating Systems High Level View Chapter 1,2. Who is the User? End Users Application Programmers System Programmers Administrators.
Dr Mohamed Menacer College of Computer Science and Engineering Taibah University CS-334: Computer.
Memory Design Example. Selecting Memory Chip Selecting SRAM Memory Chip.
Operating System Support Focus on Architecture
Chapter 10 Operating Systems. 2 Chapter Goals Describe the two main responsibilities of an operating system Define memory and process management Explain.
Phones OFF Please Operating System Introduction Parminder Singh Kang Home:
CS 104 Introduction to Computer Science and Graphics Problems
Memory Management 2010.
Understanding Operating Systems 1 Overview Introduction Operating System Components Machine Hardware Types of Operating Systems Brief History of Operating.
Chapter 8 Operating System Support
Memory Management 1 CS502 Spring 2006 Memory Management CS-502 Spring 2006.
CS-3013 & CS-502, Summer 2006 Memory Management1 CS-3013 & CS-502 Summer 2006.
Computer Organization and Architecture
1 DOS with Windows 3.1 and 3.11 Operating Environments n Designed to allow applications to have a graphical interface DOS runs in the background as the.
Chapter 10 Operating Systems. 2 Chapter Goals Describe the two main responsibilities of an operating system Define memory and process management Explain.
CS364 CH08 Operating System Support TECH Computer Science Operating System Overview Scheduling Memory Management Pentium II and PowerPC Memory Management.
Operating Systems. Software Software – the instructions that make the CPU do useful things Divided into two main categories – System software – Applications.
Layers and Views of a Computer System Operating System Services Program creation Program execution Access to I/O devices Controlled access to files System.
Computer Organization and Architecture Operating System Support Chapter 8.
Basics of Operating Systems March 4, 2001 Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard.
Chapter 10 Operating Systems. 2 Chapter Goals Describe the two main responsibilities of an operating system Define memory and process management Explain.
Learning Outcomes At the end of this lesson, students should be able to: State the types of system software – Operating system – Utility system Describe.
Week 6 Operating Systems.
Lesson 4 Computer Software
Chapter 3 Operating Systems Introduction to CS 1 st Semester, 2015 Sanghyun Park.
Chapter 10 Operating Systems.
Chapter 10 Operating Systems Nell Dale • John Lewis.
Chapter 10 Operating Systems *. 2 Chapter Goals Describe the main responsibilities of an operating system Define memory and process management Explain.
Review of Memory Management, Virtual Memory CS448.
CPS120: Introduction to Computer Science Operating Systems Nell Dale John Lewis.
The Operating Systems Layer
Chapter 5 Operating System Support. Outline Operating system - Objective and function - types of OS Scheduling - Long term scheduling - Medium term scheduling.
Chapter 10 Operating Systems.
CIS250 OPERATING SYSTEMS Memory Management Since we share memory, we need to manage it Memory manager only sees the address A program counter value indicates.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Overview Part 2: History (continued)
Memory Management – Page 1 of 49CSCI 4717 – Computer Architecture Memory Management Uni-program – memory split into two parts –One for Operating System.
Virtual Memory Virtual Memory is created to solve difficult memory management problems Data fragmentation in physical memory: Reuses blocks of memory.
10-1 Software Categories Application software Software written to address specific needs—to solve problems in the real world Word processing programs,
Main Memory. Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation Example: The.
We will focus on operating system concepts What does it do? How is it implemented? Apply to Windows, Linux, Unix, Solaris, Mac OS X. Will discuss differences.
Chapter 11: Operating System Support Dr Mohamed Menacer Taibah University
Chapter 1 Basic Concepts of Operating Systems Introduction Software A program is a sequence of instructions that enables the computer to carry.
Chapter 10 Operating Systems. 2 Chapter Goals Describe the responsibilities of an operating system Define memory and process management Explain how timesharing.
Operating Systems Overview Basic Computer Concepts Operating System What does an operating system do  A computer’s software acts similarly with.
Computer Operating Systems And Software applications.
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials – 8 th Edition Chapter 2: The Linux System Part 4.
Operating System Basics. Outline The User Interface Running Programs Managing Files Managing Hardware Utility Software.
CT101: Computing Systems Introduction to Operating Systems.
1 OPERATING SYSTEMS. 2 CONTENTS 1.What is an Operating System? 2.OS Functions 3.OS Services 4.Structure of OS 5.Evolution of OS.
Copyright © 2003 by Prentice Hall 1 Computers: Tools for an Information Age Chapter 3 Operating Systems: Software in the Background BSM025 Computers.
Chapter 10 Operating Systems.
Operating Systems What an Operating System is.
Chapter 2: The Linux System Part 4
Memory Management.
Chapter 2 Memory and process management
System Software EIT, © Author Gay Robertson, 2016.
William Stallings Computer Organization and Architecture
Chapter 10 Operating Systems.
Chapter 15 – Part 1 The Internal Operating System
Operating Systems.
Chapter 10 Operating Systems.
Mid-Term Review Good Results Always Answer Questions
Chapter 1: Introduction
COMP755 Advanced Operating Systems
Presentation transcript:

Chapter 10 Operating Systems

Chapter Goals A little History of Operating Systems Be familiar with current Major Operating Systems Contrast Applications Software and Systems Software Describe the main responsibilities of an operating system 10-2

3 More Chapter Goals (OS Responsibilities) memory and process management timesharing and the virtual machine illusion logical and physical addresses memory management techniques

4 More Chapter Goals (OS Responsibilities) fixed and dynamic memory partitions demand paging and the virtual memory illusion stages and transitions of the process life cycle CPU scheduling algorithms

2 Kinds of Software Application software – Software written to address specific needs – To solve problems in the real world – The reason you buy the machine System software – Software that manages a computer system at a fundamental level – It provides the tools and an environment in which application software can be created and run 10-5

Application Software Word processing programs, games, inventory control systems, automobile diagnostic programs, and missile guidance programs are all application software The stuff you want 10-6

Systems Software Operating Systems, File Systems Software, Utilities (Disk Defragmenter), Compilers, Maybe a Web Browser The stuff you need 10-7

Major OS’s Unix Windows Linux Mac OS Embedded OS’s (Android, iOS) Real-Time OS’s 10-8

Which is the BEST OS?? NONE are “best” Consumer POV – Buy whatever turns you on Professional POV – Cost, tasks, maintenance, support, legacy issues, popularity (network effects), etc. 10-9

A Little History - Mainframes Mainframes – from Earliest computers had no OS at all! 2.Proprietary (custom) OS’s 3.VMX 4.Early Unix versions 5.Unix was invented at AT&T Bell Labs 10-10

Mainframe Circa

Mainframe IBM System 360 circa

A Little History - Unix Mainframes were often shared by many users A multiuser OS was needed Unix arose to fill this need – IBM, Digital Equipment Corporation (DEC), Honeywell, Hewlett Packard – Each had their own proprietary version on Unix 10-13

A Little History – Early Personal Computers Microcomputers based on the first integrated CPU chips ~ late 1970’s – MITS Altair 8800 (MS’s big break) – Commodore 64 – Atari ST – TRS 80 – Apple 2 (Apple 1 was a kit) – Each machine had their own proprietary OS (or none at all for the Altair!) 10-14

! THE MICROPROCESSOR ! Intel 8080 – circa

Altair circa

A Little History – PC’s n Macs PC’s and Macs – 1980’s – IBM PC IBM hired MS to supply DOS (A basic command-line OS) MS bought DOS from another party – Apple Macintosh Apple wrote there own GUI OS Apple borrowed the idea from Xerox PARC 10-17

A Little History – Windows OS IBM PC needed a GUI – IBM hired MS to write OS2 for PS2 (not Playstation!) – MS wrote Windows at the same time – Guess who won? – Why did MS win? DOS was a “cash cow” for MS Windows had backward compatibility w DOS PC hardware was cheaper than Mac HW 10-18

What is Linux??? Linux is based on a free source code version of UNIX This source is compiled to Intel CPU machine code Commercial versions are available Internal SW architecture is circa 1960’s (A multi-user OS for a single-user machine) 10-19

What is Linux??? It’s all about the $$$$$$ MONEY $$$$$$ Linus Torvald’s lead the creation of Linux so that he could run UNIX-based code on cheap PC hardware 10-20

Where are the computers?? The machines you SEE – Windows: Almost every desktop in the USA and the world The machines you DON’T SEE – There are lots of UNIX-based machines behind closed doors 10-21

Why is Linux Important Three Main Reasons 1)Academia CS discipline was built with UNIX systems 2)Replacement of legacy hardware Linux on PC is cheaper than “Big Iron” 3)Internet plumbing Is all Unix-based, will not be re-done 10-22

Why is Linux Important Academia There is a lot of code and textbooks written for a UNIX point of view Linux allows you to use this stuff on cheaper hardware 10-23

Why is Linux Important The UNIX Legacy There is a lot of application code running on old expensive Unix mainframe and workstation machines Linux is replacing these machines because it runs on cheaper hardware 10-24

Why is Linux Important The Internet Internet routers and other hardware where originally run on old expensive Unix machines Linux is replacing these machines because it runs on cheaper hardware Learn Linux if you plan to study computing more 10-25

What about Wintell? Windows/Intel machines will probably hang around as legacy systems, boring, but part of the standard infrastructure. The “Platform” is standard and widespread Lots of existing programs for Wintel – it has its own legacy (like UNIX) 10-26

Dominant OS’s: The Recent Past Windows on the “front end” Linux on the “back end” 10-27

Dominant OS’s: Present and Near Future Mini Front End (Simple Interfacing Tasks) – Tablets and Smart Phones Maxi Front End (More demanding specialized work) – Windows Back End (Server processing) – Linux 10-28

LETS GET TECHNICAL A major OS job is to provide: INTERFACES 10-29

OS: Interfaces Figure 10.1 An operating system interacts with many aspects of a computer system.

LETS GET TECHNICAL The OS is there mainly to do what we all learned in Kindergarten: SHARING NICELY 10-31

OS: Resource Management File systems, monitor, keyboard, etc The OS is in charge of making all the application programs “share nicely” Examples: – sending keystrokes to correct application – Placing overlapping windows on the screen – Making sure apps don’t access each others memory 10-32

Operating System Resource Management (Sharing) Process Management (Sharing the CPU) Sharing IO devices Main (Primary Memory) Management (Shared among many programs) Disk (Secondary) Memory) Management (More sharing) 10-33

Process Management Sharing the CPU 10-34

OS: Process Management Process A program in execution Process management keeping track of processes and the states they are in CPU scheduling determines which process in memory is executed by the CPU at any given instant in time 10-35

More History 1950’s-1960’s Batch Processing – One big (expensive) machine – One human operating system – “The Operator” (ala The Matrix) – Several similar jobs were organized into “batches” that required the same resources – Example: Load the compiler Run all the programs to be compiled 10-36

History: Batch Processing Figure 10.2 In early systems, human operators would organize jobs into batches

More History: 1960’s-1970’s Timesharing – One big (expensive) machine – Each user had her own virtual machine, in which all system resources seem to be available for use – In reality, resources are shared Unix was created as a multi-user timesharing operating system 10-38

More History: 1970’s-now Multitasking – Lots of cheap PC machines – Timesharing evolved into multitasking – ONE user running MANY PROGRAMS – Still, resources must be shared by several programs Windows was created as a single-user multitasking operating system 10-39

Process States The Process States Figure 10.8 The process life cycle

The Process Control Block The operating system must manage a large amount of data for each active process Usually that data is stored in RAM in a data structure called a Process Control Block (PCB) The OS maintains one PCB for each process 10-41

Processes are like Several Cooks Sharing ONE Kitchen 10-42

CPU Context Switch There is only one CPU and therefore only one set of CPU registers – These registers contain the values for the currently executing process Each time a process is moved to the running state: – Register values for the currently running process are stored into its PCB – Register values of the new running state are loaded into the CPU – This exchange of information is called a context switch 10-43

CPU Scheduling CPU Scheduling Determining which process in the ready state should be moved to the running state – Many processes may be in the ready state – Only one process can be in the running state, actually running at any one time Which one gets to moved from ready to running? 10-44

CPU Scheduling Nonpreemptive scheduling The currently executing process gives up the CPU voluntarily – Batch Processing, the old Mac OS, Windows 3.1 circa 1990 Preemptive scheduling The operating system decides to favor another process, preempting the currently executing process – Win 9x and later, Unix, and most other modern OS’s 10-45

CPU Scheduling Algorithms First-Come, First-Served – Processes are moved to the CPU in the order in which they arrive in the running state Shortest Job Next – Process with shortest estimated running time in the ready state is moved into the running state first Round Robin – Each process runs for a specified time slice and moves from the running state to the ready state to await its next turn if not finished 10-46

First-Come, First-Served Page 336

Shortest Job Next Looks at all processes in the ready state and dispatches the one with the smallest service time Page 337

Round Robin Distributes the processing time equitably among all ready processes Aka “Taking Turns” The algorithm uses a time slice, which is the amount of time each process is allowed to run before it is the next process’ turn 10-49

Round Robin Suppose the time slice was Page 339

CPU Scheduling Algorithms Are they preemptive or non-preemptive? Explain First-Come, First-Served? Shortest Job Next? Round Robin? 10-51

Memory Management Sharing Primary Memory (RAM) 10-52

Memory Management Memory management The process of keeping track of what programs are in memory and where in memory they reside 10-53

Memory Management Figure 10.3 Memory is a continuous set of bits referenced by specific addresses

The Problem Every Program Wants to be Loaded to RAM address ZERO Address Machine Code B BR Main sum:.WORD 0x num1:.BLOCK num2:.BLOCK num3:.BLOCK 2 000B C10003 Main: LDA sum,d 000E DECI num1,d ADDA num1,d DECI num2,d ADDA num2,d 001A DECI num3,d 001D ADDA num3,d 0020 E10003 STA sum,d DECO sum,d STOP 0027.END Branching wants to jump to some particular address

The Solution Load them elsewhere and LIE TO THEM Aka “Address Relocation” A part of “Memory Management” When programs ask for bytes from some RAM location, the OS will give them bytes from somewhere else 10-56

Memory Management 1.Track where a program resides in memory 2.Convert logical addresses into physical addresses Logical address An address that the program uses – All programs start at logical address ZERO Physical address An actual address in the main memory device – A program may not actually be loaded starting at physical address zero 10-57

Single Contiguous Memory Management The Simplest Way: Only two programs in memory – The operating system – The application program 10-58

Single Contiguous Memory Management A logical address is simply an integer value relative to the starting point of the program To produce a physical address, we add a logical address to the starting address of the program in physical main memory 10-59

Single Contiguous Memory Management 10-60

Partition Memory Management Partitions Main memory is divided into a particular number of partitions Programs are loaded into available partitions Note: A main memory partition is not the same thing as a hard disk partition 10-61

Partition Memory Management memory is divided into a set of partitions, some empty and some allocated to programs Base register A register that holds the beginning address of the current partition Bounds register A register that holds the length of the current partition 10-62

Paged Memory Management Paged memory technique P rocesses are divided into fixed-size pages and stored in memory frames – Frame A piece of main memory that holds a process page – Page A piece of a process that is stored into a memory frame – Page-map table (PMT) A table used by the operating system to keep track of page/frame relationships 10-63

Paged Memory Management To produce a physical address, you first look up the page in the PMT to find the frame number in which it is stored Then multiply the frame number by the frame size and add the offset to get the physical address 10-64

Paged Memory Management Demand paging An important extension of paged memory management – Not all parts of a program actually have to be in memory at the same time – In demand paging, the pages are brought into memory on demand Page swap The act of bringing in a page from secondary memory, which often causes another page to be written back to secondary memory 10-65

Paged Memory Management The demand paging approach gives rise to the idea of virtual memory, the illusion that there are no restrictions on the size of a program Too much page swapping, however, is called thrashing and can seriously degrade system performance