0

I'm not sure if I'm at the right place to ask this but I'm learning about operating systems and I can't find any info on this.

I read that interrupts are created when a call is made in user mode that requests a system service. But I can't find the reason why this happens. I'm assuming the interrupt also checks for permissions or something?

Thanks for enlightening me,

user1841243
  • 115
  • 5
  • which *operating system*? – Jakuje Feb 21 '16 at 19:46
  • 2
    The text you have been reading is mixing up terminology. Interrupts, exceptions, and system calls are not the same thing. Even if all three of them can transfer control from user mode to kernel mode in pretty much the same way, and you can use the same instruction to return from any of them. – kasperd Feb 21 '16 at 19:51

1 Answers1

0

Interrupts are the way for the OS kernel to allow certain access to executable code, typically preempting the process in which the code is executing.

Ctrl-C, or kill -9 both use interrupts (in UNIX) as a low-level way for an external process (perhaps a user logged into a terminal) to engage with an otherwise isolated program.

The kernel allows the interrupts -- basically system-level hooks -- but the executable code can decide how to respond to most of them. The process (or user) initiating the interrupt signal must have permissions of the executable.

Tom Harrison Jr
  • 575
  • 1
  • 6
  • 16