Cst206 Scheme 2
Cst206 Scheme 2
Cst206 Scheme 2
02000CST206062207
Total Pages: 15
Reg No.:_______________ Name:__________________________
PART A
Answer all questions, each carries 3 marks. Marks
o Loading of BIOS
o POST i.e. power-on self-test
o System Configuration
o Loading utilities
o User Authentication.
3 BUFFERING - During direct or indirect communication, messages exchanged (3)
between communicating processes reside in a temporary queue which are
implemented in the following three ways:
Zero capacity: The queue has maximum length 0; thus, the link cannot have
any message waiting in it. In this case, the sender must block until the recipient
Page 1of 17
FINAL SCHEME
02000CST206062207
5 A solution to the critical-section problem must satisfy the following three (3)
requirements:
Mutual Exclusion: If process Pi is executing in its critical section, then no other
Page 2of 17
FINAL SCHEME
02000CST206062207
Page 3of 17
FINAL SCHEME
02000CST206062207
3. After that, the free-frame list finds the free frame in the system.
4. Now, the disk operation would be scheduled to get the required page from
the disk.
5. When the I/O operation is completed, the process's page table will be updated
with a new frame number, and the invalid bit will be changed. Now, it is a
valid page reference.
Page 4of 17
FINAL SCHEME
02000CST206062207
10 (3)
PART B
Answer any one question from each module
Module 1
11 (a) Operating System- definition – 1 mark (7)
3. Multiprocessing systems
5. Distributed systems
6. Desktop systems
7. Handheld systems
Page 5of 17
FINAL SCHEME
02000CST206062207
8. Clustered systems
Page 6of 17
FINAL SCHEME
02000CST206062207
controls the system, the other processor either look to the master for instruction
or have predefined task assigned. Example SunOS v4.
Advantages of multiprocessor systems with explanation – 2 Marks
1.Increased throughput
2.economy of scale
3.reliability more
Disadvantages with explanation - 1 Mark
1.Common computer bus, clock, memory and peripheral devices.
2.cost is more
Multiprocessor systems not mentioned in the syllabus. full credits may be
given if attempted
Module 2
13 (a) Define process. - 3 marks (7)
Process can be defined as:
• A program in execution.
• A unit of activity characterized by the execution of a sequence of instructions,
a current state, and an associated set of system resources.
A process is an entity that consists of a number of elements.
A process is more than the program code, which is sometimes known as the
text section.
It also includes the current activity, as represented by the value of the program
counter and the contents of the processor's registers.
A process generally also includes the process stack, which contains temporary
data (such as function parameters, return addresses, and local variables), and a
data section, which contains global variables. A process may also include a
heap, which is memory that is dynamically allocated during process run time.
Process state diagram with explanation – 4 Marks
Page 7of 17
FINAL SCHEME
02000CST206062207
A process
creates a shared memory segment using shmget(). The original owner of a
shared memory segment can assign ownership to another user with shmctl(). It
can also revoke this assignment. Other processes with proper permission can
perform various control functions on the shared memory segment
using shmctl().
Once created, a shared segment can be attached to a process address space
using shmat(). It can be detached using shmdt(). The attaching process must
have the appropriate permissions for shmat(). Once attached, the process can
read or write to the segment, as the permission requested in the attach operation
allows. A shared segment can be attached multiple times by the same process.
Page 8of 17
FINAL SCHEME
02000CST206062207
P0 P2 P1 P3 P4 P0
Page 9of 17
FINAL SCHEME
02000CST206062207
Page 10of 17
FINAL SCHEME
02000CST206062207
wait(S) {
while (S <= 0 ) ; // busy wait
S--; }
The definition of signal() is as follows:
signal(S) {
S++; }
Usage of semaphore- 2 Marks Counting semaphore; Binary semaphore
Implementation semaphore – 3 Marks
(b) 2 2 3 0 (7)
3 2 0 0
0 3 2 3
2 5 0 7
2 0 0 1 Need Matrix - 2 Marks
Inintial Work 3,0,0,1
Safe Sequence <P5,P1,P2,P3,P4> 5 Marks
Note : more than one safe sequence may be there marks can be given to
correct answer
Module 4
17 (a) What are the physical addresses for the following logical addresses: (5)
a. 0, 430 219 + 430 = 649
b. 1, 10 2300 + 10 = 2310
c. 2, 500 Illegal address since size of segment 2 is 100 and the offset in logical
address is 500.
d. 3, 400 1327 + 400 = 1727
e. 4, 112 Illegal address since size of segment 4 is 96 and the offset in logical
address is 112.
(b) i) LRU replacement ii) FIFO replacement iii) Optimal replacement (9)
Representation of demand paging with three frames – 3 X 2 marks
No of page faults – 3 x 1 mark
OR
18 (a) Define Demand Paging. - 2 MARKS (6)
Page 11of 17
FINAL SCHEME
02000CST206062207
Page 12of 17
FINAL SCHEME
02000CST206062207
P1 P4 10 P2 280K
K
Page 13of 17
FINAL SCHEME
02000CST206062207
• It is difficult to estimate the file size. The size of a file may grow at run
time and may be larger than the specified number of allocated blocks. In
this case, the OS must move the blocks in order to provide mode space.
In some systems, this is simply an error.
2. Linked Allocation:
With the linked allocation approach, disk blocks of a file are chained together
with a linked-list. The directory entry of a file contains a pointer to the first
block and a pointer to the last block.
Page 14of 17
FINAL SCHEME
02000CST206062207
To create a file, we create a new directory entry and the pointers are initialized
to nil. When a write occurs, a new disk block is allocated and chained to the
end of the list. This method solves the problems associated with contiguous
allocation. Here the blocks of a single file can be scattered anywhere on the
disk. The reason because the entire file is implemented as a Linked List. The
directory maintained by the OS contains a pointer to the first and the last blocks
of a file.
E
ach block of a file contains a pointer to the next block after it in the list. For
creating a new file, we need to just create a new entry in the directory and not
to search for sufficient space as in contiguous. The free space management
system allocates space to a block for writing and is then appended to the end of
the List. To Read a file, we need to follow the pointers from each block.
3. Indexed allocation:
Indexed Allocation With the contiguous allocation method, a user must indicate
the file size before creating the file. Then, the operating system searches the
disk to find contiguous disk blocks for the file. The directory entry is easy. It
contains the initial disk address of this file and the number of disk blocks.
Each file has an index block that is an array of disk block addresses. The i-th
Page 15of 17
FINAL SCHEME
02000CST206062207
entry in the index block points to the i-th block of the file. A file’s directory
entry contains a pointer to its index.
Hence, the index block of an indexed allocation plays the same role as the page
table. Index allocation supports both sequential and direct access without
external fragmentation.
In indexed allocation method, all the pointers (pointing to the next block in the
Linked list) are gathered together into one location known as Index Block. In
the earlier method (i.e. Linked Allocation) the pointers along with the blocks
were scattered across the disk and needed to be retrieved in order by visiting
each block for access the file. This problem gets eliminated here. Each file has
an index block of its own, which is an array of disk-block addresses. The kth
entry of the index-block is a pointer to the kth block of the file. When a file is
created initially, all pointers in the index block are set to null value. As new
blocks are written, the pointers are modified accordingly. Indexed allocation
supports direct access and does not suffer from any external fragmentation.
Indexed allocation suffers from the problem of wasted space. E.g. if a file is
made up of two blocks only, then a huge amount of space will be wasted.
OR
20 (a) File owner/creator should be able to control: ✦ what can be done ✦ by whom (6)
Page 16of 17
FINAL SCHEME
02000CST206062207
Page 17of 17