Operating Systems

 

 

 

Operating Systems

 

The following texts are the property of their respective authors and we thank them for giving us the opportunity to share for free to students, teachers and users of the Web their texts will used only for illustrative educational and scientific purposes only.

 

All the information in our site are given for nonprofit educational purposes

The information of medicine and health contained in the site are of a general nature and purpose which is purely informative and for this reason may not replace in any case, the council of a doctor or a qualified entity legally to the profession.

 

 

Operating Systems

 

  • What is an Operating system?

        An operating system is a program that manages the computer hardware. It also provides a basis for application programs and act as an intermediary between a user of a computer and the computer hardware. It controls and coordinates the use of the hardware among the various application programs for the various users.

  • What does Spooling mean?

        Spooling-Simultaneous peripheral  operations on line. It is a high-speed device like a disk is interposed between a running program and a low –speed device involved with the program in input/output. It disassociates a running program from the slow operation of devices like printers.

  • What is the advantage of Multiprogramming?

            Multiprogramming increases CPU utilization by organizing jobs so that the CPU always has one to execute. Several jobs are placed in the main memory and the processor is switched from job to job as needed to keep several jobs advancing while keeping the peripheral devices in use. . Multiprogramming is the first instance where the Operating system must make decisions for the users. Therefore they are fairly sophisticated.

  • What is an Interactive computer system?

   Interactive computer system provides direct communication between the user and the system.The user gives instructions to the operating system or to a program directly, using a keyboard or mouse ,and waits for immediate results.

  • Define the essential properties of batch system and interactive system
  • An interactive, or hands-on, computer system provides on-line communication between the user and the system. The user gives instructions to the Operating system directly and receives an immediate response.
  • Batch systems are quite appropriate for executing large jobs that need little interaction. The user can submit jobs and return later for the results. It is not necessary to wait while the job is processed.

 

  • What do you mean by Time-sharing systems?

           Time-sharing or multitasking is a logical extension of multiprogramming. It allows many users to share the computer simultaneously. The CPU executes multiple jobs by switching among them, but the switches occur so frequently that the users can interact with each program while it is running.

  • What do you mean by Distributed system?

          Distributed system or loosely coupled systems consists of a collection of processors that do not share memory or a clock. Instead each processor has its own local memory. The processors communicate with one another through various communication lines, such as high speed buses or telephone lines.

  • Why are distributed systems desirable?

    Distributed systems are desirable for the following reasons;

  • Resource sharing
  • Computation speedup
  • Reliability
  • Communication
  • What is a Real time system?

           A real time system has well defined, fixed time constraints. Processing must be done within the defined constraints, or the system will fail. It is often used as a control device in a dedicated application. A real time system functions correctly only if it returns the correct result within its time constraints.

  • What are the two types of real time systems?
      • Hard real time system
      • Soft real time system

 

  • What is the difference between Hard real time system and Soft real time system?

           A hard real time system guarantees that critical tasks complete on time. In a soft real time system, a critical real-time task gets priority over the other tasks, and retains that priority until it completes. Soft real time systems have more limited utility than do hard real-time systems.

  • What is Dual- Mode Operation?

           The dual mode operation provides us with the means for protecting the operating system from errant users and errant users from one another. User mode and monitor mode are the two modes. Mode bit is attached to the hardware of the computer to indicate the current mode. Mode bit is ‘0’ for monitor mode and ‘1’ for user mode.

  • List five services provided by an Operating System?
  • Program execution
  • I/O Operation
  • File-System manipulation
  • Communications
  • Error detection

 

  • What do you mean by System Calls?

          System calls provide the interface between a process and the Operating system. System Calls are also called as Monitor call or Operating-system function call. When a system call is executed, it is treated as by the hardware as software interrupt. Control passes through the interrupt vector to a service routine in the operating system, and the mode bit is set to monitor mode.

  • What are the five major categories of System Calls?
  • Process Control
  • File-management
  • Device-management
  • Information maintenance
  • Communications

 

  • What is the purpose of System 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.

  • What are the design goals of an operating system?

         The requirements can be divided into two basic groups: User goals and System goals. Users desire that the system should be convenient and easy to use, easy to learn, reliable, safe and fast. The Operating system should be easy to design, implement, and maintain. Also it should be flexible, reliable, error free and efficient. These are some of the requirements, which are vague and have no general solution.

  • What do you mean by Policy and Mechanism?

          Mechanisms determine how to do something and Policies determine what will be done. For example, the timer construct is a mechanism for ensuring CPU protection, but deciding how long the timer is to be set for a particular user is a policy decision.

  • Why is the separation of mechanism and policy a desirable principle?

        The separation of policy and mechanism is important for flexibility. The policies are likely to change across places or over time. In the worst case, each change in policy would require a change in the underlying mechanism. A general mechanism would be more desirable.

  • What are the advantages of implementing an Operating system in higher-level languages?

        The code can be written faster, is more compact, and is easier to understand and debug. In addition, improvements in compiler technology will improve the generated code for the entire operating system by simple recompilation. Finally an operating system is far easier to port (to move to some other hardware) if it is written in higher-level language.

  • What are the disadvantages of implementing an Operating system in higher level languages?                        

        The major disadvantages are;

  • Reduced speed
  • Increase in storage requirements.
  • What is the main advantage of the layered approach to System design?

        The main advantage of layered approach is modularity. The layers are selected such that each uses functions and services of only lower-level layers. This approach simplifies debugging and system verification.

  • What are the two I/O methods?
    • Synchronous I/O
    • Asynchronous I/O.

 

  • What is the difference between Synchronous I/O and Asynchronous I/O?

         In the case of synchronous I/O, once the I/O is started, then at I/O completion, control is returned to the user process. In the case of asynchronous I/O, returns control to the user program without waiting for the I/O to complete.

 

  • What is meant by context switch?

         Switching the CPU to another process requires saving the state of the old process and loading the saved state for the new process. This task is known as context switch.

  • What do you mean by process?

        A process is a program in execution. It is more than a program code which includes the current activity, as represented by the value of program counter and the content of processor’s registers. It also includes the process stack, containing temporary data and a data section containing global variables. 

  • What are the various process states?
    • New
    • Running
    • Waiting
    • Ready
    • Terminated.

 

  • What do you mean by process control block?

           Each process is represented in the Operating system by a process control block or task control block. It contains many information associated with a specific process, including process state, program counter, CPU registers, CPU scheduling information, Memory management information, accounting information and I/O information.

  • Differentiate long term scheduler and short term scheduler
      • The long-term scheduler or job scheduler selects processes from the job pool and loads them into memory for execution.
      • The short-term scheduler or CPU scheduler selects from among the process that are ready to execute, and allocates the CPU to one of them.

 

  • What is the use of fork and execve system calls?

        Fork is a System call by which a new process is created. Execve is also a System call, which is used after a fork by one of the two processes to replace the process memory space with a new program.

  • What do you mean by co-operating processes?

           A process is cooperating if it can affect or affected by the other processes executing in the system. Clearly, any process that shares data with other processes is a cooperating process.

  • What are the benefits of cooperating processes?
  • Information sharing
  • Computation speedup
  • Modularity
  • Convenience.

 

  • What is a thread?

          A thread otherwise called a lightweight process is a basic unit of CPU utilization. It shares with peer threads its code section, data section, and operating system resources such as open files and signals, collectively known as a task. It consists of a program counter, a register set, and a set space.

  • What is the use of Interprocess communication?

           Interprocess communication provides a mechanism to allow the cooperating processes to communicate with each other and to synchronize their actions. Interprocess-communication is best provided by a message system.

  • What is a Dispatcher?

         The dispatcher is the module that gives control of the CPU to the process selected by the short-term scheduler. This function involves Switching context, Switching to user mode and jumping to the proper location in the user program to restart that program.

  • What is dispatch latency?

       The time taken by the dispatcher to stop one process and start another running is known as dispatch latency.

  • Define throughput in CPU scheduling?

      Throughput in CPU scheduling is the number of processes that are completed per unit time. For long processes, this rate may be one process per hour; for short transactions, throughput might be 10 processes per second.

  • What is turnaround time in CPU scheduling?

      Turnaround time is the interval from the time of submission to the time of completion of a process. It is the sum of the periods spent waiting to get into memory, waiting in the ready queue, executing on the CPU, and doing I/O.

  • What is waiting time in CPU scheduling?

      Waiting time is the sum of periods spent waiting in the ready queue. CPU scheduling algorithm affects only the amount of time that a process spends waiting in the ready queue.

  • What is Response time in CPU scheduling?

      Response time is the measure of the time from the submission of a request until the first response is produced. Response time is amount of time it takes to start responding, but not the time that it takes to output that response.

  • What do you mean by Critical section?

       Each process has a segment of code called a critical section, in which the process may be changing common variables, updating a table, writing a file, and so on.

  • What are the three requirements for the solution to critical section problem?
    • Mutual Exclusion
    • Progress
    • Bounded Waiting
  • What are Semaphores? Why are the needed?

        A Semaphore ‘S’ is a Synchronization tool which is an integer value that, apart from initialization, is accessed only through two standard atomic operations; wait and signal.
