System call: A service request that the application makes to the operating system. (Asynchronous or synchronous)
Exception: An illegal instruction or other reason that causes the current instruction to execute after a failed processing request. Synchronization
Interrupt: A processing request from a hardware device. Asynchronous
Interrupt handling mechanism:
1.CPU initialization interrupt enable, that is, to set the processing of different interrupts corresponding to the process.
2. Hardware: Set interrupt flag, an interrupt vector call the corresponding interrupt service routine (in the interrupt vector table, and then call the exception service routine or system invoke service routine or interrupt service routine)
3. Software: On-site storage (compiler Work)
Interrupt service processing (handled by the appropriate service routines for the above work)
Clear interrupt Token (service routine)
On-site recovery (compiler Work)
System call: Program Access invokes the system call method through a high-level API (C,c++,java library, etc.), rather than invoking the system call interface directly.
function calls and system calls use different stacks, divided into user states and kernel states.
Example: Customers go to the bank to withdraw money, the salesperson from the safe, and then handed over to the customer. Not the customer to take the money in the safe.
Interrupts, exceptions, and system calls