엔지니어가 되고 싶은 공돌이

02. Interrupt and Exception (1) 본문

Computer Science/Operating System

02. Interrupt and Exception (1)

Geca 2025. 5. 12. 18:29

 

2. 1. OS Internals

 

 

 

- I/O Management에는 Device Drivers가 포함되며, 모든 Management Code중에서 제일 깁니다.

 

  Hardware마다 Code를 가져야 하기 때문입니다.

 

- Process Management Coder가 가장 짧습니다. 하지만 매우 중요합니다.

 


 

2. 2. Computer System

 

 

 

1) I/O장치와 CPU는 동시에 일을 수행 할 수 있습니다.

 

2) 각 Device controller는 각 Device를 담당합니다.

 

3) Device Controller에는 Local Buffer가 존재합니다.

 

4) I/O란 Main Memory와 Local Buffer사이의 데이터 교환을 의미합니다.

 

5) I/O는 CPU가 명령을 내려야 할 수 있으며, CPU는 I/O가 끝났는지의 여부를 알아야 합니다.

 

6) OS의 기능은 Computer Architecture에 의해 제한 될 수 있으며, Architecture를 고려하여 만들어져야 합니다.

 

    Architecture의 DMA, Interrupt등과 같은 지원을 통해 OS 구조를 단순화 할 수 있습니다.

 


 

2. 3. Interrupt

 

 

- Interrupt: Hardware가 생성. ex) x86의 INTR.

 

- Interrupts와 exceptions이 발생하면 Execution Authority를 OS에게 넘겨줍니다.

 

 

- How does the kernel notice an I/O has finished?

 

  1) Polling: CPU가 I/O가 완료되었는지 계속 확인합니다.

 

  2) Hardware Interrupt: I/O가 끝나면 Interrupt를 발생시키고, Data를 CPU에 보냅니다.

 

      일반적으로, Hardware Interrupt가 더 빠릅니다.

 

 

- Interrupt Handling

 

  1) Interrupt가 발생하면 현재 보존되어야 하는 중요정보들(ex) State of CPU)을 저장합니다.

 

  2) Interrupt를 처리하기 위해서 Interrupt Handler가 발생이유를 보고, 상황에 맞게 처리합니다.

 

  3) Interrupt를 처리하고 다시 복귀합니다.


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

05. Fork, Exec and CreateProcess  (0) 2025.05.17
04. Process  (0) 2025.05.15
03. Interrupt and Exception (2)  (0) 2025.05.13
01. Introduction to Operation System  (0) 2025.05.06
Comments