Semaphores can be used to deal with the n-process critical section problem. It can be also used to solve various Synchronization problems.

  • What are the two types of Semaphore?
    • Counting semaphores
    • Binary semaphores.

 

  • What is the difference between counting and binary semaphores?

         A counting semaphore is a semaphore with an integer value that can range over an unrestricted domain. A binary semaphore is a semaphore with an integer value that can range between 0 and 1.It is simpler to implement than a counting semaphore.

  • Differentiate deadlock and starvation.

          A set of processes is in deadlock state when every process in the set is waiting for an event that can be caused only by the other process in the set.
Starvation or indefinite blocking is a situation where processes wait indefinitely within the semaphore.

  • What are the four conditions under which a deadlock situation can arise?
    • Mutual exclusion
    • Hold and wait
    • No preemption
    • Circular wait

 

  • What do you mean by Resource-Allocation Graph?

      Deadlocks can be described more precisely in terms of a directed graph called a system resource allocation graph. This graph consists of a set of vertices V and a set of edges E. Vertices is partitioned into ; P the set consisting of all processes in the system and R the set consisting of all resource types in the system.

  • What are the three methods of handling deadlocks?
    • Use a protocol to ensure that the system will never enter a deadlock state.
    • Allow the system to enter the deadlock state and then recover.
    • Ignore the problem all together, and pretend that deadlocks never occur in the system.

 

  • What is deadlock avoidance?

          Deadlock avoidance requires that the operating system be given in advance additional information concerning which resources a process will request and use during its life time.

  • What is deadlock prevention?

        Deadlock prevention is a set of methods for ensuring that at least one of the necessary cannot hold. These methods prevent deadlocks by constraining how requests for resources can be made.

 

  • What is the difference between logical and physical addresses?

         An address generated by the CPU is commonly referred to as a logical address, whereas an address seen by the memory unit is commonly referred to as physical address.

  • What do you mean by best fit?

         Best fit allocates the smallest hole that is big enough. Entire list has to be searched, unless it is sorted by size. This strategy produces the smallest leftover hole.

  • What do you mean by first fit?

         First fit allocates the first hole that is big enough. Searching can either start at the beginning of the set of holes or where the previous first-search ended. Searching can be stopped as soon as a free hole that is big enough is found.

  • What is external fragmentation?

        External fragmentation exists when enough total memory space exists to satisfy a request, but it is not contiguous; storage is fragmented into a large number of small holes.

  • What do you mean by compaction?

        Compaction is a solution to external fragmentation. The memory contents are shuffled to place all free memory together in one large block. It is possible only if relocation is dynamic, and is done at execution time.

  • Explain briefly the main concept of paging?

        Paging is a memory management scheme that permits the physical-address space of a process to be noncontiguous. In the case of paging, physical memory is broken into fixed-sized blocks called frames and logical memory is broken into blocks of the same size called pages.

  • How is memory protected in a paged environment?

       Protection bits that are associated with each frame accomplish memory protection in a paged environment. The protection bits can be checked to verify that no writes are being made to a read-only page.

  • What is the use of valid-invalid bits in paging?

