0
votes

So I know an operating system call is a demand to the OS to receive some type of resource. What i don't know is whether or not the operating system call is an interrupt or not? Or are all operating system calls interrupts? I know a device interrupts the OS for a resource, but are operating system calls just instructions from a program and not an interrupt? Or is an interrupt just a special instruction?

3

3 Answers

0
votes

A system call is just calling a function provided by the operating system; it might interrupt a system process, but that would not be visible to the user. From your program's perspective, its no different from calling any other function.

An interrupt is an event that interrupts normal program flow in your program; often they are generated by the OS. An interrupt can be caught by your program, or, if you don't program a handler to catch it, it can fall through to a handler provided by a parent process.

0
votes

'Interrupt' is one of those words that is grossly overloaded, and it's getting worse.

An interrupt used to mean a 'real' hardware interrupt from some peripheral - dragging down an interrupt-request pin on the CPU package caused the hardare to jump to a pre-programmed location whn the interrupt got handled, usually at the end of execution of the current machine instruction.

Other languages have used 'interrupt' for other purposes, eg. Java: 'An interrupt is an indication to a thread that it should stop what it is doing and do something else.' Related, but not the same.

In OS class, an 'interrupt' is an entry to the OS that changes protection level, eg. enters kernel state. This can happen from a user syscall or from a driver entered from a hardware interrupt and both of these actions are known as 'interrupts'. The user-level syscall may, or may not, use a 'software interrupt' mechanism that mimics a hardware interrupt.

Anyway, now waiting for the next overload to cause more confusion.

I've heard that 'static' now has yet another meaning in C++ :((

0
votes

An interrupt is a signal to the processor from a device attached to a computer or from a program within the computer indicating an event that needs immediate attention.

Interrupts provide a mechanism by which other modules (I/O, memory) may interrupt the normal processing of the processor.

An interrupt alerts the processor to a high-priority condition requiring the interruption of the current code the processor is executing.

The processor responds by suspending its current activities, saving its state, and executing a function called an ISR to deal with the event.

This interruption is temporary, and, after the interrupt handler finishes, the processor resumes normal activities. complete article here