Fill This Form To Receive Instant Help
Homework answers / question archive / DEPARTMENT OF Comp
DEPARTMENT OF Comp.Science ENGINEERING
Course Title: Operating System
Course Code: CS22
Q 01:
Answer:
(a):
Hard real time system:
(b):
Soft real time system:
(c):
Draw the Block diagram of Multiprocessor system.
CPU 1 |
CPU 1 |
I/O Processors |
I/O Unites |
I/O Processors
|
I/O Unites
|
Main Memory |
(d):
Define Swapping with the help of diagram:
Main Memory |
Secondary Memory |
Process P1 |
Process P2 |
Process P1 |
Process P3 |
Process P3 |
Process P1 |
Process P3 |
Process P4 |
Process Pn |
· · |
P1 goes for I/O wait |
Swap Out |
Swap In |
Swap Out |
Swap In |
P1 Comes back after I/O |
(e):
Explain the term Dual-mode operation:
---------------------------------------------------------------------------------------------------------------------------
Q 02: (Each containing 2*3=6)
Answer:
Ans: (a):
Multiprogramming:
Time-Sharing:
Ans (b):
advantages of Time-sharing system:
Ans (c):
block diagram of Multiple Buses:
Figure 13.1 below illustrates three of the four bus types commonly found in a modern PC
Q 03: (Each containing 3*3=9)
Answer:
Ans: (a):
The main difference between the kernel and the shell is that the kernel is the main part of the operating system that controls all the functions of the system while the shell is the interface that allows users to interact with the kernel.
KERNEL |
SHELL |
A computer program which acts as the core of the computer operating system and has the control over everything in the system. |
A computer program which works as the interface to access the services provided by the operating system |
Core of the system that control all the tasks of the system. |
Interface between the kernel and the user |
Does not have types |
Has types such as Bourne shell, C shell, Korn shell, Bourne again shell, etc |
KERNEL:
SHELL:
Ans: (b):
An API is a generic term defining the interface developers have to use when writing code using libraries and a programming language. Kernels have no APIs as they are not libraries. They do have an ABI, which, beyond other things,
API – System Call Implementation n The interface to the services provided by the OS has two parts:
1. Higher language interface – a part of a system library
2. Kernel part:
Ans: (c):
The Unix operating system is a set of programs that act as a link between the computer and the user.
The computer programs that allocate the system resources and coordinate all the details of the computer's internals is called the operating system or the kernel.
Unix Architecture
Here is a basic block diagram of a Unix system
Q 04: (Each containing 5)
Answer:
process which performs all the tasks mentioned in the program.
When a program is loaded into the memory and it becomes a process, it can be divided into four sections ? stack, heap, text and data.
For example, when you want to search something on web then you start a browser. So, this can be process. Another example of process can be starting your music player to listen to some cool music of your choice.
Process Life Cycle
When a process executes, it passes through different states. These stages may differ in different operating systems, and the names of these states are also not standardized.
In general, a process can have one of the following five states at a time.
S.N. |
State & Description |
1 |
Start This is the initial state when a process is first started/created. |
2 |
Ready The process is waiting to be assigned to a processor. Ready processes are waiting to have the processor allocated to them by the operating system so that they can run. Process may come into this state after Start state or while running it by but interrupted by the scheduler to assign CPU to some other process. |
3 |
Running Once the process has been assigned to a processor by the OS scheduler, the process state is set to running and the processor executes its instructions. |
4 |
Waiting Process moves into the waiting state if it needs to wait for a resource, such as waiting for user input, or waiting for a file to become available. |
5 |
Terminated or Exit Once the process finishes its execution, or it is terminated by the operating system, it is moved to the terminated state where it waits to be removed from main memory. |
Process Control Block (PCB)
A Process Control Block is a data structure maintained by the Operating System for every process. The PCB is identified by an integer process ID (PID). A PCB keeps all the information needed to keep track of a process as listed below in the table –
S.N. |
Information & Description |
1 |
Process State The current state of the process i.e., whether it is ready, running, waiting, or whatever. |
2 |
Process privileges This is required to allow/disallow access to system resources. |
3 |
Process ID Unique identification for each of the process in the operating system. |
4 |
Pointer A pointer to parent process. |
5 |
Program Counter Program Counter is a pointer to the address of the next instruction to be executed for this process. |
6 |
CPU registers Various CPU registers where process need to be stored for execution for running state. |
7 |
CPU Scheduling Information Process priority and other scheduling information which is required to schedule the process. |
8 |
Memory management information This includes the information of page table, memory limits, Segment table depending on memory used by the operating system. |
9 |
Accounting information This includes the amount of CPU used for process execution, time limits, execution ID etc. |
10 |
IO status information This includes a list of I/O devices allocated to the process. |
The architecture of a PCB is completely dependent on Operating System and may contain different information in different operating systems. Here is a simplified diagram of a PCB –
Process ID |
State |
Pointer |
Priority |
Program Counter |
CPU Registers |
I/O information’s |
Accounting Information |
etc… |
The PCB is maintained for a process throughout its lifetime, and is deleted once the process terminates.
PID – Process Identifier
Process identifier, also known as process ID or PID, is a unique number to identify each process running in an operating system such as Linux, Windows, and Unix. PIDs are reused over time and can only identify a process during the lifetime of the process, so it does not identify processes that are no longer running. This number can be used as a framework for various function calls, meaning processes can be manipulated and adjusted.