1. introduction - iispl() · 2015-09-09 · cpu moves data from/to main memory to/from local...

30
1. Introduction Yoon Joong Kim Department of Computer Engineering Hanbat National University

Upload: others

Post on 01-Feb-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1. Introduction - IISPL() · 2015-09-09 · CPU moves data from/to main memory to/from local buffers I/O devices and the CPU can execute concurrently. Each I/O device controller is

1. Introduction

Yoon Joong Kim Department of Computer Engineering

Hanbat National University

Page 2: 1. Introduction - IISPL() · 2015-09-09 · CPU moves data from/to main memory to/from local buffers I/O devices and the CPU can execute concurrently. Each I/O device controller is

Operating System

Contents

1. What an Operating System do?(운영체제가 할일) 2. Computer System Organization(컴퓨터 시스템 구성) 3. Computer System Architecture(컴퓨터 시스템 구조) 4. Operating System Structure(운영체제 구조) 5. Operating System Operation(운영체제 연산) 6. Process Management(프로세스 관리) 7. Memory Management(메모리 관리) 8. Storage management(저장장치 관리) 9. Protection and Security(보호 및 보안) 10. Distributed Systems(분산 시스템) 11. Special Purpose System(전용 시스템) 12. Handheld Systems 13. Computing Environments(계산 환경)

2

Page 3: 1. Introduction - IISPL() · 2015-09-09 · CPU moves data from/to main memory to/from local buffers I/O devices and the CPU can execute concurrently. Each I/O device controller is

Operating System

1. What an Operating System do? A program that acts as an intermediary between a user of a computer and

the computer hardware

Operating system goals : Execute user programs Make solving user problems easier Make the computer system convenient to use Use the hardware in an efficient manner

Performance of operating system Throughput --- jobs / sec. system oriented Utilization --- % of time busy system oriented Response time --- sec / job user oriented user oriented index conflicts with system oriented indices 3

Page 4: 1. Introduction - IISPL() · 2015-09-09 · CPU moves data from/to main memory to/from local buffers I/O devices and the CPU can execute concurrently. Each I/O device controller is

Operating System

1. What an Operating System do?(cont.) OS ?

User’s view : service provider System’s view : resource allocator/manager

OS definition Resource allocator

manages and allocates resources Control program

controls the execution of user programs and operations of I/O devices

Kernel - one program running at all times - memory resident all the time

4

Page 5: 1. Introduction - IISPL() · 2015-09-09 · CPU moves data from/to main memory to/from local buffers I/O devices and the CPU can execute concurrently. Each I/O device controller is

Operating System

1. What an Operating System do?(cont.) Operating System Environment Win32 API (application programming interface)

Example programs tested on Windows 2000, Windows XP, Windows Vista, Windows 7

POSIX (Portable Operating System Interface) A set of standards implemented primarily for UNIX-based operating systems POSIX-compliant systems

UNIX, LINUX, Mac OS X POSIX1.b: real-time extensions POSIX1.c: a thread library (pthread) Example programs tested on

Debian Linux 2.4 and 2.6 systems, MAC OS X, Solaris 9 using gcc 3.3 Java

Run on any machine supporting JVM (Java virtual machine) Java programs tested using Java 1.4 JVM

5

Page 6: 1. Introduction - IISPL() · 2015-09-09 · CPU moves data from/to main memory to/from local buffers I/O devices and the CPU can execute concurrently. Each I/O device controller is

Operating System

2 Computer System Computer System components

Hardware CPU, memory, I/O devices

Operating System Intermediary between hardware and software

Application System Word processors, compilers, web browsers, database systems, video games

Users People, machines, other computers

6

Page 7: 1. Introduction - IISPL() · 2015-09-09 · CPU moves data from/to main memory to/from local buffers I/O devices and the CPU can execute concurrently. Each I/O device controller is

Operating System

2 Computer System(cont.) Computer System Organization

Computer System Operation CPU

moves data from/to main memory to/from local buffers I/O devices and the CPU can execute concurrently.

Each I/O device controller is in charge of a particular device type. (control reg, status reg.) has a local buffer. (data register) I/O is from the device to local buffer. Device controller informs CPU that it has finished its operation by causing an interrupt. DMA driven I/O or

Interrupt driven I/O SCSI (Small Computer Systems Interface) controller

7

Page 8: 1. Introduction - IISPL() · 2015-09-09 · CPU moves data from/to main memory to/from local buffers I/O devices and the CPU can execute concurrently. Each I/O device controller is

Operating System

2 Computer System(cont.) Interrupt Cause external to CPU Ex. I/O devices, timer Current instruction completes. Asynchronous to clock

Trap Caused in CPU internal - while executing current instruction Ex. Programming error, Anomalous conditions Current instruction may not complete, Synchronous to clock

Interrupt Timeline