When the bit is set to valid, this value indicates that the associated page is in the process’s logical address space, and is thus a legal page. If the bit is said to invalid, this value indicates that the page is not in the process’s logical address space. Using the valid-invalid bit traps illegal addresses.

  • What is the basic method of segmentation?

            Segmentation is a memory management scheme that supports the user view of memory. A logical address space is a collection of segments. The logical address consists of segment number and offset. If the offset is legal, it is added to the segment base to produce the address in physical memory of the desired byte.

  • What is virtual memory?

       Virtual memory is a technique that allows the execution of processes that may not be completely in memory. It is the separation of user logical memory from physical memory. This separation provides an extremely large virtual memory, when only a smaller physical memory is available.

  • What is Demand paging?

        In Demand paging, the pager brings only those necessary pages into memory instead of swapping in a whole process. Thus it avoids reading into memory pages that will not be used anyway, decreasing the swap time and the amount of physical memory needed.

  • How does page replacement takes place in optimal algorithm?

        In Optimal algorithm, it replaces the page that will not be used for the longest period of time. Optimal algorithm has the lowest page-fault rate of all algorithms.

  • What is the disadvantage of optimal page replacement algorithm?

       Even though optimal algorithm has the smallest page fault-rate, it is difficult to implement, because it requires future knowledge of the reference string. As a result, it is used mainly for comparison studies.

  • How does page replacement takes place in LRU algorithm?

      In Least Recently Used algorithm, it replaces the page that has not been used for the longest period of time. LRU replacement associates with each page the time of that page’s last use. It can be implemented using counters or stack.

  • What is Belady’s anomaly?

      Belady’s anomaly reflects the fact that, for some page-replacement algorithms, the page- fault rate may increase as the number of allocated frame increases.

  • Define thrashing?

        High paging activity is called thrashing. A process is thrashing if it is spending more time paging than executing. The page fault rate increases tremendously during thrashing.

  • What do you mean by swapping?

        In Swapping, processes are copied from main memory to a backing store, and later are copied back to main memory. This scheme allows more processes to be run that can be fit into memory at one time.

  • What do you mean by worst fit?

       Worst fit allocates the largest hole. Entire list must be searched, unless it is sorted by size. This strategy produces the largest leftover hole, which may be more useful than the smallest leftover hole from a best-fit approach.

  • What do you mean by two level paging schemes?

         In a two level paging algorithm, the page table itself is also paged. There will be an outer page table in which each page is again divided into pages to give the inner page table.

  • What are the advantages of segmentation?

        A particular advantage of segmentation is the association of protection bits with the segments to prevent illegal accesses to memory. Another advantage involves the sharing of code or data.

  • What are the advantages of Virtual memory?

         A program would be no longer be constrained by the amount of physical memory that is available. Also increases CPU utilization and throughput.

  • What do you mean by global and local replacement?

          Global replacement allows a process to select a replacement frame from the set of all frames even if it belongs to other process. Local replacement requires that each process select from only its own set of allocated frames.

  • What are the effects of thrashing?

          Thrashing results in low CPU utilization .The system throughput plunges and the page fault increases tremendously. As a result the effective memory access time increases as the processes are spending all their time paging.

  • How is thrashing prevented using Page-Fault Frequency strategy?

          In order to control the page-fault rate, a upper and lower bounds are established on the desired page-fault rate. If the actual page-fault rate exceeds the upper limit, the process is allocated with another frame. If it falls below the lower limit, a frame is removed from that process. Thus, page-fault rate can be controlled to prevent thrashing.

  • Define seek time and latency time

            The time taken by the head to move to the appropriate cylinder or track is called seek time. Once the head is at right track, it must wait until the desired block rotates under the read- write head. This delay is latency time.

  • What are the allocation methods of a disk space?
  • Contiguous allocation
  • Linked allocation
  • Indexed allocation

 

  • What are the drawbacks of contiguous allocation of disk space?
  • Suffers from external fragmentation
  • Suffers from internal fragmentation
  • Difficulty in finding space for a new file.
  • Size of the file is to be declared in advance.
  • What are the disadvantages of linked allocation?
  • Used only for sequential access of files.
  • Space required for the pointers.
  • Reliability.

 

  • What are the advantages of Indexed allocation?
  • No external-fragmentation problem
  • Solves the size-declaration problems.
  • Supports direct access

                                                                                                                                  

  • What are the advantages of Contiguous allocation?
  • Supports direct access
  • Supports sequential access
  • Number of disk seeks is minimal.
  •  What are the advantages of Linked allocation?

            No external fragmentation
