0% found this document useful (0 votes)
12 views2 pages

Operating System

Uploaded by

Sojitra Darshil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views2 pages

Operating System

Uploaded by

Sojitra Darshil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

IMP QUESTION of OS (3330701) Managing Input-Output unit: Operating System also allows the computer to manage its own

resources such as memory, monitor, keyboard, printer etc. Management of these resources is
required for an effective utilization.The operating system controls the various system input-
1 . what is an os .?
output resources and allocates them to the users or programs as per their requirement.
An operating system (OS) handles your computer needs by finding resources, applying
Consistent user interface: Operating System provides the user an easy-to-work user interface,
hardware management and providing necessary services. Operating systems are essential for
so the user doesn’t have to learn a different UI every time and can focus on the content and be
computers to be able to do everything they need to do.
productive as quickly as possible. Operating System provides templates, UI components to make
How do operating systems work?
the working of a computer, really easy for the user.
An operating system communicates with the various parts of your computer. It sends
Multitasking: Operating System manages memory and allow multiple programs to run in their
information to and from your computer hardware and the desired application or action in
own space and even communicate with each other through shared memory. Multitasking gives
order to carry out the tasks you request. The following pieces of equipment are in contact with
users a good experience as they can perform several tasks on a computer at a time.
your operating system:
Keyboard
4. Explain process life cycle
Monitor
Printer 1 Start
Mouse This is the initial state when a process is first started/created.
Disk drive
2 Ready
The process is waiting to be assigned to a processor. Ready processes are waiting to have the
5. Explain necessary conditions for deadlocks to occur.
2. Explain services of OS.
processor allocated to them by the operating system so that they can run. Process may come A deadlock situation can arise if and only if the following four conditions hold
User Interface
into this state after Start state or while running it by but interrupted by the scheduler to assign simultaneously in a system-
Program Execution
CPU to some other process.
File system manipulation Mutual Exclusion: At least one resource is held in a non-sharable mode that is only one process
Input / Output Operations at a time can use the resource. If another process requests that resource, the requesting process
3 Running
Communication must be delayed until the resource has been released.
Once the process has been assigned to a processor by the OS scheduler, the process state is set
Resource Allocation Hold and Wait:There must exist a process that is holding at least one resource and is waiting to
to running and the processor executes its instructions.
Error Detection acquire additional resources that are currently being held by other processes.
Accounting 4 Waiting
No Preemption: Resouces cannot be preempted; that is, a resource can only be released
Security and protection Process moves into the waiting state if it needs to wait for a resource, such as waiting for user
voluntarily by the process holding it, after the process has completed its task.
input, or waiting for a file to become available.
3. Explain the need of Operating System. Circular Wait: There must exist a set {p0, p1,.....pn} of waiting processes such that p0 is waiting
OS as a platform for Application programs: Operating system provides a platform, on 5 Terminated or Exit for a resource which is held by p 1, p1 is waiting for a resource which is held by p 2,..., pn-1 is
top of which, other programs, called application programs can run. These application Once the process finishes its execution, or it is terminated by the operating system, it is moved waiting for a resource which is held by p n and pn is waiting for a resource which is held by p 0.
programs help the users to perform a specific task easily. It acts as an interface between the to the terminated state where it waits to be removed from main memory.
computer and the user. It is designed in such a manner that it operates, controls and executes
various applications on the computer.

6. Explain deadlocks and solution to remove deadlocks. 9. Explain Race condition / Racing problem.
Eliminate Mutual Exclusion
It is not possible to dis-satisfy the mutual exclusion because some resources, such as the tap It is situation where two or more process are reading / writing some shared data and
drive and printer, are inherently non-shareable. final result depends on relative order of their execution ,is called race condition.
 A=1000,At the end of two process A should be 1100.but if P0 and P1 permitted to
Eliminate Hold and wait execute in any arbitrary fashion then output will be not same.
Allocate all required resources to the process before the start of its execution, this way hold and
wait condition is eliminated but it will lead to low device utilization. for example, if a process
requires printer at a later time and we have allocated printer before the start of its execution
printer will remain blocked till it has completed its execution.
The process will make a new request for resources after releasing the current set of resources.
This solution may lead to starvation.

Eliminate No Preemption
Preempt resources from the process when resources required by other high priority processes.

Eliminate Circular Wait


Each resource will be assigned with a numerical number. A process can request the resources
only in increasing order of numbering.
For Example, if P1 process is allocated R5 resources, now next time if P1 ask for R4, R3 lesser
than R5 such request will not be granted, only request for resources more than R5 will be
granted.
8.Explain IPC.
 In multiprogramming OS more than one process may be running simultaneously. Such