.

8

Page 9: 1. Introduction - IISPL() · 2015-09-09 · CPU moves data from/to main memory to/from local buffers I/O devices and the CPU can execute concurrently. Each I/O device controller is

Operating System

2 Computer System(cont.) How a modern computer system works

9

Page 10: 1. Introduction - IISPL() · 2015-09-09 · CPU moves data from/to main memory to/from local buffers I/O devices and the CPU can execute concurrently. Each I/O device controller is

Operating System

2 Computer System(cont.) Storage Structure Memory device operation

Load : main memory => CPU의register Store : CPU <=memory

Von Neumann(stored program)’s execution cycle fetch : instruction on to instruction register Decode Execute : result in register

Main memory : direct-access storage device too small and Volatile

Secondary storage extremely large, Permanent Hard disk

Tertiary storage slower and lower in cost than secondary storage Backups CD/DVD

10

Page 11: 1. Introduction - IISPL() · 2015-09-09 · CPU moves data from/to main memory to/from local buffers I/O devices and the CPU can execute concurrently. Each I/O device controller is

Operating System

2 Computer System(cont.) Disk mechanism of moving-head disk

11

Page 12: 1. Introduction - IISPL() · 2015-09-09 · CPU moves data from/to main memory to/from local buffers I/O devices and the CPU can execute concurrently. Each I/O device controller is

Operating System

2 Computer System(cont.)

12

non-volatile

volatile

sold state disk: non-volatile flash memory

volatile

volatile

non-volatile

non-volatile

non-volatile

hard disk

Kilo = 210 = 1,024 =103

Mega = 220 = 1,048,567 =106 Giga = 230 = 1,073,741,824 =109 Tera = 240 = 1,099,511,627,776 =1012 Peta = 250 = 1,125,899,906,842,624 =1015

DRAM NVRAM : DRAM with battery Flash Memory Speed ? Cost ? Volatility ?

Storage-Device Hierarchy

Page 13: 1. Introduction - IISPL() · 2015-09-09 · CPU moves data from/to main memory to/from local buffers I/O devices and the CPU can execute concurrently. Each I/O device controller is

Operating System

3. Computer System Architecture Single-Processor(CPU) system. Multiprocessor system.

Increased throughput Economy of scale Increased reliability

Symmetric vs. Asymmetric multiprocessing Multi-core chip Clustered system

High availability

13

Page 14: 1. Introduction - IISPL() · 2015-09-09 · CPU moves data from/to main memory to/from local buffers I/O devices and the CPU can execute concurrently. Each I/O device controller is

Operating System

3. Computer System Architecture(cont.)

14

Symmetric Multiprocessing structure

Page 15: 1. Introduction - IISPL() · 2015-09-09 · CPU moves data from/to main memory to/from local buffers I/O devices and the CPU can execute concurrently. Each I/O device controller is

Operating System

3. Computer System Architecture(cont.)

15

One chip

A Dual-Core Design

Page 16: 1. Introduction - IISPL() · 2015-09-09 · CPU moves data from/to main memory to/from local buffers I/O devices and the CPU can execute concurrently. Each I/O device controller is

Operating System

Intel Core i7 processors compared with Core i5 i5 i7

Performance Mid-level (4 star) High-level (5 star)

Desktop Sandy Bridge and Ivy Bridge Ivy Bridge, Sandy Bridge-E, Sandy Bridge

Mobile Sandy Bridge and Ivy Bridge Ivy Bridge, Sandy Bridge

Cores 4 or 2 4

L3 Cache 6 or 3 MB 8 MB

Socket LGA 1156, rPGA-9884, or BGA-88A

LGA 1156, rPGA-9884, or BGA-988A.

TDP 77 W, 65 W, 45W, 35 W, 17 W, 13 W

130 W, 95 W, 77 W, 65 W, 55 W, 45 W, 35 W, 25 W, 17 W

I/O Bus

Direct Media Interface, Integrated GPU.

Direct Media Interface, Integrated GPU.

16

Page 17: 1. Introduction - IISPL() · 2015-09-09 · CPU moves data from/to main memory to/from local buffers I/O devices and the CPU can execute concurrently. Each I/O device controller is

Operating System

3. Computer System Architecture(cont.) Clustered Systems Features

Clustering allows two or more systems to share storage Provides high reliability (or high availability)

종류 Asymmetric clustering:

one server(active server) runs the application while other servers standby( hot standby server)

Active server에서 문제가 발생하면 Hot server가 active server가 된다. Symmetric clustering:

all N hosts are running the application and monitor each other 가용자원을 모두 사용한다. DLM(distributed lock manager) : 분산파일 시스템은 access control을 제공하고, 충돌방지를 위한 locking 기능을 제어해야 한다.

