Top Banner
Chapter 1: Introduction and History Where does the operating system fit in a computing system? What does the operating system achieve? What are the general OS functions? Who needs an operating system? What is operating system? History of operating system
21

Chapter 1: Introduction and History

Feb 07, 2016

Download

Documents

jennis

Chapter 1: Introduction and History. Where does the operating system fit in a computing system? What does the operating system achieve? What are the general OS functions? Who needs an operating system? What is operating system? History of operating system. Where does the OS fit in?. - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Chapter 1: Introduction and History

Chapter 1: Introduction and HistoryWhere does the operating system fit in

a computing system?What does the operating system

achieve?What are the general OS functions?Who needs an operating system?What is operating system?History of operating system

Page 2: Chapter 1: Introduction and History

Where does the OS fit in?

The layer between the hardware and the user program (application programs).

OS is a software system that directly interacts with the hardware.

Operating system Operating system interface

Hardware

User programs

Hardware interface

Page 3: Chapter 1: Introduction and History

Hardware CPU, registers, disks, monitors, etc

Hardware interface the instruction set other things like interrupt – anything that a programmer

needs to know in order to write programs that use the hardware.

Operating system Implements the OS interface + resource management

OS interface The enhanced instruction set: hardware instruction set +

special instructions called “traps” or “system calls”. User programs:

Instructions in the enhanced instruction set + data

Page 4: Chapter 1: Introduction and History

Question: How many of you have dealt with the OS (enhanced) interface before? One more layer between a typical user program

and the OS interface, the programming environment (compiler + run time library).

cout << “hello world.\n” write(1, “hello world.\n”, 13);

Operating system Operating system interface

Hardware

User programs

Hardware interface

programming environment

Page 5: Chapter 1: Introduction and History

What does the OS achieve? Make it easy to write programs

Add more powerful instructions to the hardware instruction set.

What kind of instructions are added? Common functions used by many different applications. E.g. write (fileno, buf, len);

Resource virtualization E.g. the illusion of Infinite memory.

Page 6: Chapter 1: Introduction and History

What does the OS achieve? Make it easy to run programs

How does a program run on the raw machine? The program is in memory, starting from program counter (pc), run one instruction, goto the next instruction, run until the halt instruction.

How do you run a program? g++ helloworld.cpp and then a.out.

Page 7: Chapter 1: Introduction and History

The OS must fill the gap between how you run a program and how the hardware runs a program. The OS must be able to: Take the user command (g++, a.out, etc) – shell Find the executable file (g++ or a.out) – File system Load the executable into memory – memory management Set the registers properly (e.g. pc = starting address of the

executable) When there are multiple programs running, the OS must

make each program feel like it solely owns the whole machine (CPU, memory, registers) – virtual machine for each process

Manage processes. OS functionality: Implements the OS interface

+ resource management

Page 8: Chapter 1: Introduction and History

What does an OS achieve? It hides the complexity and limitations of

hardware (hardware interface) and creates a simpler, more powerful abstraction (OS interface).

Page 9: Chapter 1: Introduction and History

Hardware reality vs. OS abstraction

Reality AbstractionA single CPU Multiple CPUs

Limited RAM capacity Infinite capacity

Mechanical disk Memory speed access

Insecure and unreliable networks

Reliable and secure

Many physical machines

A single machine

Page 10: Chapter 1: Introduction and History

What are the general OS functions?Standard services

Screen display, disk accesses, etcCoordination among applications

Protection, correctness, efficiency, and fairness

Page 11: Chapter 1: Introduction and History

Coordination Example: Protection

Applications should not crash one another Address space: all memory addresses that an application

can touch. Address space for one process is separated from address

space for another process and from the OS. Applications should not crash the OS

Dual-mode operations Kernel mode: some instructions can only be executed by the

OS (must be executed with a kernel mode). User mode: an application can only access its own address

space Examples of kernel mode instructions?

Page 12: Chapter 1: Introduction and History

What is the operating system? OS is the software layer between the

hardware and user programs. OS is the ultimate API. OS is the first program that runs when the

computer boots up. OS is the program that is always running. OS is the resource manager. OS is the creator of the virtual machine.

Page 13: Chapter 1: Introduction and History

Resources managed by OSCPU: process managementMemory: memory managementStorage: storage and file management I/O devices: I/O management

Page 14: Chapter 1: Introduction and History

Who needs OS?OS makes a computer easier to use

All general purpose computers need OS.A better question: Who does not need

OS? Some very specialized systems that

usually do one thing (OS can be embedded in the application).

Microwave oven control MP3 players, etc.

Page 15: Chapter 1: Introduction and History

History of OS: Change!

1980 2000 Factor

Speed CPU 1 MIPS 1,000 MIPS 1,000Memory 500 ns 2 ns 250

Disk 18 ms 2 ms 9

Modem 300 bits/sec 56 Kbits/sec 200

Capacity Memory 64 Kbytes 128 Mbytes 2,000Disk 1 Mbytes 6 Gbytes 6,000

Cost Per MIP $100K <= $1 100,000Other Address bits 8 64 8

Users/machine 10s <=1 .01

Page 16: Chapter 1: Introduction and History

History Phase I: Hardware Expensive, Humans CheapHardware: mainframesOS: human operators

Handle one job (a unit of processing) at a time

Computer time wasted while operators walk around the machine room

Page 17: Chapter 1: Introduction and History

OS Design GoalEfficient use of the hardware

Batch system: collects a batch of jobs before processing them and printing out results

Job collection, job processing, and printing out results can occur concurrently

Multiprogramming: multiple programs can run concurrently

Example: I/O-bound jobs and CPU-bound jobs

Page 18: Chapter 1: Introduction and History

History Phase II: Hardware Cheap, Humans ExpensiveHardware: terminalsOS design goal: more efficient use of

human resources Timesharing systems: each user can

afford to own terminals to interact with machines

Page 19: Chapter 1: Introduction and History

History Phase III: Hardware Very Cheap, Humans Very ExpensiveHardware: personal computersOS design goal: allowing a user to

perform many tasks at the same time Multitasking: the ability to run multiple

programs on the same machine at the same time

Multiprocessing: the ability to use multiple processors on the same machine

Page 20: Chapter 1: Introduction and History

History Phase IV: Distributed SystemsHardware: computers with networksOS design goal: ease of resource

sharing among machines

Page 21: Chapter 1: Introduction and History

The Bottom Line

OS designs need to adapt to changing technology