System Calls

About System Calls

  • Some operations that are executed by a process involve just the CPU and the memory.
  • Mathematical computations and logical decisiones are good examples of these.
  • But sometimes, the process needs to do other things, that it cannot do alone.
    For example:
    • interract with the computer hardware (e.g hard disk drive, camera, display monitor etc)
    • run another program (so creating another process)
    • communicating with the OS kernel (for example to ask a temporary suspension of the current process)

Accessing slow Hardware

  • Let's say that your program wants to read from a disk (or ssd) file.
  • Your program creates a system-call, asking the OS to do that on its behalf
  • OS write to electronic controller, asking for the device to get the required data.
    This happens very fast (tens or few hundreds of nanoseconds)
  • Waiting for a response:
    This could take miliseconds (1 milisecond equal to 1000000 nanoseconds!). In the meantime, the process in the blocked state, in which time it does not use CPU power, it just waits for the operation to complete.

Permissions

  • When a process calls the system, the system has an opportunity to check if that process can perform the operation, and stop it if it cannot.
  • We'll get into the details in other posts