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 Kernel 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 handler 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.