SAN(storage area network) : SAN은 다수의 호스트가 복합 스토리지 유닛의 접근을 가능하게 해준다.

Cf) Grid Computing

17

Page 18: 1. Introduction - IISPL() · 2015-09-09 · CPU moves data from/to main memory to/from local buffers I/O devices and the CPU can execute concurrently. Each I/O device controller is

Operating System

4 Operating System Structure Multiprogramming

Many processes run concurrently. Timesharing or Multitasking

is logical extension in which CPU switches jobs so frequently that users can interact with each job while it is running, creating interactive computing

Response time should be < 1 second Each user has at least one program executing in memory

=> process If several jobs ready to run at the same time

=>CPU scheduling If processes don’t fit in memory, swapping moves them in and out to run Virtual memory allows execution of processes not completely in memory

18

Page 19: 1. Introduction - IISPL() · 2015-09-09 · CPU moves data from/to main memory to/from local buffers I/O devices and the CPU can execute concurrently. Each I/O device controller is

Operating System

4 Operating System Structure(cont.) Memory Layout for Multi-programmed System

19

Page 20: 1. Introduction - IISPL() · 2015-09-09 · CPU moves data from/to main memory to/from local buffers I/O devices and the CPU can execute concurrently. Each I/O device controller is

Operating System

5 Operating-System operations Modern operating systems are Interrupt driven Interrupt

H/W generated interrupt => SIGNAL TO cpu S/W generated interrupt(trap) =>system call

Software error or request creates exception or trap Division by zero, request for operating system service

Dual-mode operation User mode – execution done on behalf of a user. (mode bit=1)

Kernel mode (or monitor-supervisor-system mode) (mode bit=0) – execution done on behalf of operating system

Mode bit provided by hardware System call changes mode to kernel, return from call resets it to user .

20

Page 21: 1. Introduction - IISPL() · 2015-09-09 · CPU moves data from/to main memory to/from local buffers I/O devices and the CPU can execute concurrently. Each I/O device controller is

Operating System

5 Operating-System operations(cont.)

21

Mode Transition

Page 22: 1. Introduction - IISPL() · 2015-09-09 · CPU moves data from/to main memory to/from local buffers I/O devices and the CPU can execute concurrently. Each I/O device controller is

Operating System

6,7,8

6 Process Management 7 Memory management 8 Storage Management

File System Management Mass-Storage Management Performance of Various Storage I/O Subsystem

Hide particular hardware device from the user. Memory management of I/O including buffering, caching, spooling. General Device Interface, Drivers for specific hardware devices

22

Page 23: 1. Introduction - IISPL() · 2015-09-09 · CPU moves data from/to main memory to/from local buffers I/O devices and the CPU can execute concurrently. Each I/O device controller is

Operating System

8 Storage Management(cont.) Performance of Various Storage

Migration of Integer A from Disk to Register

23

Page 24: 1. Introduction - IISPL() · 2015-09-09 · CPU moves data from/to main memory to/from local buffers I/O devices and the CPU can execute concurrently. Each I/O device controller is

Operating System

9 Protection and Security Protection

OS에 의하여 정의된 프로세스 또는 자원의 접근을 제어하는 매커니즘 Security

내부 또는 외부로부터의 공격에 대한 시스템의 방어 예: denial-of-service, worms, viruses, identity theft, theft of service

Systems 먼저 유저를 확인하고 그 유저가 무엇을 할 수 있는 지를 결정한다. User identity (user ID, security ID)는 하나의 이름과 숫자이다. User ID는 파일 또는 프로세스들과 연관 되어 접근이 결정된다. Group identifier (group ID)는 유선 집합에 대하여 접근 Privilege escalation 는 유저로 하여금 더 많은 권한을 가진 유효 ID로 변경을 허용한다.

24

Page 25: 1. Introduction - IISPL() · 2015-09-09 · CPU moves data from/to main memory to/from local buffers I/O devices and the CPU can execute concurrently. Each I/O device controller is

Operating System

10 Distributed Systems Distributed Operating System

덜 독립적 (less autonomy between computers) 여러 OS가 협력하여 네트워크를 제어하는 하나의 OS가 있는 것 같은 환상(illusion) 제공

Network Operating System : Solaris 9, Netware 파일 공유 (file sharing) 지원 : FTP, NFS 통신 체계 (communication scheme) 지원 독립적으로 실행하며 (acts autonomously) 네트워크로 연결된 컴퓨터와 통신 가능

분산 시스템 Loosely coupled multiprocessor systems( 이완결합 ) 각 processor 는 각각 자신의 local memory를 가짐 네트워크 (LAN, WAN, MAN; metropolitan area network, BlueTooth, 802.11) 통해 교류

Processors(sites, nodes, computers) : micro processors, workstations, minicomputers, large general-purpose computer systems

