Traps and System Calls in Operating System (OS)

On the off chance that Operating System (OS) is secured, how does program request administrations from OS?
Client programs can’t call capacities inside working framework’s memory, since it can’t see those territories of memory.

An extraordinary client mode machine guidance, known as TRAP guidance, causes an exemption, switches CPU mode to Kernal mode, and starts handler for TRAP guidance.

To request specific help from OS, client program places esteem in machine registers to show what administration it requires. At that point, it executes TRAP guidance, which changes CPU mode to advantaged mode, and moves execution to TRAP hander in OS’s memory.

OS checks solicitation, and performs it, utilizing dispatch table to pass control to one of lot of OS administration schedules. At the point when administration has been played out, OS returns control to the program, bringing down benefits back to client mode. Hence, activity just approaches favored OS through solitary, all around ensured section point.

This component for acquiring OS administrations is known as System Call. The arrangement of accessible framework calls is known as the Operating System’s Application Program Interface or API.

Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using or mail your article to See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

Article Tags :
Practice Tags :