Computer Science/OS

운영체제 1강 연습문제

박붕어 2023. 11. 20. 23:07

1.5 Distinguish between the client-server and peer-to-peer models of distributed systems

Client-Server 모델에서는 전용 Server와 특정 Client가 있다. Server는 Client에 서비스를 제공한다. 데이터가 중앙집중식으로 서버에 저장된다

Peer To Peer 모델에서는 각 노드가 Server와 Client의 역할을 모두 수행할 수 있다. Peer간 서비스를 제공, 요청할 수 있다. 데이터는 Peer에 저장되므로 분산되어 있다.

1.7 What is the purpose of interrupt? What are the differences between a trap and an interrupt? Can traps be generated intentionally by a user program? If so, for what purpose?

Interrupt : CPU가 프로그램을 실행하는 중 입출력 하드웨어등의 장치에 예외상황이 발생하여 CPU가 처리할 수 있도록 알려주는 것을 말한다.

Trap : 소프트웨어에서 발생하는 Interrupt를 말한다. 프로그램 내부에서 발생하며 예외(Exception)과 System Call이 있다.

이 때, System Call은 사용자가 의도적으로 일으킨 Interrupt로 프로그램이 Kernel에 접근하기 위해 사용하는 Interface이다. 응용프로그램에서 Kernel을 사용하기 위해 의도적으로 System Call을 사용한다.

1.8 Direct memory access is used for high-speed I/O devices in order to avoid increasing the CPU's execution load

a. How does the CPU interface with the device to coording the transfer?

각각의 Device마다 Device Controller가 존재하고, 운영체제에는 Device Controller와 소통할 수 있는 Device Driver가 존재한다.

b. How does the CPU know when the memory operations are completed?

Device Controller는 메모리에 직접 접근하여 작업을 수행하고, 작업이 끝난 경우 Interrupt를 발생시켜 CPU에 알린다.

c. The CPU is allowed to execute other programs while the DMA Controller is transferring data. Does this process interface with the execution of the user programs? If so, describe what forms of interference are caused

DMA(Direct Memory Access)는 Device Controller가 직접 메모리에 접근하여 데이터를 변경할 수 있다. CPU가 작업하고 있는 메모리 주소에 Device Controller가 접근하여 메모리를 할당받으면 CPU가 할당받은 메모리가 줄어들어 방해받을 수 있다.

The CPU and the device will compete for cycles on the memory bus. The memory controller will try to fairly allocate bus cycles between the CPU and the device. So, any CPU program that would be capable of using all the memory bus cycles could run more slowly while the DMA is active.

1.9 Give two reasons why cashed are useful. What problems do they solve? What problems do they cause? If a cache can be mode as large as the device for which it is cashing ( for instance, a cache as large as a disk ), why not make it that large and eliminate the device?

  1. Cache는 상대적으로 빠른 입출력 속도의 메모리이다. main 또는 secondary 메모리에서 데이터를 읽는 것 보다 빠르다.
  2. 데이터 입출력 속도가 다른 두 컴포넌트 사이의 입출력 시, 읽어야 하는 데이터를 미리 입출력 속도가 빠른 컴포넌트로 옮겨 (캐싱하여) 데이터가 입출력이 빠른 컴포넌트에 있다면, 속도가 느린 컴포넌트의 입출력을 기다리지 않아도 되어 처리속도가 빨라진다.

Cache Coherency 문제가 발생할 수 있다. 캐쉬된 데이터와 메인 메모리의 데이터가 불일치 할 수 있다. 메인 메모리의 데이터가 수정된다면, 캐쉬된 데이터 역시 수정되어야 한다.

캐쉬는 상대적으로 비싼 메모리로 용량을 크게 하려면 비용이 비싸진다.

1.12 Define the essential properties of the following types of operating systems

a. Batch : 일괄처리 시스템. 사용자와 상호작용이 적고 처리량이 많은 일을 한번에 수행할 때 효율이 좋다.

b. Interactive : 대화형. 다음 transaction의 결과를 예측할 수 없는 많은 transaction으로 구성된 시스템. 사용자가 컴퓨터의 응답을 기다리기 때문에 반응시간이 짧아야한다. typically less than one second.

c. Timesharing (multitasking) : Multiprogramming을 논리적으로 확장한 것을 말한다. CPU는 다수의 작업을 아주 짧은 기간동안 돌아가며 수행하여 각각의 프로그램이 독립적으로 실행되는 것 처럼 동작하는 시스템이다.

time-shared operating system→하나의 장치를 여러 사용자가 사용하는 경우 Scheduling을 하여 사용자 별로 아주 짧은 시간동안 CPU를 사용할 수 있도록 하여 여러 사용자가 동시에 하나의 컴퓨터를 사용하지만, 독립적으로 작업할 수 있도록 한다.

d. Realtime : 실시간으로 작업을 처리하는 시스템.

e. Network : 2개 이상의 장치가 연결된 구조를 말한다.

f. Parallel : 하나의 시스템에 둘 이상의 프로그램을 동시에 실행하여 정보를 처리하는 것을 말한다.

g. Distributed : 여러 Processor들이 논리적, 물리적으로 분리되어 있는 것을 말한다.

h. Clustered : 여러 Computer를 연동하여 하나의 System으로 동작하도록 하는 기법.

i. Handheld : Cellular Phone과 같은 작은 컴퓨터 시스템을 말한다.

'Computer Science > OS' 카테고리의 다른 글

운영체제 2강 연습문제  (0) 2023.11.21
Operating System Structures(2)  (0) 2023.11.21
Operating System Structures (1)  (0) 2023.11.20
Operating System Instruction (2)  (1) 2023.11.20
Operating System Instruction (1)  (2) 2023.11.20