Page 38 - DCAP403_Operating System
P. 38

Unit 3: Operating System Structure




          best relegated to the operating systems to manage it than giving individual users the control of   Notes

          it. It is not difficult for the user-level programs to provide these services but for above mentioned
          reasons it is best if this services left with operating system.
          Communications

          There are instances where processes need to communicate with each other to exchange
          information. It may be between processes running on the same computer or running on the
          different computers. By providing this service the operating system relieves the user of the
          worry of passing messages between processes. In case where the messages need to be passed to
          processes on the other computers through a network it can be done by the user programs. The

          user program may be customized to the specifics of the hardware through which the message
          transits and provides the service interface to the operating system.
          Error Detection

          An error is one part of the system may cause malfunctioning of the complete system. To avoid
          such a situation the operating system constantly monitors the system for detecting the errors.
          This relieves the user of the worry of errors propagating to various part of the system and causing
          malfunctioning.

          This service cannot allowed to be handled by user programs because it involves monitoring
          and in cases altering area of memory or deallocation of memory for a faulty process. Or may be
          relinquishing the CPU of a process that goes into an infinite loop. These tasks are too critical to

          be handed over to the user programs. A user program if given these privileges can interfere with
          the correct (normal) operation of the operating systems.

          3.2 System Calls


          System calls provide an interface between a running program and operating system. System calls
          are generally available as assembly language instructions. Several higher level languages such as
          C also allow to make system calls directly.

          In UNIX operating system the system call interface layer contains entry point in kernel code. All
          system resources are managed by the kernel. Any request from user or application that involves
          access to any system resource must be handled by kernel code. The user process must not be given
          open access to kernel code for security reason. Many opening into kernel code called system calls
          are provided to user so that the user processes can invoke the execution of kernel code. System
          calls allow processes and users to manipulate system resources.
          There are three general methods that are used to pass information (parameters) between a
          running program and the operating system.
          1.   One method is to store parameters in registers.
          2.   Another is to store parameters in a table in memory and pass the address of table.
          3.   The third method is to push parameters on stack and allow operating system to pop the
               parameters off the stack.

          System Calls for Process Management

          These types of system calls are used to control the processes. Some examples are end, abort, load,
          execute, create process, terminate process etc.


                Example: The exit() system call ends a process and returns a value to it parent.



                                           LOVELY PROFESSIONAL UNIVERSITY                                    31
   33   34   35   36   37   38   39   40   41   42   43