Size of the file does not need to be declared.

  •  How Free-space management is implemented using bit vector?

           Free-space list is implemented as a bit map or bit vector. Each block is represented by 1 bit. If the block is free, the bit is 1; if the block is allocated, the bit is 0.

  •  Define rotational latency.

          Rotational latency is the additional time waiting for the disk to rotate the desired to the disk to rotate the desired sector to the disk head.

  • Define disk bandwidth?

         Disk bandwidth is the total number of bytes transferred, divided by the total time between the first request for service and the completion of the last transfer.

  • What are the various Disk-Scheduling algorithms?
  • First Come First Served Scheduling
  • Shortest Seek Time First Scheduling
  • SCAN Scheduling
  • C-SCAN Scheduling
  • LOOK Scheduling
  • What is a file?

          A file is a named collection of related information that is recorded on the secondary storage. Commonly, files represent programs and data. In general, file is a sequence of bits, bytes, lines, or records.

  • List the various file attributes?

           Name
Identifier
Type
Location
Size
Protection
Time, date and user identification 

  • What are the various file operations?
  • Creating a file
  • Writing a file
  • Reading a file
  • Repositioning within a file
  • Deleting a file
  • Truncating a file.
  • What are the Access methods for files?

           Sequential Access
Direct Access
Indexed Access.

  • What is the use of relative block number in direct access?

          The relative block number allows the operating system to decide where the file should be placed , and helps to prevent the user from accessing portions of the file system that may not be part if his file.

  • What is Directory?

           The device directory or simply known as directory records information- such as name, location, size, and type for all files on that particular partition. The directory can be viewed as a symbol table that translates file names into their directory entries.

  • What are the most common schemes for defining the logical structure of a  directory ?

          Single-Level Directory
