2020 2학기 기말고사

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

1/4

운영체제 기말시험 (2020학년도 2학기, 12/17/2020)

학과 학번 학년 이름

⑴ 다음 괄호에 들어갈 용어를 아래 box에서 찾아 채우시오.


- The run-time mapping from logical to physical addresses is done by a hardware device called the
(① ).
- The main memory is usually a/an (② ) storage device that loses its contents when power is turned off
or lost.
- Consider a system that has a logical address space of 256 pages of 4,096 bytes each, mapped onto
a physical memory of 32 page frames. How many bits (at least) are required in the logical address?
(③ )
- In demand paging system, access to a page that is not brought into memory or marked invalid causes
a/an (④ ). The paging hardware, in translating the address through the page table, causes a
trap to the operating system, resulting in the context switch of the running process.
- (⑤ ) occurs when a computer's virtual memory resources are overused, leading to a constant
state of paging and page faults, inhibiting most application-level processing. This causes the
performance of the computer to degrade or collapse.
- (⑥ ) allows a child process to share the same address space as its parent. If either the child
or the parent process modifies a shared page, a copy of the page is made.
- Usually, in SSD storage devices, flash memory controllers also include the (⑦ ), a layer
below the file system that maps host side or file system logical block addresses (LBAs) to the
physical address of the flash memory (logical-to-physical mapping).
- Unix/Linux systems check the (⑧ ) to validate the file protection information when a process
opens a file.
- In Unix systems, a/an (⑨ ) contains file system details, such as the number of blocks in the
file system, the size of the blocks, a free block count and free block pointers, and a free inode
count and free inode pointers.
- Unix and Linux systems basically uses (⑩ ) allocation method for ordinary file allocation.

[용어 box]
TLB volatile page fault boot block linked
capability list MMU page replacement flash translation layer non-volatile
20 21 22 copy-on-write address mapping layer
fragmentation thrashing superblock access list indexed

⑵ PMT의 일부를 저장하기 위해 TLB를 두고 있는 시스템에서 memory access time이 80ns, TLB access time
이 10ns라 가정한다. Page fault를 고려하지 않을 경우 이 시스템의 EAT(effective access time)을 100ns
이하로 유지하고자 할 경우 TLB hit ratio는 얼마 이상이어야 하는가? (풀이과정을 같이 보이시오)
2/4

⑶ 아래와 같은 parameter를 갖는 demand paging system에서 한 프로세스 P의 residence


p# pf#
PMT(page map table)가 오른쪽 표에서와 같다고 가정하고 물음에 답하시오. bit
이 시스템의 main memory는 byte-addressable인 것으로 가정한다. 0 0 4
(단, 1KB = 210Bytes) (제시한 답에 대한 근거를 같이 설명하시오) 1 1 8
2 0 3
■ Physical memory size: 512MBytes 3 1 2
■ Logical(Virtual) memory size: 4GBytes 4 1 6
■ Page size: 4KBytes 5 0 5
... ... ...

① 이 시스템에서 physical address에 필요한 최소 bit 수는 얼마인가?


② 이 시스템에서 logical(virtual) address에 필요한 최소 bit 수는 얼마인가?
③ 이 시스템의 page frame 크기는 얼마인가?
④ 이 시스템의 physical address에서 page frame을 지정하기 위해 몇 bit가 사용되는가?
⑤ 이 시스템의 virtual address에서 page number를 지정하기 위해 몇 bit가 사용되는가?
⑥ 이 시스템의 virtual address에서 displacement(offset)을 위해 몇 bit가 사용되는가?
⑦ 이 시스템의 process가 갖는 PMT의 page table entry 개수는 최대 몇 개인가?
⑧ 이 시스템에서 inverted page table을 사용할 경우 이 table의 entry 개수는 몇 개인가?
⑨ 프로세스 P가 virtual address 15,000번지를 접근했을 때 이에 대한 real address는? 질문에 답할 수 없
는 경우에는 어떤 현상이 발생하는지 설명하시오.
⑩ 프로세스 P가 virtual address 22,000번지를 접근했을 때 이에 대한 real address는? 질문에 답할 수 없
는 경우에는 어떤 현상이 발생하는지 설명하시오.


3/4

⑷ 다음의 page reference string ω1, ω2에 대해 아래의 3가지 page replacement 기법을 사용했을 때 발생하
는 page fault 횟수를 각각 구하시오. 단, ①~② 문항의 2가지 기법에 대해서는 3개의 page frame이 고정
할당되었다고 가정하며, 초기에 3개의 페이지 프레임들이 모두 비어 있음을 가정한다. 또한, ③ 문항의 WS
기법에 대해서는 window size 4를 가정하며, 초기 페이지 프레임 할당량은 0으로 가정한다.
(아래 페이지 참조열에서 각 단위자리수(1~9)는 페이지번호를 의미하며, 지수 표현은 해당 부분참조열
(substring)의 반복 횟수를 의미한다. 즉, (12)100은 부분참조열 (12)가 100번 반복(121212…12) 참조됨을 의
미한다.)

  
     (12가 100회 반복된 후 3456이 200회 반복, 그리고 그 후 789가 300회 반복)

① LRU(Least Recently Used)


② LFU(Least Frequently Used)
③ WS(Working Set) Memory Management


4/4

⑸ 어떤 Unix 파일 시스템에서 파일 데이터 블록들을 아래와 같이 관리한다고 가정하자.


▮ 파일 metadata를 관리하는 inode에서는 10개의 direct block pointer와 각 한 개씩의 single indirect,
double indirect, triple indirect pointer를 갖는다.
▮ 각 블록의 크기는 4KBytes이며, block pointer에는 4Bytes를 사용한다.
▮ 파일 데이터의 입출력은 블록 단위로 이루어진다.

① 위 파일 시스템에서 수용 가능한 파일의 최대 크기를 계산하시오.


② 파일 내 offest 4,000부터 100Bytes를 갱신하고자 한다. 이를 갱신하여 다시 파일에 반영하기 위한 블록
입출력 횟수를 계산하시오.
③ 어떤 파일의 inode만 주기억장치에 적재되어 있고, indirect block 및 data block은 주기억장치에 적재되
어 있지 않은 상태라 가정할 때, 이 파일의 offset 100,000부터 데이터 2,000Bytes를 읽기 위한 블록 입
출력 횟수를 구하시오.
④ 어떤 파일의 inode만 주기억장치에 적재되어 있고, indirect block 및 data block은 주기억장치에 적재되
어 있지 않은 상태라 가정할 때, 이 파일의 첫 100,000Bytes를 순차적으로 모두 읽는데 필요한 블록 입
출력 횟수를 계산하시오.

☆ 수고했습니다.

You might also like