Important Instructions To Examiners:: Q. No - Sub Q. N. Answer Marking Scheme 1. A Ans
Important Instructions To Examiners:: Q. No - Sub Q. N. Answer Marking Scheme 1. A Ans
Important Instructions To Examiners:: Q. No - Sub Q. N. Answer Marking Scheme 1. A Ans
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
Applications:
1. Flight Control System
2. Simulations
3. Industrial control
4. Military applications
4) While assessing figures, examiner may give credit for principal components indicated in the
figure. The figures drawn by candidate and model answer may vary. The examiner may
give credit for any equivalent figure drawn.
5) Credits may be given step wise for numerical problems. In some cases, the assumed
constant values may vary and there may be some difference in the candidate’s answers and
model answer.
6) In case of some questions credit may be given by judgement on part of examiner of relevant
answer based on candidate’s understanding.
1 | 37
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
7) For programming language papers, credit may be given to any other program based on
equivalent concept.
2 | 37
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
4.File system manipulation: Programs may need to read and write data
from and to the files and directories. Operating system manages the
secondary storage. Operating system makes it easier for user programs
to accomplish their task such as opening a file, saving a file and deleting
a file from the storage disk.
3 | 37
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
concurrently, one process should not interfere with the other processes
or operating system itself. Protection provides controlled access to
system resources. Security is provided by user authentication such as
password for accessing information.
4 | 37
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
Ans 1. CPU utilization: In multiprogramming the main objective is to keep Any four
CPU as busy as possible. CPU utilization can range from 0 to 100 scheduling
percent. criteria: 1/2
mark each
2.Throughput: It is the number of processes that are completed per unit
time. It is a measure of work done in the system. When CPU is busy in
executing processes, then work is being done in the system. Throughput
depends on the execution time required for any process. For long
processes, throughput can be one process per unit time whereas for short
processes it may be 10 processes per unit time.
4.Waiting time: It is the sum of time periods spent in the ready queue
by a process. When a process is selected from job pool, it is loaded into
the main memory (ready queue). A process waits in ready queue till
CPU is allocated to it. Once the CPU is allocated to the process, it starts
its execution and if required request for resources. When the resources
are not available that process goes into waiting state and when I/O
request completes, it goes back to ready queue. In ready queue again it
waits for CPU allocation.
a process. In the system, a process can Produce some output fairly early
and can continue computing new results while previous results are being
output to the user.
e Define virtual memory 2M
Ans Virtual memory is a memory management capability of an operating 2 marks for
system (OS) that uses hardware and software to allow a computer to any
compensate for physical memory shortages by temporarily transferring relevant
data from random access memory (RAM) to disk storage. definition
OR
Virtual memory is the separation of user logical memory from physical
memory. This separation allows an extremely large virtual memory to
be provided for programmers when only a smaller physical memory is
available. Virtual memory makes the task of programming much easier,
5 | 37
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
6 | 37
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
Multiprogramming:
• In multiprogramming, more than one program lies in the
memory.
• The scheduler selects the jobs to be placed in ready queue from a
number of programs.
• The ready queue is placed in memory and the existence of more
than one program in main memory is
known as multiprogramming.
• Since there is only one processor, there multiple programs cannot
be executed at a time.
• Instead the operating system executes part of one program, then
the part of another and so on.
• Example of multiprogramming: user can open word, excel,
access and other applications in a system.
7 | 37
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
8 | 37
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
- 2 marks
9 | 37
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
The processes are also responsible for ensuring that they are not
2. Message
writing to the same location simultaneously.
PassingAfter establishing shared memory segment, all accesses to the
shared memory segment are treated and without assistance of
In this model, communication takes place by exchanging messages
between cooperating processes.
It allows processes to communicate and synchronize their action
without sharing the same address space.
connected by a
It is particularly useful in a distributed environment when
network.
communication process may reside on a different computer
Communica
through the
tion requires sending and receiving messages
kernel.
10 |
37
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
have a communication
link between them. Between each pair of processes exactly one
communication link.
d Describe I/O Burst and CPU Burst cycle with neat diagram. 4M
Ans CPU burst cycle: It is a time period when process is busy with CPU. Explanatio
I/O burst cycle: It is a time period when process is busy in working n: 2 marks,
with I/O resources. Diagram:2
marks
• A process execution consists of a cycle of CPU execution and I/O
wait.
• A process starts its execution when CPU is assigned to it, so
process execution begins with a CPU burst cycle.
• This is followed by an I/O burst cycle when a process is busy
doing I/O operations.
• A process switch frequently from CPU burst cycle to I/O burst
cycle and vice versa.
• The complete execution of a process starts with CPU burst cycle,
followed by I/O burst cycle, then followed by another CPU burst
cycle, then followed by another I/O burst cycle and so on.
• The final CPU burst cycle ends with a system request to
terminate execution.
11 |
37
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
12 |
37
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
Ans ps command: It is used to display the characteristics of a process. This four options-
command when execute without options, it lists the processes associated 1M each
with a user at a particular terminal.
Syntax: $ ps [options]
Example: $ ps output:
Each line in the output shows PID, the terminal with which the process is
associated, the cumulative processor time that has been consumed since
the process has been started and the process name.
Options:
-f : It is used to display full listing of attributes of a process. It includes
UID (user ID),PPID(Parent ID),C(amount of CPU time consumed by the
process) and STIME(chronological time that has elapsed since the
process started). Example: $ ps -f
13 |
37
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
Example: Consider a system with three disk drives and three processes. When
each process request one disk drive, system allocates one disk drive to each
process. Now there is no more drive available in the system. If all three
processes request for one more disk drive, then all three processes will go into
the waiting state and system will go in deadlock state. Because any one
process from the three can execute only when one of them will release the disk
drive allocated to it.
Necessary Conditions:
1. Mutual exclusion: At least one resource must be held in
a nonsharable mode; that is, only one process at a time can use
14 | 37
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
the resource.
2. Hold and Wait: A process must be holding at least one
resource and waiting to acquire additional resources that are
currently being held by
other processes.
15 | 37
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
OR
16 | 37
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
dir
ection) from the current position to start with beginning of the file or it
can be read or write in forward direction.
17 | 37
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
18 | 37
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
Ans System call provides an interface between a running program and purpose of
operating system. It allows user to access services provided by system call-
operating system. This system calls are procedures written using C, C+ 2M, Two
+ and assembly language instructions. Each operating system has its system calls-
own name for each system call. Each system call is associated with a 1M each
number that identifies itself.
System calls:
Process Control: Program in execution is a process. A process to be
executed must be loaded in main memory. while executing it may need
to wait, terminate or create & terminate child processes.
• end, abort
• load, execute
• create process, terminate process
19 | 37
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
20 | 37
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
store it into a blocked and swapped out process queue. When space is
available in the main memory, the operating system looks at the list of
swapped out but ready processes. The medium term scheduler selects
one process from that list and loads it into the ready queue. The job of
medium term scheduler is to select a process from swapped out
process queue and to load it into the main memory. This scheduler
works in close communication with long term scheduler for loading
process into the main memory.
Example:
Process Burst Time
P1 24
P2 3
P3 3
Time quantum: 4 ms
The resulting RR schedule is as follows:
P1 P2 P3 P1 P1 P1 P1 P1
0 4 7 10 14 18 22 26 30
22 | 37
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
23 | 37
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
A) User management:
• User management includes everything from creating a user to
deleting a user on your system. User management can be done
in three ways on a Linux system.
• Command line tools include commands like useradd, userdel,
usermod, passwd, etc. These are mostly used by the server
administrators.
Useradd: With useradd commands you can add a user.
24 | 37
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
B) Device Management:
Device management is the process of managing the implementation,
operation and maintenance of a physical and/or virtual device.
All Linux device files are located in the /dev directory, which is an
integral part of the root (/) filesystem because these device files must
be available to the operating system during the boot process.
Example: ls –l /dev
Above example gives the list of device file from kernel.
Udev supplies a dynamic device directory containing only the nodes
for devices which are connected to the system. It creates or removes
the device node files in the /dev directory.
C) Performance Monitor:
It is very tough job for every system or network administrator to
monitor and debug Linux System Performance problems every day.
The commands discussed below are some of the most fundamental
commands when it comes to system analysis and debugging Linux
server issues such as:
1) vmstat: Virtual memory statistics
The vmstat command reports information about processes, memory,
paging, block IO, traps, and cpu activity.
$ vmstat 3
25 | 37
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
Many-to-One Model
• The many-to-one model maps many user-level threads to one
kernel thread.
• Thread management is done by the thread library in user space,
so it is efficient; but the entire process will block if a thread
makes a blocking system call.
• Also, because only one thread can access the kernel at a time,
multiple threads are unable to nm in parallel on
multiprocessors.
• Example: Green threads- a thread library available for Solaris
26 | 37
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
27 | 37
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
Advantages:
• More concurrency because of multiple threads can run in
parallel on multiple CPUs.
• Less complication in the processing.
Disadvantages:
• Thread creation involves light-weight process creation.
• Kernel thread is an overhead.
• Limiting the number of total threads.
One-to-One Model
• The one-to-one model maps each user thread to a kernel thread.
• It provides more concurrency than the many-to-one model by
allowing another thread to run when a thread makes a blocking
system call; it also allows multiple threads to run in parallel on
multiprocessors.
• The only drawback to this model is that creating a user thread
requires creating the corresponding kernel thread.
• Because the overhead of creating kernel threads can burden the
performance of an application, most implementations of this
model restrict the number of threads supported by the system.
• Linux, along with the family of Windows operating systems,
implement the one-to-one model.
Advantages:
• Mainly used in language system, portable libraries.
• One kernel thread controls multiple user thread.
Disadvantages:
• Parallelism is not supported by this model.
• One block can blocks all user threads.
Many-to-Many Model
• The many-to-many model multiplexes many user-level threads
to a smaller or equal number of kernel threads.
• The number of kernel threads may be specific to either a
particular application or a particular machine (an application
28 | 37
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
Advantages:
• Many threads can be created as per user’s requirement.
Multiple kernel or equal to user threads can be created.
Disadvantages:
• True concurrency cannot be achieved.
• Multiple threads of kernel is an overhead for operating system
c Explain LRU page replacement algorithm for following reference 6M
string. 7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1 Calculate
the page fault.
29 | 37
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
30 | 37
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
Counters:
• In the simplest case, we associate with each page-table entry a
time-of-use field and add to the CPU a logical clock or counter.
• The clock is incremented for every memory reference.
• Whenever a reference to a page is made, the contents of the
clock register are copied to the time-of-use field in the pagetable
entry for that page.
• In this way, we always have the "time" of the last reference to
each page. We replace the page with the smallest time value.
Stack:
• Another approach to implementing LRU replacement is to keep
a stack of page numbers.
• Whenever a page is referenced, it is removed from the stack and
put on the top.
• In this way, the most recently used page is always at the top of
the stack and the least recently used page is always at the
bottom.
Reference String: 7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1
(Frame size have not mentioned in question so assume frame size as 3
or 4)
LRU: Assume frame size=3
70120304230321201701
77 7 2 2 44 4 0 1 1* 1 *
00 0 * 0 * 0 0 3 3 * 3 0 0*
11 3 32 2 2 *2 * 2 7
Page Fault=12
Assume frame size=4
70120304230321201701
77 7 7 3 3 * * 3 7
00 0 * 0 * 0 * 0 * 0*
11 1 4 1 *1 *
2 2 2* *2 * 2
Page fault=08
31 | 37
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
chart, 2m
calculation
OR
Preemptive SJF
Gantt Chart:
P1 P2 P1 P4 P5 P3
0 1 5 11 17 25 35
32 | 37
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
P2 1 4 1-1=0
P3 2 10 25-2=23
P4 3 6 11-3=8
P5 4 8 17-4=13
ii) FCFS
Gantt chart:
P1 P2 P3 P4 P5
0 7 11 21 27 35
33 | 37
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
Ans A file system is responsible to allocate the free blocks to the file Listing=1M
therefore it has to keep track of all the free blocks present in the disk. Explanation
There are mainly four approaches by using which, the free blocks in =3M
the disk are managed. And
• Bit Vector Diagram=2
• Linked List M
• Grouping
• Counting Bit Vector:
• The 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.
• For example, consider a disk where blocks
• 2, 3, 4, 5, 8, 9, 10, 11, 12, 13 are free and the rest of the blocks
are allocated.
• The free-space bit map would be : 0011110011111100
15
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
0
0 0 1 1 1 1 0 0 1 1 1 1 1 1 0
0=Free block
1= Allocated block
The main advantage of this approach is its relative simplicity and its
efficiency in finding the first free block or n consecutive free blocks on
the disk.
Linked List
• In this approach, the free disk blocks are linked together i.e. a
free block contains a pointer to the next free block.
• The block number of the very first disk block is stored at a
separate location on disk and is also cached in memory.
• In this approach, link all the disk blocks together, keeping a
pointer to the first free block.
• This block contains a pointer to the next free disk block, and so
on.
34 | 37
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
35 | 37
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
access.
• For direct access to block ‘i’ of a file, which starts at block ‘b’,
we can immediately access block b+i. The difficulty with
contiguous allocation is finding space for a new file.
• For direct access to block ‘i’ of a file, which starts at block ‘b’,
we can immediately access block b+i.
• The difficulty with contiguous allocation is finding space for a
new file.
• If file to be created are ‘n’ blocks long, we must search free
space list for ‘n’ free contiguous blocks.
36 | 37
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
37 | 37