7. Explain FCFS (first come first served) algorithem.
processes can communicate with each other, such type of communication is called Inter
 Jobs are executed on first come, first serve basis.
process communication.
 Easy to understand and implement.
 IPC is useful in a distributed environment where the communication process may reside
 Poor in performance as average wait time is high.
on different machine connected with a network.
 Here two process are reading and writing common variable ‘A’ .The final value depends
 Example of IPC:
on relative execution order of P0 and P1,such situation is called race condition.
 A shell pipeline in UNIX : ls | wc –l
 This implies that concurrent process are racing with each other to access a shared
 Printing a paper in network
resource in arbitrary order and procedure wrong final results ,so race condition must
 Chat or mail server
be avoided.

10. Difference between Logical Address & Physical Address 13. Explain memory relocation.

 A process can loaded in any partition in main memory.


No. Logical Address Physical Address
 Address in Logical Address Space and Physical Address Space is not a same here.
1 The process address space can be The entire physical memory can be  Logical Address Space specifies the location of instructions and data within process
considered as a sequential list of bytes. considered as a sequential list of address space.
Each byte has an address that is used to bytes. Each byte has an address that  Physical Address Space specifies actual location in main memory.
locate it, these addresses are called is used to locate it; these addresses  Logical Address is required to actually fetch instruction. So whenever there is a
logical address. are called physical address. reference to any Logical Address it should be converted to physical address this problem
is called memory relocation.
2 It is generated by CPU, means CPU It is generated by Main Memory.
 EX: suppose process is loaded at location 1000 in main memory & there is need to fetch
determines location of each instruction
instruction located at location 5 in Logical Address Space.
& data in process address space.
 So Logical Address (5) should be converted to actual Physical Address (1000 + 5) =
3 Logical Address Space is a set of all Physical Address Space is a set of 1005.
logical address that can be referenced by physical address occupied by a
a process. process in main memory during its 14. Explain Fragmentation.
execution.
12.Explain swapping.  Memory is allocated when process enters in the system and released when it terminates.
 We can’t utilize (100%) full memory due to some problems (fragmentation).
11. Explain Multiprogramming with fixed (static) partition.  Swapping is a technique in which processes are moved between main memory and disk.  Fragmentation refers to unused memory that cannot be allocated to any process. Means
 This method allows multiple processes to execute simultaneously. there is free memory available but it can’t be used.
 Swapping uses some of the portion of secondary storage (disk) as a backing store; this
 Memory is shared among Operating System and various simultaneously running  Two types of fragmentations:
area is called swap area.
processes.  External Fragmentation
 Operation of moving process from main memory to swap area is swap-out.
 Multiprogramming increases the CPU utilization, CPU can be kept busy almost all time  Internal Fragmentation
 Operation of moving processes from swap area to main memory is swap-in.
by keeping more than one processes simultaneously in memory.  When a process is brought back to memory, it may be loaded at some different location
 Memory is divided into fixed partition size can be equal or unequal for different rather than its original one. So It needs memory relocation, There is problem of external
partition. Generally unequal partitions are used for better utilization of memory. fragmentation.
 Each partition is accommodating exactly one process.
 Whenever program needs to be loaded in memory, a free partition big enough to hold
program is found and allocated.
 If there is no free partition available of required size, which process needs to wait such
process will be put in a queue.
 There are two possible ways to implement method with a queue.
1. Using multiple input queues. – Fig (a)
2. Using single input queue. – Fig (b)
 These devices provides various services.

15. Explain file operation.


 Create :-A new file can be created by a system call embedded in a program or by an OS
command issued by user.
 Delete:- when a file is no longer needed it has to be deleted to free up disk space.
 Open :- before using a file it must be opened.
 Close:- when use of file is finished it should be closed to free up main memory space
 Read:- Data are read the file. The system maintain a read pointer to specify the location
in a file from where to read the data content.
 Write:- Data are written to the file. The system maintain a write pointer to specify the
location in a file from where to write the data content
 Append:- It is restricted form of a write pointer. here data are only added to the end of
the file.
 Seek:- For random access files, a location is needed to specify from where to start
read/write operations.
 Get Attributes :- It is used to retrieve file attributes.
 Set Attributes :- It is used to write file attributes.
 Rename :- It is used to change the name of an existing file.

16.Explain Linux Architecture.


 It is also known as the layered structure of Linux.
 Linux is a UNIX-like OS, its architecture resembles to that of UNIX.
 1. Hardware:
 Bottom layer is hard ware.
 It consist of physical devices such as CPU ,memory ,disks ,monitors ,printers etc.

You might also like