fundamental concepts and historyosdc.hanyang.ac.kr/sitedata/2019_01_under_os/os_02... ·...

39
Fundamental Concepts and History Minsoo Ryu Real-Time Computing and Communications Lab. Hanyang University [email protected]

Upload: others

Post on 31-Jan-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

Fundamental Concepts and

History

Minsoo Ryu

Real-Time Computing and Communications Lab.

Hanyang University

[email protected]

Page 2: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

2

Topics Covered

I. Fundamental Concepts

II. Evolution of OS

Page 3: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

3

Key Concepts of OS

1. Abstraction

2. Protection

3. Illusion

4. Coordination and Optimization

Page 4: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

4

Abstraction

Pick out only key features to reduce complexity

Provide a clean, uniform, and standard interface to

users hiding hardware complexity

▪ e.g.) POSIX APIs (Application Programming Interfaces)

Application S/W

Hardware

Application S/W

Operating System S/W

Hardware

Without OS With OS

Page 5: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

5

OS can be viewed as a Big Library

An organized collection of reusable program code

▪ Bootstrapping, device drivers, scheduling, GUI …

▪ POSIX Standard API implementations

University Library POSIX Standard 1003.1

Page 6: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

6

Typical System Structure

Process &Thread

GUIManager

MemoryManagement

Inter-processManagement

FileSystem

SyncPrimitives

CPUScheduling

NetworkProtocols

System Calls

DeviceDriver

DeviceDriver

Interrupt & ExceptionHandlers

DeviceDriver

DeviceDriver

Processors, Memory, Storage, Network, Sensors, Actuators …

Application 1 Application 2 Application N…

OS

HW

AppLibrary

Page 7: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

7

System Calls vs. Library Calls

System calls provide the interface between

application SW and the operating system

Page 8: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

8

Execution Flow

GUIManager

Scheduler IPC

FileSystem

MemoryManager

System Calls

DeviceDriver

DeviceDriver

DeviceDriver

Processors, Memory, Display, Network, Sensors, Actuators …

OS

HW

write( )

… ( )

read( )

interrupt( )

proc_protocol( )

Application 1 Application 2 Application N…App

Libraryprintf( ) receive( )

… ( )

write( )

Page 9: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

9

Execution Flow without OS

Processors, Memory, Storage, Network, Sensors, Actuators …

SW

HW

interrupt( )wait( )

bootstrap( )

ISR_#1( )

power ON

ISR_#2( )

ISR_#3( )

ISR_#n( )

interrupt

helper_#1( )

helper_#2( )

helper_#m( )

Event Handler Structure

Page 10: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

10

Execution Flow without OS

Processors, Memory, Storage, Network, Sensors, Actuators …

SW

HW

interrupt( )wait( )

bootstrap( )

power ON interrupt

schedule( )

Simple Scheduler Structure

task_#1( )

task_#2( )

task_#3( )

task_#n( )

Page 11: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

11

Protection

OS protects the system from many types of

application faults

Example: separation of each program’s memory

space

▪ Determine the range of legal addresses

▪ Base register – holds the smallest legal memory address.

▪ Limit register – contains the size of the range

▪ Memory outside the defined range is protected

Page 12: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

12

Use of A Base and Limit Register

Page 13: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

13

Hardware Address Protection

Page 14: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

14

Illusion

Make hardware limitations go away

▪ As if there are infinite number of processors (time sharing)

▪ As if there is extremely large memory (virtual memory)

time

Task A

Task B

Task C

Task D

Task A (weight 25.0%)

Task B (weight 12.5%)

Task C (weight 50.0%)

Task D (weight 12.5%)

Time Shared Multitasking Virtual Memory

Page 15: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

15

Coordination and Optimization

Make many things work together efficiently

Concurrency

▪ Multitasking (synchronization and scheduling)

▪ Multi-user support

▪ Multithreading

Efficiency

▪ Overlapped I/O and Processing

• I/O devices and the CPU can execute concurrently

▪ Effective storage management

• Caching, paging, and swapping

▪ Fast interrupt handling

Page 16: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

16

Multitasking and Synchronization

아들아냉장고에 카레 있다. 엄마우리 헤어져!!잘 먹고 잘 살아라!!여자친구

With synchronization

우리 헤어져!!잘 먹고 잘 살아라!!여자친구

write

아들아냉장고에 카레 있다.엄마

아들아 우리헤어져!! 냉장고에카레 잘 먹고 잘살아라!! 있다.여자친구 엄마

Without synchronization

Page 17: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

17

Multitasking and Scheduling

도착알림

메세지도착

메세지도착

도착알림

Page 18: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

II. Evolution of OS

Page 19: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

19

What is the First Computer ?

From B.C 4000

▪ Input and Output

• Physical movements by hands and read by eyes

• No programming and no special I/O devices

▪ Very volatile memory and slow

Abacus !

The first hand-held computer ?

Page 20: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

20

The ENIAC (1946)

The first computer that uses electricity

▪ Technology

• Vacuum tubes

▪ Floor space

• 1,000 square feet

▪ Weight

• 30 tons

▪ Input/Output

• Cards, lights, switches

• Human operators

▪ Speed

• Less than 5,000 operations per second

Page 21: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

21

The History of Computers and OS

Why history?

▪ Hard to define and explain the notion of operating system

▪ Learning about the OS history will help you understand what

it is and how it works

Three phases of History

▪ Phase I: early ’50s – late ‘60s

• Mainframe computers

• Monitor + human operators

▪ Phase II: late ’60s – late ‘90s (modern OS concepts)

