기본 콘텐츠로 건너뛰기

Operating System


Operating System




Three Phases of OS History

Phase 1 
     Summary :  H/W 비싸고, 인건비는 저렴  
     Goal : 어떻게 하면 값비싼 CPU를 효율적으로 사용할 수 있을까 ?

Phase 1-1 : Operator as OS
  • 하드웨어(애니악 - 진공관 CPU,마그네틱 코어 Memory)가 매우 비싸고, 그에 반해 인건비가 매우 저렴하기 때문에 CPU Utilization을 최대화 시키는게 목표였다.
  • 초창기 컴퓨터 당시 Operator 역할은 사람이었다. 카드 덱 수령, 카드 덱 시스템에 로딩, 수행결과를 프린트, 결과물을 사용자에 전달 등등

Phase 1-2 : Simple batch monitor
  • Human Operator에 의해 job-to-job 전환 속도가 매우 느린점으로 인해 CPU적 관점으로 컴퓨터 시스템의 비효율성을 극복(Utilization 최대화)하기 위해서 최초의 Operating System Software가 등장했다.
  • I/O machine이 추가 되었다.

Phase 1-3 : Batch monitor ( OS + I/O device controller )
  • 하지만, I/O를 추가한 후, I/O를 하고 있을 때 CPU가 idle하게 되었고, 또 다시 CPU Utilization 문제가 대두되었다. 이와 같은 문제를 해결하기 위해 I/O Channel, I/O device controller가 등장했다.
  • I/O Channel은 CPU를 대신해서 I/O device의 operation을 관장해준다. 그 대신 I/O operation의 시작과 끝만 CPU에게 알려준다. ( Asynchronous I/O 방법으로써 Interrupt mechanism 등장 )
  • 이러한 mechanism 으로 CPU와 I/O가 서로 overlap되며 사용가능해졌다.
Phase 1-4 : Multi-programmed Batch Monitor
  • 하지만, 또 다른 문제점으로는 disk에 어떤 data를 read해달라고 CPU가 I/O에게 요청했을 때, CPU는 그 data가 돌아올때까지 아무 일도 못하게 된다 (요청한 data를 못받았으니까) 이와 같은 문제를 해결하기 위해서 한 개 이상의 active job을 수행하는 Multi-programmed Computer system이 등장하였다. 즉, 메인 메모리에는 여러 개의 active job이 존재할 수 있게 되었다. 
  • degree of multi-programming 개념 등장
  • 이렇게 다수의 프로그램을 메모리에 적재하고 운영하면서 Memory Protection, Memory Relocation, Concurrent Programming의 새로운 문제들이 발생하였다. 
* 두 가지 경우의 I/O method
- Synchronous I/O : CPU는 I/O가 끝날 때까지 기다린다. ( 대부분의 input operation )
- Asynchronous I/O : 기다리지 않고 다른 job으로 돌린다. ( 대부분의 output operation )

* 명령어를 비동기, 동기 2가지 방법으로 나눠 최대한 CPU와 I/O가 overlap되도록 설계 한다. 동기적일때는 전혀 성능효과를 보지 못한다. 

* CPU Utilization 향상
- Interrupt Mechanism : CPU와 Async I/O간의 overlap이 가능
- Multi-programming : Sync I/O일때 다른 job에게 넘긴다. 


Multi-programmed batch monitor의 문제점
  1. Memory protection : 메인 메모리에는 여러가지의 job이 있기 때문에 다른 job의 메모리 또는 OS영역을 침범하지 말아야 한다. 중간에 누가 개입되어서 실수로 다른 job의 주소를 포인팅했을 때 막을 수 있어야 한다. 
  2. Memory relocation : 다수의 job들이 메모리의 어느 위치에 로드 될지 알 수 없기 때문에 임의의 메모리 주소에서도 문제없이 수행될 수 있어야 한다. (코딩할때 내 프로그램이 메모리 어느 영역부터 시작하는지 알수 없다. 컴파일러도 알수 없다.그때그때마다 달라지기 때문) 반면, single batch monitor는 job이 한개밖에 없으므로 메모리 특정 영역을 시작점이라고 고정시킬 수 있다. (multi에서는 이러한 특권을 누릴 수 있는 job이 한개밖에 안된다.)

