Study/OS

[OS] Operating System Overview

__PS 2024. 4. 18. 23:34
728x90

OS Objectives

1) Convenience: 편리성

2) Efficiency: 효율성

3) Ability to evolve: 발전 가능성

 

Role of OS

- User / Computer Interface 

- I/O device control, file management, program create 등을 도움

- 자원 관리자


Evolution of OS 

OS에 필요한 서비스에 의해 하드웨어에 추가되기도 함

 

 

 

Serial Processing: 순차 처리

- No OS

1) 수동으로 카드 로드

2) Job to Job Transition

 

- 모든 활동이 순차적

 

Problems

1) High Setup Time

-> 준비 시간이 길었다.

 

2) Scheduling time

-> 현대 CPU 스케줄링이 아니고, 시간을 절약할 수 없었다.

 

 

Simple Batch Systems: 일괄 처리 시스템

목표

1) Reduce Setup Time

2) Automatic Job Sequencing

 

최초의 Batch OS = Monitor

 

Desirable Feature

- Memory Protection: 유저 실행시 메모리의 데이터 변조 X

- I/O Protection: privileged instructions (듀얼모드)

- Lead to dual mode

- CPU Protection: prevent monopolize CPU -> system timer -> 유저 X, 모니터만 가능해야함.

- Interrupts

- I/O device Controller

- Synchronous / Asynchronous I/O

1) write의 경우 영향을 주지 않으므로 비동기적 (Asynchronous)

2) read의 경우 다음 프로세스의 로직에 영향을 주므로 동기적 (Synchronous)

 

problems

1) Card reader very slow

 

2) often idle -> synchronous I/O 해결 X

 

Multiprogrammed Batch Systems

목표

1) increase CPU utilization

2) 메인 메모리에 할 일을 두어 CPU의 idle 상황 최소화

 

degree of multiprogram

-> 메모리 문제 때문에 무한히 커질 수 없음

--> 디스크로 swapping이 이루어져 성능이 저하됨

 

Desirable Features

1) Relocation

uni-programming의 경우 시작 주소는 정해져 있음

하지만 multi에서는 매번 달리짐

 

2) Memory Protection

 

=> MMU로 해결

 

MMU (Memory Management Unit): 하드웨어 장치에 구현

1) base register을 이용하여 relocation 해결 (시작 주소 관리)

-> base: 프로그램 전체가 올라오는 것을 암시

2) bound register을 이용하여 접근 가능 경계 설정

-> 둘 다 OS만이 변경 가능한 privilege operation

 

Time Sharing Systems

배경: hardware - getting cheaper, human - getting expensive

목표

1) 사람들의 생산성 증가 -> human의 idle 방

2) 다양한 작업 수행

3) 다른 사람들과 공통의 작업

-> minimize response time

 

- reduce time slice -> 많은 사람과 동시에 작업 진행


 

Major advance in development

1) process: 메모리에 있는 상태

- execution context: CPU에서 수행하다 time interrupt 발생 시 정보를 저장

 

2) Scheduler

- short-term scheduling: time slice 주기대로 호출

- scheduling policy: fairness, efficiency, differential, responsiveness  

 

3) Synchronization: 동기화

- race condition

 

4) Memory Management: 분산 적재 / 부분 적재

-> Virtual Memory의 컨셉

-> Paging System 소개


Resource Protection

User는 I/O에 직접 접근할 수 없다.

-> only my memory area, no special register

 

-> System Call -> interrupt 발생

(Call -> Procedure)

 

- kernel -> user: syscall (interrupt)

- user -> kernel: set mode bit

 

System Call: OS와 커뮤니케이션하기 위한 장치

 

purpose

1) protect resource

2) reliability

3) security

 

6 category

1) process

2) scheduling

3) interprocess communication

4) file system

5) socket

6) and miscellaneous