Two-level Directory
Tree-Structured Directories
Acyclic-Graph Directories
General Graph Directory.

  • Discuss two-level directory

           In the two-level directory structure, each user has her own user file directory (UFD). Each UFD has a similar structure, but lists only the files of a single user. When a user logs in, the system’s master file directory (MFD) is searched. The MFD is indexed by user name or account number, and each entry points to the UFD for that user.

  • What do you mean by Consistency Semantics?

            Consistency Semantics is an important criterion for evaluating any file system that supports file sharing. It is a characterization of the system that specifies the semantics of multiple users accessing a shared file simultaneously.

  • What is Shell in UNIX Systems?

            The Shell is the UNIX systems mechanism for interfacing between users and the system. It is a command interpreter that reads lines typed by the user and causes the execution of the requested system features.

  • Name some of the most popular shells?

           Bourne shell
Berkley shell
Korn shell

  • Define Kernel in UNIX Systems?

            The Kernel is the central part of the UNIX operating systems. It encapsulates the hardware and provides UNIX systems services to application programs. The Kernel provides process management, memory management, I/O management, and timer management.

  •  What do you mean by Signals in UNIX Systems.

            Signals are software mechanism similar to hardware interrupts. A signal is used to inform a process asynchronously of the occurrence of an event. Signals that occur at the same time are actually presented one at a time to a process, but there is no particular ordering assigned. They are not intended to be used for interprocess communication.

  • What are the design issues of a Distributed Operating System?

              Transparency
User mobility
Fault tolerance
Scalability

 

Source : http://www.niceindia.com/qbank/operating_systems.doc

Web site link to visit: http://www.niceindia.com

Google key word : Operating Systems file type : doc

Author : not indicated on the source document of the above text

If you are the author of the text above and you not agree to share your knowledge for teaching, research, scholarship (for fair use as indicated in the United States copyrigh low) please send us an e-mail and we will remove your text quickly.

 

Operating Systems

 

If you want to quickly find the pages about a particular topic as Operating Systems use the following search engine:

 

 

Operating Systems

 

Please visit our home page

 

Larapedia.com Terms of service and privacy page

 

 

 

Operating Systems