Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- Sector
- register
- refactoring
- addressing mode
- floating point
- L2 switch
- TCP
- 사설 IP
- 가독성
- MMU
- 리펙토링
- 공인 IP
- Code complete
- CPU
- cache
- private ip
- Clean code
- 코드 컴플릿
- page
- physical address
- L3 Router
- network
- 명령어
- 클린 코드
- ack
- float
- Public IP
- interrupt
- osi 7
- ALU
Archives
- Today
- Total
Software Lab
2. Trap interrupt 본문
Trap 인터럽트 중에서 0으로 나눌 때 발생하는 divide_error 인터럽트 과정을 살펴보자.
① : CPU가 Process A를 실행 중에 int a = 10 / 0 코드를 가져와서 처리하게 되었다. 그로 인해 0x00번 인터럽트(divide_error)가 발생하게 된다. ② : CPU는 발생한 인터럽트 번호와 IDTR(Interrupt Description Table Register) 값을 더한다. 더한 그 값은 OS의 ISR 함수 포인터가 저장된 메모리 주소이다. ③ : CPU는 이제 ISR의 함수 포인터를 가져와서 실행한다. 인터럽트 번호가 0x00이므로 divide_error를 실행할 것이다. divide_error에서는 Process A를 강제 종료시킬 것이다. OS에 마다 처리 방식은 다를 수 있다. |
참고로 Process A에서 OS로 실행 Process가 전환된다. 즉 Context Switching이 되므로 ISR 시작 전에는 Context Save를, 종료 후에는 Context Restore를 하게된다.
'컴퓨터 구조 > Interrupt' 카테고리의 다른 글
4. External interrupt (0) | 2022.09.27 |
---|---|
3. Internal interrupt (0) | 2022.09.27 |
1. 인터럽트 종류 (0) | 2022.09.26 |
Comments