• Minicomputers and personal computers

• Advent of UNIX

▪ Phase III: late ‘90s – present (mobile, cloud, and multicore)

Page 22: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

22

Phase I. Mainframe Computers

From 1960s to 1970s

▪ Technology

• Transistors

▪ Input devices

• Panel switches, paper tape,

punched cards

• Card readers, magnetic tape

▪ Output devices

• Display lights on the console

• Line printers

Page 23: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

23

Human Operators

Cost vs. performance of mainframes

▪ Computers were very expensive

• $750,000 plus $185,000

for a high speed printer

▪ Humans were cheap

• Significant amount of setup time

Human programmer/operator

▪ Program, setup, monitor, and debug

▪ Significant amount of setup time

Page 24: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

24

Resident Monitor

A resident monitor can be

considered a primitive

precursor to the operating

system

▪ It governed the machine before

and after each job control card

was executed, loaded and

interpreted each control card,

and acted as a job sequencer

for batch processing

operations

Resident

Monitor

Page 25: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

25

Multiprogrammed Batch Systems

Several jobs are kept▪ in main memory

▪ at the same time

CPU is multiplexed among them▪ Eventually a job may have to wait

for some task such as I/O operation

▪ CPU is switched to another job

Benefit▪ Increase of CPU utilization

▪ Reduction of CPU idle time

Job scheduling is required▪ When multiple programs are ready

IBM 701

Page 26: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

26

Spooling

Emergence of faster I/O devices

▪ Slow mechanical devices

• Card reader -> CPU -> line printer

▪ Fast magnetic devices

• Card reader -> tape drives -> CPU -> tape drives -> line printer

Performance improvement by Spooling

▪ Simultaneous Peripheral Operation On-Line

▪ Spooling overlaps I/O and computation

Page 27: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

27

Phase II. Modern Computers

Since late 1960s

▪ With the advent of microprocessor chips

▪ Minicomputers, workstations, and personal computers

Page 28: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

28

UNIX

Unix is a family of multitasking, multiuser computer

operating systems that derive from the original AT&T

Unix

▪ Development started in the 1970s at the Bell Labs research

center by Ken Thompson, Dennis Ritchie, and others

The pre-history of Unix dates back to the mid-1960s

▪ MIT, Bell Labs, and General Electric were developing an

innovative time-sharing operating system called Multics for

the GE-645 mainframe

▪ Multics introduced many innovations, but had many

problems (the size and complexity)

▪ Bell Labs slowly pulled out of the project and decided to redo

the work on a much smaller scale

Page 29: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

29

UNIX (Phase II)

Page 30: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

30

Multitasking and Multi Users

Multi-programming and multi-tasking

▪ Several programs are kept in main memory

▪ They run at the same time (time-sharing)

Interactive and on-line system

▪ User enters a command and the system executes them

▪ The system seeks the next “control statement” from the

user’s keyboard or mouse

Multi-user environment

▪ Different users can use the computer at the same time

Page 31: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

31

Personal Computers

Personal computers such as the Atari 800, released in

1978, and the BBC Micro, released in 1981

The history of the personal computer as a mass-

market consumer electronic device began in 1981

with the launch of the IBM Personal Computer that

coined both the term Personal Computer and PC

Atari 800 (1978) Xerox Alto (1973) Apple II (1977) IBM 5150 (1981)

Page 32: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

32

Mouse and GUI

The Xerox Alto, developed at Xerox PARC in 1973,

was the first computer to use a mouse, the desktop

metaphor, and a graphical user interface (GUI),

concepts first introduced by Douglas Engelbart

Xerox Alto (1973) Atari ST (1985) Windows 1.0 (1985)

Page 33: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

33

Internet and WWW

ARPANET was the precursor network for academic

and military purposes (1980s)

NSF funding and private funding led to worldwide

participation in the Internet

The World Wide Web is the primary application

▪ A NeXT Computer was used by Tim Berners-Lee at CERN and

became the world's first Web server (1991)

The first

Web server

(HTTP daemon)

Page 34: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

34

Phase III. Mobile, Cloud, and Multicore

The first PDA was released in

1984 by Psion, the Organizer

Typical features

▪ Touch screens and memory cards

▪ Wireless connectivity

▪ Battery-operated

Mobile OSes

▪ Palm OS

▪ Microsoft Windows Mobile with a

Windows CE kernel

Palm TX

(2005)

Motorola

DynaTAC

(1984)

Apple iPhone

(2007)

Page 35: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

35

Windows CE

Page 36: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

36

Cloud Computing

The origin of the term cloud computing in computing

is unclear

▪ The cloud symbol was used to represent networks of

computing equipment in the original ARPANET by as early as

1977 and the CSNET by 1981

▪ The popularization of the term can be traced to 2006 when

Amazon.com introduced its Elastic Compute Cloud

Page 37: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

37

Multicore Computing

Released in 2001, the POWER4 was a multicore

microprocessor, with two cores on a single die, the

first non-embedded microprocessor

▪ In October 2011, a heterogeneous computing architecture,

called big.LITTLE, was announced by ARM Holdings

▪ Linux kernel version 2.0 was released in 1996, the major

feature of 2.0 was multiprocessor support

POWER4 big.LITTLE Apple A5

Page 38: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

38

Migration of Operating-System

Concepts and Features

Page 39: Fundamental Concepts and Historyosdc.hanyang.ac.kr/sitedata/2019_01_Under_OS/OS_02... · 2019-03-10 · 4 Abstraction Pick out only key features to reduce complexity Provide a clean,

39