Base/bound register 등장 (1, 2번 문제를 해결 하기 위해 H/W의 도움이 필요)
- MMU(memory maanagement unit)의 초창기 모델
- Philosophy : user program은 모두 0번지부터 시작된다. ( 컴파일러는 항상 0번지부터 할당하면 된다. (Logical Address) 그리고 메모리에 어디에 올라갈지 신경쓰지 않아도 된다. )
- Base register : 프로그램이 로드된 시작주소를 담고 있다. (Relocation 문제 해결)
- bound register : 프로그램의 크기를 담고 있다. (Protection 문제 해결)
- 실행 바이너리 코드에는 Logical address가 담겨 있고 메모리에 로드될 땐 각 program당 Base와 Bound값을 가진다. (각 program당 시작 주소와 크기를 알아야하므로)
- Base와 Bound값 때문에 결국 프로그램은 자기 영역 내에서만 포인팅할 수 있다.
- 이러한 MMU구조는 H/W로 구현하는게 맞다. S/W로 구현할 시 성능이 매우 저하된다. (operation 속에 주소 참조 또 주소 참조. 어쩌면 무한 recursive가 될수도 그리고 MMU코드 역시 recursive한 주소변환 과정이 필요하다)
- H/W 도움으로 OS가 진화할 수 있다. 반대도 성립

*** MMU가 OS에게 transparant 하나 ?
그렇지 않다. 다른 job으로 넘어갈 때 OS가 Base와 Bound register를 해당 job에 맞게 set해줘야 한다. 다시 말해, MMU는 OS에 의해 programmable한 entity가 된다. 특히, OS만의 고유권한이 되어야 한다. (privilaged instruction)

Multi-programmed monitor를 운영할 때 MMU말고 또 하나의 문제는 Concurrency and synchronization이 있다.

시대의 변화에 따른 OS System의 변화
- 카드 덱을 컴퓨터에 맡기고 처리가 완료되는 동안 사람이 할일이 없어졌다.
- transistor 발명, 집적회로 기능 발전 등 H/W의 발달로 CPU Utilization보다 Human Utilization을 중시하는 쪽으로 패러다임이 바뀌게 되었다.
- Phase 1 : cpu가 idle하지 않게
- Phase 2 : 사람이 idle하지 않게


Phase 2
     Summary : H/W는 저렴하고 인건비는 비쌈
     Goal : 어떻게 하면 사람들의 생산성을 향상 시킬 수 있을까 ?  
     대부분 중요한 OS 이론이 성립되기 시작하는 시기
     개인에게 terminal computer 한 대씩 보급되기 시작하는 시기

Phase 2-1 : Interactive time-sharing OS
- 현대 OS의 기초, 근간이 되었다.
- 컴퓨터와 프로그래머가 서로 대화 가능, 개인은 terminal computer를 통해 server computer를 자기 혼자 소유하고 있는 듯한 기분좋은 착각에 빠진다.
- CPU는 한개이지만, terminal들에 여러 user들이 존재하는데, time-sharing기법을 통해 100ms씩 돌아가면서 시간을 배분하게 되면서 다수의 user들이 끊김없이 사용할 수있게끔 해준다. (반면, 반응속도가 1초가 되어버리면 interactive하지 않게 된다.)
- 이렇게되면서 사용자는 개인정보를 저장하고 싶게 되었다. OS가 사용자의 요구를 만족시키기 위해서 File system을 설계하게 되었다.
- 컴퓨터 시스템을 평가하는 방법의 변화 : Phase 1 (단위시간당 job처리량(throughput)) d에서 Phase 2 (사람들의 사용감(response time))으로 변했다.

Phase 3
     Summary : 인터넷을 통해 지구상의 모든 컴퓨터가 연결되기 시작함
     Goal : 어떻게 user들에게 연결된 multimedia service를 잘 제공해 줄 수 있을까 ?
     인터넷은 이제 선택이 아닌 필수
     1990년 후반, 3C Convergence 개념 등장
     Communication, Computer, Computer Electronics의 경계가 무너지게 되었다.
     H/W가격이 더욱 저렴해지면서 서버와 개인PC 간격이 좁혀졌다.
     고사양에 따른 OS가 매우 복잡해졌다.

Phase 3-1 : OS with built-in Internet Access
Phase 3-2 : Sophisticated PC OS
Phase 3-3 : OS with Multimedia Support  

* 스마트폰 사용이유
     모바일 communication
     Multimedia - continuous media ( OS가 support해줘야 한다. )
이러한 continuous multimedia를 사용하려면 잘 짜여진 OS 스케쥴링이 필요한데, 기존의 중요한 일을 먼저 처리하는 우선순위 기반 스케쥴링에서 CPU의 일정 bandwidth를 고정적으로 할당하는 Bandwidth 스케쥴링으로 변환되었다. 



