Interrupt-driven : 사용자로부터 받는 Interrupt나 운영체제의 요청, 오류에 의해 일어나는 Trap이 발생할 경우 작업 시작
Software interrupt (System call)
Hardware interrupt (Interrupt generated by hardware)
I/O completed
Packet arrived thru network interface card
Mouse move
등과 같은 Interrupt가 발생하면 실행되는 Function이 OS에 있음
Handling errors occurred during execution of programs
Divide by zero, overflow, …
Other process problems include infinite loop, processes modifying each other or the operating system
Main 함수가 없고, 이벤트가 발생하면 실행 (Call-back)
Interrupt : A signal to the CPU emitted by hardware or software indicating an event that requires immediate action
Hardware interrupt
Internal interrupt
Software interrupt
1. Stops what CPU is doing
2. Saves the address of the interrupted instruction
3. Transfers control to the interrupt service routine (ISR)
4. Resumes the interrupted instructionInterrupt sequence
- Miscellaneous (System Call, Protection)
System call : 시스템 호출(system call)은 운영 체제의 커널이 제공하는 서비스에 대해, 응용 프로그램의 요청에 따라 커널에 접근하기 위한 인터페이스, 보통 C나 C++과 같은 고급 언어로 작성된 프로그램들은 직접 시스템 호출을 사용할 수 없기 때문에 고급 API를 통해 시스템 호출에 접근하게 하는 방법
Operating systems are interrupt-driven
I/O requests -> Hardware interrupt
Software errors -> Internal interrupt
Division by zero, invalid memory access, …
OS service requests -> Software interrupt
Requests from a user program for OS system service
Dual-mode operation
Two separate modes of operation : user vs kernel mode
CPU protection and timer
CPU protection
A timer interrupts the CPU after specified period to prevent infinite loop
OS sets the timer, timer is decremented every clock tick