Page 40 - DCAP403_Operating System
P. 40

Unit 3: Operating System Structure




          embedded systems) offers several levels of control - the (low privilege) level of which normal   Notes
          applications execute limits the address space of the program to not be able to access nor modify
          other running applications nor the operating system itself (called “protected mode” on x86),
          it also prevents the application from using any system devices (i.e. the frame buffer, network
          devices - any I/O mapped device). But obviously any normal application needs this ability,
          thus the operating system is introduced, it executes at the highest level of order and allows the
          applications to request for a service - a system call - which is implemented through hooking

          interrupt(s). If allowed the system enters a higher privileged state, executes a specific set of
          instructions which the interrupting program has no direct control over, then returns control to
          the former flow of execution. This concept also serves as a way to implement security.

          With the development of separate operating modes with varying levels of privilege, a mechanism
          was needed for transferring control safely from lesser privileged modes to higher privileged
          modes. Less privileged code could not simply transfer control to more privileged code at any
          arbitrary point and with any arbitrary processor state. To allow it to do so could allow it to break
          security. For instance, the less privileged code could cause the higher privileged code to execute
          in the wrong order, or provide it with a bad stack.

          System Calls for Time Management


          Many operating systems provide a time profile of a program. It indicates the amount of time that
          the program executes at a particular location or set of locations. A time profile requires either a

          tracing facility or regular timer interrupts. At every occurrence of the timer interrupt, the value of
          the program counter is recorded. With sufficiently frequent timer interrupts, a statistical picture

          of the time spent on various parts of the program can be obtained.
          System Calls for Device Management

          A program, as it is running, may need additional resources to proceed. Additional resources may

          be more memory, tape drives, access to files, and so on. If the resources are available, they can be
          granted, and control can be returned to the user program; otherwise, the program will have to
          wait until sufficient resources are available.

          These types of system calls are used to manage devices.


                Example: Request device, release device, read, write, get device attributes etc.




              Task    System calls are generally available as assembly language instructions. If I use C
             programming can I receive system call or not.

          3.3 System Programs


          Another aspect of a modern system is the collection of system programs. In the logical computer
          hierarchy the lowest level is hardware. Next is the operating system, then the system programs,
          and finally the application programs. System programs provide a convenient environment for

          program development and execution. Some of them are simply user interfaces to system calls;
          others are considerably more complex.
          They can be divided into these categories:
          1.   File management: These programs create, delete, copy, rename, print, dump, list, and
               generally manipulate files and directories.




                                           LOVELY PROFESSIONAL UNIVERSITY                                    33
   35   36   37   38   39   40   41   42   43   44   45