Sei sulla pagina 1di 21

Introduction to Operating Systems

Chapter 1

4/16/2014

Crowley

OS

Chap. 1

Key concepts in chapter 1


Multilevel implementation
also called layered

Resources
Hardware: provided to the OS Logical (a.k.a. virtual): created by the OS

Resource management
transformation multiplexing
time and space
4/16/2014 Crowley OS Chap. 1 2

Levels in a computer system

4/16/2014

Crowley

OS

Chap. 1

Design Technique: Two-level implementation


Two-level implementation : Uses Divide and Conquer Strategy: Diving Problem in 2 parts Lower level is a problem-specific language: Programming Language eg. 4GL Languages for producing reports from database Data management 4GLs such as SAS, SPSS and Stata provide sophisticated coding commands for data manipulation, file reshaping, case selection and data documentation in the preparation of data for statistical analysis and reporting. Upper level solves the problem at hand Lower level is reusable In operating systems mechanism: lower level of basic functions, does not change policy: upper level policy decisions, easy to change and experiment
4/16/2014 Crowley OS Chap. 1 4

Operating system functions


Resource manager
manage hardware and software resources

Virtual machine manager


implement a virtual machine for processes to run in a nicer environment than the bare hardware

4/16/2014

Crowley

OS

Chap. 1

Hardware resources
Processor: execute instructions Memory: store programs and data Input/output (I/O)controllers: transfer to and from devices Disk devices: long-term storage Other devices: conversion between internal and external data representations

4/16/2014

Crowley

OS

Chap. 1

Hardware resources

4/16/2014

Crowley

OS

Chap. 1

Resource Management functions


Transforming: Creating new resources from existing ones. physical resources to logical resources
Making the resources easier to use

Multiplexing: Creating an Illusion of several resources from one resource one physical resource to several logical resources
Creating multiple, logical copies of resources

Scheduling physical and logical resources Deciding who gets to use the resources

4/16/2014

Crowley

OS

Chap. 1

Types of multiplexing
Time multiplexing
time-sharing scheduling a serially-reusable resource among several users

Space multiplexing
space-sharing dividing a multiple-use resource up among several users
4/16/2014 Crowley OS Chap. 1 9

Virtual computers
Processor virtualized to processes
mainly time-multiplexing

Memory virtualized to address spaces


space and time multiplexing

Disks virtualized to files


space-multiplexing transforming

4/16/2014

Crowley

OS

Chap. 1

10

Multiple virtual computers in OS


Creates multiple processess, Creates multiple address space, Implements a file system

4/16/2014

Crowley

OS

Chap. 1

11

Virtual Computer
It is a computer implemented in software using hardware resources of physical computer Computer has four parts: processor, primary memory, I/O and secondary memory Multiplexing is done by breaking physical resources in discrete pieces and these pieces are put together to create virtual resources Lets see each to see diff between VC and PC
4/16/2014 Crowley OS Chap. 1 12

Virtual Processor
Has same set of instructions as PC as it is implemented by using the physical processor directly. The OS will switch the services of the physical processor between the virtual computers to implement virtual processors The OS removes some physical processor instructions and adds some other operations. The instructions it removes are the ones that controls the physical resources (processor, memory, I/O) These instructions are system calls: They allow Create new virtual computer Communicate with other virtual computer Allocate memory Do I/o Access a sophisticated file system
4/16/2014 Crowley OS Chap. 1 13

Time-multiplexing the processor

4/16/2014

Crowley

OS

Chap. 1

14

Space-multiplexing memory

4/16/2014

Crowley

OS

Chap. 1

15

Time-multiplexing I/O devices

4/16/2014

Crowley

OS

Chap. 1

16

Space-multiplexing the disk

4/16/2014

Crowley

OS

Chap. 1

17

Do we need an OS?
Not always
Some programs run stand-alone

But they are very useful


Reusable functions Easier to use than the bare hardware

4/16/2014

Crowley

OS

Chap. 1

18

Metric prefixes
decisecond: 10-1 sec. ds centiecond: 10-2 sec. cs millisecond: 10-3 sec. ms microsecond: 10-6 sec. s nanosecond: 10-9 sec. ns picosecond: 10-12 sec. ps femptosecond: 10-15sec.fs attoseond: 10-18 sec. as dekabyte: 101 bytes:Dbyte hectobyte: 102 bytes:Hbyte kilobyte: 103 bytes:Kbyte megabyte: 106 bytes:Mbyte gigabyte: 109 bytes:Gbyte terabyte: 1012 bytes:Tbyte petabyte: 1015 bytes:Pbyte exabyte: 1018 OS Chap. 1 19 bytes:Exabyte

4/16/2014

Crowley

Theory Assignment
1. What are the activities of resource management? What are five main resources in a computer System 2. What are the advantages of virtualizing a hardware resource 3. What do you mean by transforming a resource 4. Whate are four resources of a virtual computer 5. Define : Multiplexing and its advantages 6. What hardware instructions are removed from virtual processor? Why are they removed? How are they removed? What are they replaced with? 7. Explain difference between sharing a resource and multiplexing a resource 8. What is millionth of a second called? How is billion bytes defined?
4/16/2014 Crowley OS Chap. 1 20

Add this theory assignment to your file


A window system manages three hardware resources: the display, the mouse and the keyboard. Discuss the window system as an OS. What are the virtual resources? What things are multiplexed and how? Are the resources transformed for easier use? Imagine a program to control a microwave oven. What OS Ssytem like Functions would it need? Resource Management? Transformation of resources? Multiplexing of resources?
4/16/2014 Crowley OS Chap. 1 21