이 포스트는 서울대학교의 '운영체제의 기초' 강의를 개인 학습용으로 작성한 포스트입니다.
System Interconnect
Bus arbiter : 여러 Bus master 중에, 특정 Bus master에게 Bus를 제공해주는 조정자
Bus master : Request signal을 보냄으로써 Bus transaction을 시작할 수 있음
ex) CPU, DMA controller
Bus slave : Bus master로 부터 명령을 받아 작업을 처리함
ex) Memory controller, Device controller
Interrupt-Driven I/O : I/O가 완료되면 I/O controller가 CPU에게 비동기적으로 완료되었음을 알려주는 방식
Polling I/O : I/O 완료 여부를 CPU가 반복해서 I/O controller의 control register를 확인하는 방식
Memory-mapped I/O : Memory address space 일부를 할애해서 I/O register를 mapping
Port-mapped I/O : Device register를 위해 별도의 memory address space가 있음 (special I/O bus, instructions)
DMA(Direct Memory Access)
CPU의 개입 없이 I/O controller가 Memory에 직접 접근하여 읽고 쓸 수 있도록 함
Cycle stealing : CPU가 Bus를 사용하지 않을 때만 DMA가 Bus 사용
Block transfer : CPU와 DMA controller가 대등하게 경쟁
Interrupt Mechanism
Interrupt : Hardware mechanism that transfers control to ISR
Hardware interrupt(Async), Software interrupt(Sync)로 분류
Interrupt 처리 과정
1. 현재 instruction을 완료하고 프로세서의 PC값을 저장
2. 현재 수행 중인 프로그램 중단
3. IRQ number를 통해 Interrupt source 확인
4. Interrupt vector table을 검색하여 ISR 주소 확인하고 수행
* 하드웨어 인터럽트를 받기 위해 IRQ (Interrupt Request) pin이 필요
PIC (Programmable Interrupt Controller)
많은 I/O device interrupt를 scalable하게 처리할 수 있도록 함
IRQ signal이 오면 그에 맞는 vector로 변환하여 CPU에게 전달함
* Interrupt mask : 특정 Interrupt source가 발생시키는 인터럽트를 무시하거나 향후에 처리할 수 있도록 함
Hardware Protection Mechanisms
Dual Mode : Kernel mode, User mode로 분리함
Kernel mode에서는 privileged instruction을 수행시킬 수 있고, 모든 memory 영역에 접근할 수 있음
Dual Mode 구현 : Mode bit & Interrupt
Mode bit : PSW (Processor Status Word)의 한 부분에 위치해 있음
* System call : User program이 kernel mode에서 kernel function을 호출하는 방법
I/O Protection : All I/O instructions are privileged instructions
Memory Protection : Base/Bound register와 관련된 것은 privileged instruction
CPU Protection : Timer와 관련된 것은 privileged instruction
'Basic Learning > Operating System Concepts' 카테고리의 다른 글
Deadlock (0) | 2020.06.15 |
---|---|
Process Synchronization (0) | 2020.06.14 |
CPU Scheduling (0) | 2020.06.14 |
Processes and Threads (0) | 2020.06.14 |
Introduction to OS (0) | 2020.06.13 |