분산시스템의 효과 자원공유 (resource sharing), 계산속도 증가 (computation speedup): load sharing , 신뢰성 (reliability) 통신 (data communication): 정보 교환 (예) FTP, e-mail

분산 시스템의 궁극적인 목적 분산 시스템이 너트워크에 걸쳐 있는 수 많은 컴퓨터들로 구성되어 있음에도 불구하고, 사용자는

단일의 통합된 컴퓨팅 시스템이라는 인식을 갖도록 하는 것

25

Page 26: 1. Introduction - IISPL() · 2015-09-09 · CPU moves data from/to main memory to/from local buffers I/O devices and the CPU can execute concurrently. Each I/O device controller is

Operating System

10 Distributed Systems(cont.) Multiple CPU (multiprocessor systems) Tightly coupled multiprocessor systems

Bus, Clock, Memory, 주변기기를 공유, Shared memory 통해 교류 병렬시스템의 효과

처리율 증진 (increase throughput) ,비용 절감 (save money): 자원의 공유(device) 신뢰성 항상 (increase reliability): graceful degradation

fault tolerant, fail-soft systems 다중처리 (multiprocessing) 방식

비대칭적 다중처리 (asymmetric multiprocessing) Master processor가 각 processor에게 특정한 일을 시킴 매우 큰 시스템에서 지원 SunOS Version4 (Solaris 1.x)

대칭적 다중처리 (symmetric multiprocessing; SMP) 각 Processor가 OS를 가짐 (동등한 관계) 대부분의 현대 OS 에서 지원 SunOS Version5 (Solaris 2.x)

26

Page 27: 1. Introduction - IISPL() · 2015-09-09 · CPU moves data from/to main memory to/from local buffers I/O devices and the CPU can execute concurrently. Each I/O device controller is

Operating System

11 Special Purpose System(전용시스템)

실시간 내장형 시스템 (Real-Time Embedded Systems): 19장 자동차엔진,공장용 로봇,VCR,전자파오븐…, 홈오토메이션시스템 OS 응용방법

Unix 같은 범용 OS사용, 필요한 일부 기능 만 가지는 OS 사용 OS없이 응용 전용 칩(ASIC; Application-Specific Integrated Circuits) 사용

OS는 실시간 처리를 지원(일정시간이내에 처리해야) CPU 스케줄링 : 선점, 우선순위 기반의 실시간 지연시간 최소화 선점형 커널

멀티미디어 시스템 (Multimedia System): 20장 + 오디오,비디오 (초당 30프레임)파일, 라이브 웹캐스트(www을 이용한 방송)… 압축과 해제 기능이 필요 우선순위 기반 실시간 스케줄링 실시간 전송 프로토콜

휴대용 시스템 (handheld System) PDA (Personal Digital Assistant)

작은 메모리, 느린 처리기, 작은 스크린 web-clipping(웹 페이지 일부만 출력) : 작은 스크린 입출력 문제 해결 통신방법 : BlueTooth, WIFI(IEEE 802.11, Wireless Fidelity) 등 무선 기술

27

Page 28: 1. Introduction - IISPL() · 2015-09-09 · CPU moves data from/to main memory to/from local buffers I/O devices and the CPU can execute concurrently. Each I/O device controller is

Operating System

12 Computing Environments 전통적 컴퓨터 (Traditional computer)

시간에 지남에 따라 전통적 컴퓨터의 구분이 모호해짐 사무실 환경

과거 네트워크로 연결된 PC들 batch나 time-sharing을 하는 mainframe 이나 mini computer에 연결된 terminal들

현재 포탈 (Portals; provides web accessibility to their internal servers) 네트워크 컴퓨터 (network computers = terminals that understand web-based

computing) 무선 네트워크 (wireless networks) 사용

홈 네트워크 과거

느린 모뎀을 가진 단일 시스템 현재

firewalled, fast networked

28

Page 29: 1. Introduction - IISPL() · 2015-09-09 · CPU moves data from/to main memory to/from local buffers I/O devices and the CPU can execute concurrently. Each I/O device controller is

Operating System

12 Computing Environments Client-Server Computing

File-server : client가 파일 관리기능 web hard, … Peer-to-peer Computing

P2P, client 나 server 또는 모두 역할, 1990년 후반 file sharing 서비스 , 당나귀등

Web-Based Computing Wired or wireless access, PC, PDA, Hand phone …

Open-Source Operating System OS가 소스코드로 제공, 처음시작은 free Software Foundation(FSF),

“copyright”, GNU Public License(GPL), 예 gnu/Linux, BSD UNIX(including core of Mac OS X), Sun Solaris

29

Page 30: 1. Introduction - IISPL() · 2015-09-09 · CPU moves data from/to main memory to/from local buffers I/O devices and the CPU can execute concurrently. Each I/O device controller is

Operating System

The End

30