Functions of OS
     Coordinator : multi-tasking을 하는데 있어 자원충돌이 일어나는 것을 중재해준다.
     Illusion Generator : 프로그래머가 쉽게 프로그래밍할 수 있게 추상화를 제공해준다.
     Standard Library : 역시 쉽게 프로그래밍할 수 있게 시스템 관리 모듈을 제공해준다.

OS as Coordinator


- Q. 이미 I/O system이 있는데 왜 별도로 network system과  file system을 따로 구성해야 되는가 ? network는 성능에 매우 큰 영향을 주기 때문, 특히, OS는 network packet 스케쥴링을 잘해줘야 한다.
- 성능을 높이기 위해 I/O device를 1byte 단위인 Character I/O와 1block(4KB)단위인 Block I/O, Network I/O device로 나눠서 운영한다. 크기가 모두 다른 데이터들을 어떻게 효율적으로 운영할지에 대한 결과


OS as Illusion Generator

OS presents an illusion: "Cleaner abstraction"


* 추상화 : 프로그래머는 H/W 내부 시스템을 모두 알지 못해도 OS를 통해 손쉽게 프로그래밍을 할 수 있다.

OS presents an illusion: "Multiple processors"


Examples of Illusion Generator
     Time-sharing
     Virtual memory

* sometimes Illusions fail ; time-share의 기능이 threshold값을 넘으면 thrashing이 발생한다. 예를 들어, 하나 server computer에  terminal을 매우 많이 연결하면, 또는 사용자의 수가 어떤 임계점을 넘어서는 순간 응답시간이 급격하게 줄어든다. 









Introduction to Operating System
서울대학교 평생교육원, 홍성수 교수님

댓글

이 블로그의 인기 게시물

Pattern Discovery in Data Mining

Coursera Illinois at Urbana-Champaign by Jiawei Han 2015.03.19 CONTENT 1. A brief Introduction to Data Mining 2. Pattern Discovery : Basic Concepts 3. Efficient Pattern Mining Methods 4. Pattern Evaluation 5. Mining Diverse Patterns 6. Constraint-Based Pattern Mining 7. Sequential Pattern Mining 8. Graph Pattern Mining 9. Pattern-Based Classification 10. Exploring Pattern Mining Applications Lecture 1 : A brief Introduction to Data Mining - We'are drowning in data but starving for knowledge ( a lot of data are unstructured ) - Data mining : a misnomer ! -> Knowledge mining from data - Extraction of interesting patterns (non-trivial, implicit, previously unknown and potentially useful) or knowledge from massive data. - Data mining is a interdisciplinary field (machine learning, pattern recognition, statistics, databases, big data, business intelligence..) Knowledge Discovery (KDD) Process Methodology View: Confluence of Multiple Disciplines Lecture 2 : Pattern Discovery : Ba

Vector Space Model

Motivation When you want to find some information by using Search Engines, you have to make a query used for search. Unfortunately, since you don't know exactly what it means, your query will be ambiguous and not accurate. Therefore, Search Engines give you the information in a ranked list rather than the right position. Intuition In order to make a ranked list, you need to calculate the similarity between the query and documents based on terms or words. One of the calculation of similarity is dot product on a vector space. In the vector space, there are many documents with respect to word dimensions The first to rank is d2, because to see with eyes it's the most similarity with the query. Problem How do we plot those vectors wonderfully and nicely and very very fairly ? - How do we define the dimension ? - How do we place a document vector ? - How do we place a query vector ? - How do we match a similarity ? Consideration 1. The frequency of each word of Query. First, Score in

Text Retrieval and Search Engines

by ChengXiang "Cheng" Zhai CONTENT 1. Natural Language Content Analysis 2. Text Access 3. Text Retrieval Problem 4. Text Retrieval Methods 5. Vector Space Model (Retrieval Model l) 6. System Implementation 7. Evaluation 8. Probabilistic Model (Retrieval Model ll) 9. Feedback 10. Web Search Harnessing Big Text Data: Text Retrieval + Text Mining Course Summary 1. Natural Language Content Analysis 1.1 Natural Language Processing (NLP) Natural Language Processing (NLP) is a field of computer science, artificial intelligence, and computational linguisitc concerned with the interactions between computers and human (natural) languages. As such, NLP is related to the area of human-computer interaction. Many challenges in NLP involve natural language understanding, that is, enabling computers to derive meaning from human or natural language input, and others involve natural language generation. Computers can understand human language like that Koreans understand English. but, it's