Вы находитесь на странице: 1из 7

November 2012 Bachelor of Computer Application (BCA) Semester 3 BC0042 - Operating Systems (Book ID: B0682)

1. What are the services provided by Operating Systems? Explain briefly. Ans _ Following are the five services provided by operating system for the convenience of the users. I. Program Execution The purpose of a computer system is to allow user to execute programs. So the operating system provides an environment where the user can conveniently run programs. The user does not have to worry about the memory allocation or multitasking. These things are taken care of by the operating systems.

II.

I/O Operations Each program requires an input and produces output. This involves the use of I/O. The operating systems hide from the user the details of underlying hardware for the I/O. All the users see that the I/O has been performed without any details. So the operating system, by providing I/O, makes it convenient for the users to run programs.

III.

Files System Manipulation The output of a program may need to be written into new files or input taken from some files. The operating system provides this service. User gives a command for reading or writing to a file and sees his/her task accomplished. This service involves secondary storage management. The speed of I/O that depends on secondary storage is critical to the speed of many programs and hence I think it is best relegated to the operating system to manage it than giving individual users the control of it.

IV.

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 relives the user from worry of passing messages between processes. The user program may be customized to the specifications of the hardware through which the message transits and provides the service interface to the operating system.

V.

Error Detection An error in one part of the system may cause malfunctioning of the complete system. To avoid such situation the operating system constantly monitors the system for detecting the errors. This relieves the user from the worry of errors propagating to various part of the system and causing malfunctioning. This service cannot be allowed to be handled by user programs because it involves monitoring and in cases altering area of memory or deallocation pf memory for a faulty process, or may be relinquishing the CPU of a process that goes into an infinite loop.

2. What is Micro-kernel? What are the benefits of Micro-kernel? Ans _ In the mid-1980s, researches at Carnegie Mellon University developed an operating system called MACH that modularized the kernel using the microkernel approach. Microkernels provide minimal process and memory management, in addition to a communication facility. The main function of the microkernel is to provide a communication facility between the client program and the various services that are also running in user space. On benefit of the microkernel approach is ease of extending the operating system. All new services are added to user space and consequently do not require modification of the kernel. When the kernel does have to be modified, changes tend to be fewer, because the microkernel is a smaller kernel. The microkernel also provided more security and reliability, since most services are running as user- rather than kernel processes, if a service fails the rest of the operating system remains untouched.

3. Draw the diagram for Unix Kernel components and explain about each components briefly. Ans _ The UNIX kernel has components as depicted in the fig bellow. The figure is divided in to three modes: user mode, kernel mode, and hardware. The user mode contains user programs which can access the services of the kernel components using system call interface. The kernel mode has four major components: system calls, files subsystem, process control subsystem, and hardware control. The system calls are interface between user program and files and process control subsystems. The files subsystem is responsible for file and I/O management through device drivers. The process control subsystem contains scheduler, inter-process communication and memory management. Finally the hardware control is the interface between these two subsystems and hardware.

User programs User Mode Kernel Mode

System Calls File subsystem Process control subsystem Scheduler

buffers

Memory management

character

block

device drivers hardware control hardware


4. Explain seven state process models used for OS with necessary diagram. Ans -

Kernel Mode Hardware

New Exit

Ready/ Suspend

Ready

Running

Blocked/

Blocked

Suspend

The following figure shows the seven state process model in which uses above described swapping technique. Blocked to Blocked/Suspend : If there are now ready processes in the main memory, At least one blocked process is swapped out to make room for another process that is not blocked. Blocked/Suspend to blocked: If a process is terminated making space in the main memory, and if there is any high priority process which is blocked but suspended, anticipating that it will become free very soon, the process is brought in to the main memory. Blocked/Suspend to Ready/suspend : A process is moved from Blocked/suspend to Ready/Suspend, if the event occurs on which the process was waiting, as there is no space in the main memory. Ready/Suspend to Ready : If there are no ready process in the main memory, operating system has to bring one in the main memory to continue the execution. Sometime this transition takes place even there are ready processes in main memory but having lower priority then one of the processes in Ready/Suspend state. So the high priority process is brought in the main memory. Ready to Ready/Suspend: Normally the blocked processes are suspended by the operating system but sometimes to make large block free, a ready process may be suspended. In this case normally the low priority processes are suspended. New to Ready/Suspend: When a new process is created, it should be added to the Ready state. But sometime sufficient memory may not be available to allocate to the newly created process. In this case, the new process is sifted to ready/Suspend.

5. Define process and threads and differentiate between them. Ans Process: The term process is used somewhat interchangeably with task or job. There are quite a few definitions presented in the literature, for instance. A program in Execution. An asynchronous activity. The entity to which processors are assigned. The dispatchableunit. Threads: A thread is single sequence stream within in a process. Because threads have some of the properties of process, they are sometimes called lightweight processes. In a process, threads allow multiple executions of streams. In many respect, threads are popular way to improve application through parallelism. Differences between Process and Threads: Unlike processes, threads are not independent of one another. Unlike processes, all threads can access every address in the task. Unlike processes, threads are designed to assist one other. (Processes might or might not assist one another because processes may originate from different users.)

6 .What is a virtual memory? What are its significance in Operating system?


Ans Virtual memory refers to the technology in which some space in hard disk is used as an extension of main memory so that a user program need not worry if its size extends the size of the main memory. if that does happen, at any time only a part of the program will reside in main memory, and other parts will otherwise remain on hard disk and may be switched into memory later if needed. With virtual memory, if a piece of process that is needed is not in a full main memory, then another piece will be swapped out and the former be brought in. The operating system is the other part that is engaged in virtual memory implementation besides the hardware part in the microprocessor for address translation. if we have a look at the popular operating systems over the history, we may find out that except for MS-DOS and specialized systems, all important operating system provide virtual memory support. And they usually use paging or the combination of paging and segmentation for virtual memory subsystem.

Вам также может понравиться