0% found this document useful (0 votes)
8 views49 pages

Os Merged1

The document outlines important questions and topics for a course on Operating Systems, covering various chapters such as Introduction, Process and Threads Management, Concurrency, Inter Process Communication, Deadlock, Memory Management, I/O Management & Disk Scheduling, Security & Protection, UNIX/Linux Operating System, and Virtualization Concepts. Each chapter contains specific questions aimed at assessing understanding of key concepts and practical applications related to operating systems. Additionally, it includes a laboratory manual with experiments and shell scripting tasks to reinforce learning.

Uploaded by

paramjani474
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)
8 views49 pages

Os Merged1

The document outlines important questions and topics for a course on Operating Systems, covering various chapters such as Introduction, Process and Threads Management, Concurrency, Inter Process Communication, Deadlock, Memory Management, I/O Management & Disk Scheduling, Security & Protection, UNIX/Linux Operating System, and Virtualization Concepts. Each chapter contains specific questions aimed at assessing understanding of key concepts and practical applications related to operating systems. Additionally, it includes a laboratory manual with experiments and shell scripting tasks to reinforce learning.

Uploaded by

paramjani474
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/ 49

DEPARTMENT:COMPUTER SCIENCE AND ENGINEERING

SEMESTER : 4
SUBJECT NAME: OPERATING SYSTEM
SUBJECT CODE : 3140702
FACULTY NAME :PROF. FORAM PATEL

OPERATING SYSTEM

IMPORTANT QUESTIONS:

CHAPTER 1: INTRODUCTION

1. What is Operating System? Give the view of OS as Resource Manager.


2. Explain different types of OS.
3. Give the view of OS as User Interface.
4. What is system call? Explain the types of system call.
5. Write different operating system services.
6. What is spooling?
7. Explain the structure of operating system.
8. What is kernel? Explain types of kernel.

CHAPTER 2: PROCESS AND THREADS MANAGEMENT

1. What is Process? Give the difference between a process and a program.


2. Explain the Process State transition diagram.
3. Explain Process Control Block (PCB)?
4. Difference between process and thread.
5. What is scheduler? Explain queuing diagram representation of process scheduler
with figure.
6. What is thread? Explain thread structure.
7. Explain process creation and process termination.
8. Explain types of thread.
9. Five batch jobs A to E arrive at same time. They have estimated running times
10,2,6,8,4 minutes. Their priorities are 3,2,5,4,1 respectively with 5 being
highest priority. For each of the following algorithm determine mean process
turnaround time. Ignore process swapping overhead. Round Robin (q=3),
Priority Scheduling, FCFS, SJF.
10.Draw Four Gantt charts illustrating the execution of these processes using
FCFS, SJF, priority (a small priority number implies a higher
priority), and Round Robin (quantum=1) scheduling.
11.Five batch jobs A to E arrive at same time. They have estimated running
times 10,6,2,4 and 8 minutes. Their priorities are 3,5,2,1 and 4
respectively with 5 being highest priority. For each of the following

1 Amiraj College of Engineering and Technology


DEPARTMENT:COMPUTER SCIENCE AND ENGINEERING
SEMESTER : 4
SUBJECT NAME: OPERATING SYSTEM
SUBJECT CODE : 3140702
FACULTY NAME :PROF. FORAM PATEL

algorithm determine mean process turnaround time. Ignore process


swapping overhead. Round Robin, Priority Scheduling, FCFS, SJF.
12. Assume arrival order is: P1, P2, P3, P4, P5 at time 0,1,2,3,4 respectively
and a smaller priority number implies a higher priority. Draw the Gantt
charts for preemptive and non-preemptive priority scheduling.
Calculate Average Turnaround Time and Average Waiting Time.

CHAPTER 3: CONCURRENCY

1. Define: Mutual Exclusion,


2. What is Semaphore? Give the implementation of Bounded Buffer Producer
Consumer Problem using Semaphore.
3. What is advantage of using Monitor? Give the implementation of Bounded
Buffer Producer Consumer Problem using “Monitor”.
4. Explain: Race conditions, Semaphore and Monitor.

CHAPTER 4: INTER PROCESS COMMUNICATION

1. Explain IPC Problem –Dining Philosopher Problem.


2. Explain IPC Problem – Readers & Writers Problem.
3. What is critical section? What is Mutual exclusion? Explain Peterson‟s solution
for mutual exclusion problem.
4. Define: Critical Section, Race Condition.
5. What is monitor? Give the implementation of Bounded Buffer Producer-
Consumer Problem using monitor.
6. What is Semaphore? Give the implementation of Readers-Writers Problem using
Semaphore.
7. Write short note: Mutual Exclusion
8. Discuss the Peterson‟s solution for the race condition with algorithm

CHAPTER 5: DEADLOCK

1. What do you mean by Deadlock Avoidance? Explain the use of Banker’s


Algorithm for Deadlock Avoidance with illustration.
2. What is Deadlock? List the conditions that lead to deadlock. How Deadlock can
be prevented?
3. What is Deadlock? Explain Deadlock prevention & Avoidance.
4. How Resource Trajectories can be helpful in avoiding the deadlock?
5. What is Deadlock? List the conditions that lead to deadlock. How Deadlock can

2 Amiraj College of Engineering and Technology


DEPARTMENT:COMPUTER SCIENCE AND ENGINEERING
SEMESTER : 4
SUBJECT NAME: OPERATING SYSTEM
SUBJECT CODE : 3140702
FACULTY NAME :PROF. FORAM PATEL

be prevented?

CHAPTER 6: MEMORY MANAGEMENT

1. What is Virtual Memory? Explain.


2. Compare Multiprogramming with Fixed Partition and multiprogramming with
Variable Partitions with diagram.
3. What is paging? What is Page Table? Explain the conversion of Virtual Address
to Physical Address in Paging with example.
4. Explain the concept of Segmentation for Memory Management. Explain why
combined Paged Segmentation is used with illustration.
5. For the Page Reference String:
7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 1, 2, 0. 1. 7, 0, 1
Calculate the Page Faults applying (i)Optimal(ii)LRU and(iii)FIFO Page
Replacement Algorithms for a Memory with three frames.
6. Explain the various page replacement strategies.
7. Given memory partition of 100K, 500K, 200K, 300K, and 600K in order, how
would each of the First-fit, Best-fit and Worst-fit algorithms place the processes
of 212K, 417K, 112K and 426K in order? Which algorithm makes the most
efficient use of memory?Show the diagram of memory status in each case.
8. What is segmentation? Explain it with example.
9. Consider the following page reference string:
1, 2, 3, 4, 2, 1, 5, 6, 2, 1, 2, 3, 7, 6, 3, 2, 1, 2, 3, 6.
How many page faults would occur for the following replacement algorithms,
assuming four frames? Remember all frames are initially empty, so your first
unique pages will all cost one fault each.LRU replacement, FIFO replacement
10. Explain the various page replacement strategies.
11. Given memory partition of 100K, 500K, 200K, 300K, and 600K in order, How
would each of the First-fit, Best-fit and Worst-fit algorithms place the processes
of 212K, 417K, 112K and 426K in order? Which algorithm makes the most
efficient use of memory? Show the diagram of memory status in each cases.
12.Explain swapping in memory management.
13.What is Semaphore? How can we achieve the synchronization using semaphore
for producer – consumer problem?
14.Explain the following allocation algorithms: 1) First-fit 2) Best-fit 3) Worst-fit.

3 Amiraj College of Engineering and Technology


DEPARTMENT:COMPUTER SCIENCE AND ENGINEERING
SEMESTER : 4
SUBJECT NAME: OPERATING SYSTEM
SUBJECT CODE : 3140702
FACULTY NAME :PROF. FORAM PATEL

CHAPTER 7: I/O MANAGEMENT & DISK SCHEDULING

1. Explain Goals of I/O Software.


2. Explain I/O buffering.
3. Explain various Disk Scheduling Algorithms with illustration.
4. Direct Memory Access (DMA).
5. Explain RAID level system.
6. What are the use of device driver & controller in OS? Explain.
7. Suppose that a disk drive has 5000 cylinders, numbered 0 to 4999. The drive is
currently serving a request at cylinder 143, and the previous request was at
cylinder 125. The queue of pending requests, in FIFO order, is - 86, 1470, 913,
1774, 948, 1509, 1022, 1750, 130. Starting from the current head position, what
is the total distance (in cylinders) that the disk arm moves to satisfy all the
pending requests, for each of the following disk scheduling – FCFS , SCAN (
elevator).
8. Disk requests come in to the disk for cylinders 10, 22, 20, 2, 40, 6 and 38. A seek
takes 6 msec per cylinder move. How much seek time is for Closest cylinder
next algorithm? Initially arm is at cylinder 20.Starting track at 100.The queue of
pending request is, 55,58,39,18,90,160,150,38,184 – FCFS, SCAN ( elevator),
SSTF,C SCAN
9. Suppose that a disk drive has 1000 cylinders, numbered 0 to 999. Assume last
request received was at track 345 and the head is moving towards track 0. The
queue of pending requests, in FIFO order, is 123,874,692,475,105,367.
Perform following scheduling algorithm.
FIFO , SSTF,SCAN,LOOK,C-SCAN,C-LOOK
10.Disk request come in to the driver for cylinder 10,22,20,2,40,6 and 38.A seek
takes 6 msec per cylinder moved . How much seek time needed for FCFS
,Closet cylinder next diagram. Initially arm is at cylinder 20.Starting track at
100. The queue of pending request is,
27,129,110,186,147,41,10,63,120 – SSTF , C-SCAN,C-LOOK.
11.Disk head is start at 53.. The queue of pending request is,
98,183, 37,122,14,124,65,67. - FCFS , SSTF,SCAN,C-SCAN, LOOK
12.Suppose that a disk drive has 5000 cylinders, numbered 0 through 4999.The
drive is serving a request at cylinder 143. FIFO order is, 86, 1470, 913,
1774,948,1509,1022,1750,130 starting from head position. What is total
distance? FCFS, SSTF, SCAN, LOOK, C SCAN, C-LOOK.

4 Amiraj College of Engineering and Technology


DEPARTMENT:COMPUTER SCIENCE AND ENGINEERING
SEMESTER : 4
SUBJECT NAME: OPERATING SYSTEM
SUBJECT CODE : 3140702
FACULTY NAME :PROF. FORAM PATEL

CHAPTER 8: SECURITY & PROTECTION

1. Explain Protection Mechanism illustrating use of Protection Domain and Access


Control List
2. Explain the Trojan Horse and Trap doors program threats
3. Explain functions of Kernel of Unix OS. Also explain various security measures
in Unix file system. How keyboards and monitors are represents in Unix file
system?
4. Explain the Access metrics mechanism
5. Explain domain protection mechanism in brief.
6. What is Access Control list? Explain in brief.
7. Design Principles of Security Access Control List.
8. Authentication
9. How Access Control List can be useful for managing file access?
10.Which are the ways for the user authentication? Explain each in brief.
11.Write a note on Generic Security Attacks.
12.Explain the goals of Operating System Security.

CHAPTER 9: UNIX/LINUX OPERATING SYSTEM

1. Give the function of “Shell” in Unix Operating System.


2. What is “inode”? Explain File and Directory Management of Unix Operating
System.
3. Write short notes on following:
(i) Contiguous Allocation and Linked List Allocation for File System
Implementation.
4. Unix Commands: cat, sort, grep.
5. (i) Explain „grep‟ command in Unix. (ii) Explain „man‟ command in Unix.
6. Explain directory structure of Unix.
7. (i) Explain „finger‟ command in Unix. (ii) Explain „who‟ command in Unix.
8. Explain System administration commands in Unix.
9. Explain kernel structure in UNIX.
10.Explain operating system structure of windows 2000 in brief.
11.Give the role of “Kernel” and “Shell” in UNIX.
12.Give the functions of following UNIX commands: cat, cp, pwd
13.Use of “inode” in UNIX File System.
14.Explain Files and Directory Management in UNIX Operating System.
15.Write a shell script to find greater number out of 3 numbers.
16.Advantages of LINUX/UNIX operating system over Windows.

5 Amiraj College of Engineering and Technology


DEPARTMENT:COMPUTER SCIENCE AND ENGINEERING
SEMESTER : 4
SUBJECT NAME: OPERATING SYSTEM
SUBJECT CODE : 3140702
FACULTY NAME :PROF. FORAM PATEL

17.Short note on i- Node.


18.What is “inode”? Explain File and Directory Management of Unix Operating
System.

CHAPTER 10: VIRTUALIZATION CONCEPTS

1. Explain virtualization.
2. Explain virtual machine.
3. Explain types of virtualization.

6 Amiraj College of Engineering and Technology


LABORATORY MANUAL

OPERATING SYSTEM
SUBJECT CODE: 3140702
COMPUTER SCIENCE AND ENGINEERING
th
DEPARTMENT B.E. 4 SEMESTER

NAME:

ENROLLMENT NO:

BATCH NO:

YEAR:

Amiraj College of Engineering and Technology,


Nr.Tata Nano Plant, Khoraj, Sanand, Ahmedabad.
1
Amiraj College of Engineering and Technology,
Nr.Tata Nano Plant, Khoraj, Sanand, Ahmedabad.

CERTIFICATE

This is to certify that Mr. / Ms. ______________________________________________


Of class____________________ Enrolment No ___________________________has
Satisfactorily completed the course in ____________________________________as
by the Gujarat Technological University for ____ Year (B.E.) semester___ of
Computer Science and Engineering in the Academic year ______.

Date of Submission:-

Faculty Name and Signature Head of Department


Foram Patel (CSE)
COMPUTER SCIENCE AND ENGINEERING DEPARTMENT
th
B.E. 4 SEMESTER
SUBJECT: OPERATING SYSTEM
SUBJECT CODE: 3140702
List of Experiments
Sr. Page Teacher’s
No.
Date
No. Experiments Sign.
Marks

1 Study of Basic commands of Linux/UNIX.


Write a shell script to generate marksheet of a student. Take 3
2 subjects, calculate and display total marks, percentage and Class
obtained by the student.
3 Write a shell script to find factorial of given number n.
Write a shell script which will generate first n fibonnacci
4
numbers like: 1, 1, 2, 3, 5
Write a menu driven shell script which will print the following
menu and execute the given task.
a. Display calendar of current month
5 b. Display today’s date and time
c. Display usernames those are currently logged in the system
d. Display your name at given x, y position
e. Display your terminal number
6 Write a shell script to check entered string is palindrome or not.
7 Write a shell script to validate the entered date.
Write a shell script to convert each word in a given text into
8
capital.
9 Study of Unix Shell and Environment Variables.
10 Study of Advance commands and filters of Linux/UNIX.

Faculty Member Department coordinator


Foram Patel Foram Patel
Practical -1
Aim: Explain and run basic commands-
(cal,cat,cc,cd,chdir,clear,cls,cmp,copy,cp,date,ed,edit,exit,find,ls,man,mkdir,mv,printf,
ps, pwd, rm,rmdir,sleep,wc).

commands:

1) Cal: Displays a calendar


Syntax: - cal [options] [month] [year]
Description:-
cal displays a simple calendar. If arguments are not specified, the current month is displayed. The
switching options are as follows:
- Display single (current) month output. (This is the default.)
1
- Display prev/current/next month output
3
- Display Sunday as the first day of the week (This is the
s default.)
- Display Monday as the first day of the week
m
-j Display Julian dates (days one-based, numbered from
January 1)
- Display a calendar for the current year
y

2) cat: It is used to create, display and concatenate file contents.


Syntax: - cat [options] [FILE]...
Description:-

- Show all.
A
- Omits line numbers for blank space in the output.
b
- A $ character will be printed at the end of each line prior to a
e new line.
- Displays a $ (dollar sign) at the end of each line.
E
- Line numbers for all the output lines.
n
-s If the output has multiple empty lines it replaces it with one
empty line.
- Displays the tab characters in the output.
T
- Non-printing characters (with the exception of tabs, new-lines
v and form-feeds) are printed visibly.

Two basically three uses of the cat command.


1) Create new files.
2) Display the contents of an existing file.
3) Concatenate the content of multiple files and display.
3) cd: It is used to change the directory.
Syntax: - cd [directory]
Description:-
Used to go back one directory on the majority of all UNIX shells. It is important that the
space be between the cd and directory name.
4) cp: - cp command copy files from one location to another. If the destination is an existing file, then
the file is overwritten; if the destination is an existing directory, the file is copied into the
directory (the directory is not overwritten).
Syntax: - cp [options]... source destination
Description:-
 Here, after cp command contents of both source file and destination file files are the same.
 It will copy the content of source file to destination file.
 If the destination file doesn’t exist, it will be created.
 If it exists then it will be overwritten without any warning.
 If there is only one file to be copied then destination can be the ordinary file or the directory file.
-a archive files
-f force copy by removing the destination file if needed
-i interactive - ask before overwrite
-l link files instead of copy
-L follow symbolic links
-n no file overwrite
-u update - copy when source is newer than dest

5) clear: - It clears the terminal screen.


Syntax: - clear
Description:-
 Clear clears your screen if this is possible, including its scroll back buffer.
 Clear ignores any command-line parameters that may be present.
.
6) mkdir:- This command is used to create a new directory
Syntax: - mkdir [options] directory
Description:-

-m Set permission mode (as in chmod)


-p No error if existing, make parent directories as
needed.
-v Print a message for each created directory
directory The name of the directory that you wish to create

7) cmp:- It compares two files and tells you which line numbers are different.
Syntax : - cmp [options..] file1 file2
Description:-
Let’s create a file named os2. And use cmp command to compare os and os1files.
- Output differing bytes as characters.
c
- Print the byte number (decimal) and the differing byte values
l (octal) for each difference.
- Prints nothing for differing files, return exit status only.
s
- Output differing bytes as characters.
c
8) cp:- cp command copy files from one location to another. If the destination is an existing file,
then the file is overwritten; if the destination is an existing directory, the file is copied into the
directory (the directory is not overwritten).
Syntax: - cp [options]... source destination
Description:-
 Here, after cp command contents of both source file and destination file files are the same.
 It will copy the content of source file to destination file.
 If the destination file doesn’t exist, it will be created.
 If it exists then it will be overwritten without any warning.
 If there is only one file to be copied then destination can be the ordinary file or the directory file.
-a archive files
-f force copy by removing the destination file if needed
-i interactive - ask before overwrite
-l link files instead of copy
-L follow symbolic links
-n no file overwrite
-u update - copy when source is newer than dest

9) bc:- bc command is used for command line calculator. It is similar to basic calculator. By
using which we can do basic mathematical calculations.
Syntax:bc[options]
Description:-
 bc is a language that supports arbitrary precision numbers with interactive execution of
statements.
 bc starts by processing code from all the files listed on the command line in the order listed. After
all files have been processed, bc reads from the standard input. All code is executed as it is read.

-q To avoid bc welcome message


-l To include math library functionalities

10) exit:Exit immediately after writing the last line of the last file in the argument list.
11) find:- Finds one or more files assuming that you know their approximate path.
Syntax :- find [options] path
Description :-
Find is one of the powerful utility of Unix (or Linux) used for searching the files in a directory
hierarchy
path A path name of a starting point in the directory
hierarchy
- Descend at most levels (a non-negative integer) levels
maxdepth of directories below the command line arguments.
-i ignore the case in the current directory and sub-
directories.
-size Find file based on size
12) ls:- Lists the contents of a directory
Syntax :- ls [options]
Description :-
- Shows you all files, even files that are hidden (these files
a begin with a dot.)
- List all files including the hidden files. However, does not
A display the working directory (.) or the parent directory (..).
- If an argument is a directory it only lists its name not its
d contents
-l Shows you huge amounts of information (permissions,
owners, size, and when last modified.)
- Displays a slash ( / ) in front of all directories
p
-r Reverses the order of how the files are displayed
- Includes the contents of subdirectories
R
13) man:- man command which is short for manual, provides in depth information about the
requested command (or) allows users to search for commands related to a particular keyword.
Syntax:- man commandname [options]
Description :-
-a Print a one-line help message and exit.
-k Searches for keywords in all of the manuals available.
14) mkdir:- This command is used to create a new directory
Syntax :- mkdir [options] directory
Description :-

-m Set permission mode (as in chmod)


-p No error if existing, make parent directories as
needed.
-v Print a message for each created directory
directory The name of the directory that you wish to create

15) mv:- It is used to move/rename file from one directory to another.


Syntax :- mv [options] oldname newname
Description :-
 mv command which is short for move.
 mv command is different from cp command as it completely removes the file from the source and
moves to the directory specified, where cp command just copies the content from one file to
another.
 mv has two functions: it renames a file and it moves a group of files to a different directory. Mv
doesn’t create a copy of the file , it merely renames it. No additional space is consumed on disk
during renaming. For example if we rename a file os to os1 and then if we try to read file os we
will get error message as it is renamed to os1 there is no existence of file named os.

16) ps:- It is used to report the process status. ps is the short name for Process Status.
Syntax:- ps [options]

Description :-
- List information about all processes most frequently
a requested: all those except process group leaders and
processes not associated with a terminal
- List information for all processes. Identical to -e, below
A
-f Generate a full listing
-j Print session ID and process group ID
-l Generate a long listing
17) pwd:-Displaying your current directory name (Print working directory).
Syntax:-pwd [options]
Description:-
At the time of logging in user is placed in the specific directory of the file system. You can move
around from one directory to another, but any point of time, you are located in only one directory.
This directory is known as your current directory.
pwd command tells your current directory.
18) rmdir:- It is used to delete/remove a directory and its subdirectories.
Syntax :- rmdir [options..] Directory
Description :-
It removes only empty directory.

- Allow users to remove the directory and its parent directories


p which become empty.
19) rm:- It is used to remove/delete the file from the directory.
Syntax :- rm [options..] [file|directory]
Description :-
 Files can be deleted with rm. It can delete more than one file with a single invocation. For
deleting a single file we have to use rm command with filename to be deleted.
 Deleted file can’t be recovered. rm can’t delete the directories. If we want to remove all the files
from the particular directory we can use the * symbol.

-f Ignore nonexistent files, and never prompt before


removing.
-i Prompt before every removal.

Example :-
$ rm myfile.txt
 Remove the file myfile.txt. If the file is write-protected, you will be prompted to confirm that you
really want to delete it.
$ rm *
 Remove all files in the working directory. If it is write-protected, you will be prompted before rm
removes it.
$ rm -f myfile.txt
 Remove the file myfile.txt. You will not be prompted, even if the file is writeprotected; if rm can
delete the file, it will.
$ rm -f *
 Remove all files in the working directory. rm will not prompt you for any reason before deleting
them.
$ rm -i *
 Attempt to remove every file in the working directory, but prompt before each file to confirm.
20) sleep:- Delay for a specified amount of time
Syntax :- sleep NUMBER[SUFFIX]
Description:-
 The sleep command pauses for an amount of time defined by NUMBER.
SUFFIX may be "s" for seconds (the default), "m" for minutes, "h" for hours, or "d" for
days.14.ed:
21) wc:- Word Count (wc) command counts and displays the number of lines, words, character
and number of bytes enclosed in a file.
Syntax: - wc [options] [filename]

Description:-
This command counts lines, words and characters depending on the options used. It takes one or
more filenames as its arguments and displays four-columnar output. For example let’s read our
os1 file. And we use wc command with that filename.
-l print the newline counts.
-w print the word counts.
-c print the byte counts.
-m print the character counts.
-L print the length of the longest line.

22) finger:- finger command displays the user's login name, real name, terminal name and write
status (as a ''*'' after the terminal name if write permission is denied), idle time, login time, office
location and office phone number.
Syntax:- finger [username]

Description :-
-l Force long output format
-s Force short output format
PRACTICAL – 2
AIM : Write a shell script to generate marksheet of a student. Take 3
subjects, calculate and display total marks, percentage and Class
obtained by the student.
echo " Enter name "
read name
echo " Enter enrollment number "
read no
echo " Enter your marks "
read m1
read m2
read m3
total=$(expr $m1 + $m2 + $m3 )
avg=$(expr $total / 3)
echo "Student Name : $name"
echo "EnrollMent NUmber: $no"
echo "Average is : $avg"
if [ $m1 -ge 35 ] && [ $m2 -ge 35 ] && [ $m3 -ge 35 ]
then
echo "Result is: Pass"
if [ $avg -ge 80 ] && [ $avg -le 100 ]
then
echo "Result is: Distinction"
elif [ $avg -ge 61 ] && [ $avg -le 79 ]
then
echo "Result is: First class"
elif [ $avg -ge 35 ] && [ $avg -le 60 ]
then
echo "Result is: Second class"
fi
else
echo "Result is: fail"
fi

O/P :
Enter name
DJ
Enter enrollment number
13
Enter your marks
89
90
98
Average is : 92
Result is: Distinction
PRACTICAL – 3
AIM : Write a shell script to find factorial of given number n.
echo "Enter the number to find factorial?"
read number
fact=1
while [ $number -gt 0 ]
do
fact=`expr $number \* $fact`
number=`expr $number - 1`
done
echo "factorial is : $fact"

O/P:

DJ@ubuntu:~/Downloads/Practicals/OS _Practicals$ bash fab.sh


Enter a number

Enter a number

24
PRACTICAL – 4
AIM : Write a shell script which will generate first n fibonnacci numbers
like: 1, 1, 2, 3, 5
N=6
a=0
b=1

echo "The Fibonacci series is : "

for (( i=0; i<N; i++ ))


do
echo -n "$a "
fn=$((a + b))
a=$b
b=$fn
done
# End of for loop

Output:

Fibonacci Series is:


0
1
1
2
3
5
8
PRACTICAL – 5
AIM : Write a menu driven shell script which will print the following
menu and execute the given task.
a. Display calendar of current month
b. Display today’s date and time
c. Display usernames those are currently logged in the system
d. Display your name at given x, y position
e. Display your terminal number.

echo “ MENU
a. . Display calendar of current month
b. . Display today’s date and time
c. . Display usernames those are currently logged in the system
d. . Display your terminal number
e. . Exit

Read i
Case “$i” in
1) cal ;;
2) date ;;
3) who;;
4) tty ;;
5) exit ;;
*) echo “enter valid in put” ;;
esac

Output:

1) DJ@ubuntu:~/Downloads/Practicals/OS _Practicals$ cal


February 2018
Su Mo Tu We Th Fr Sa
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28

2) DJ@ubuntu:~/Downloads/Practicals/OS _Practicals$ date


Mon Feb 26 20:16:47 PST 2018

3) DJ@ubuntu:~/Downloads/Practicals/OS _Practicals$ who


paras tty7 2018-02-26 19:48 (:0)

4) DJ@ubuntu:~/Downloads/Practicals/OS _Practicals$ tty


/dev/pts/1
PRACTICAL – 6
AIM : Write a shell script to check entered number is palindrome or
not.
num=545

# Storing the remainder


s=0

# Store number in reverse


rev=""
temp=$num
while [ $num -gt 0 ]
do
# Get Remainder
s=$(( $num % 10 ))
# Get next digit
num=$(( $num / 10 ))

# Store previous number and


# current digit in reverse
rev=$( echo ${rev}${s} )
done
if [ $temp -eq $rev ];
then
echo "Number is palindrome"
else
echo "Number is NOT palindrome"
fi

Output:

Number is palindrome
PRACTICAL – 7
AIM : Write a shell script which will accept a number b and display
first n prime numbers as output.
prime_1=0
echo "enter the range"
read n
echo " Primenumber between 1 to $n is:"
echo "1"
echo "2"
for((i=3;i<=n;))
do
for((j=i-1;j>=2;))
do
if [ `expr $i % $j` -ne 0 ] ; then
prime_1=1
else
prime_1=0
break
fi
j=`expr $j - 1`
done
if [ $prime_1 -eq 1 ] ; then
echo $i
fi
i=`expr $i + 1`
done

Output:

Enter the range


25
Prime number 1 to 25 is :
1
2
3
5
7
11
13
17
19
23
PRACTICAL – 8
AIM : Write a shell script to display multiplication table of given
number.

clear
echo -----------------------------------
echo '\tMultiplication Table'
echo -----------------------------------
echo Enter table number
read tn
echo Enter how many rows
read n
i=1
while [ $i -le $n ]
do
k=$(expr $i \* $tn)
echo "$i * $tn = $k"
i=$(expr $i + 1)
done

Output:

Enter table number


6
Enter how many rows
5
1*6=6
2 * 6 = 12
3 * 6 = 18
4 * 6 = 24
5 * 6 = 30
PRACTICAL – 9
AIM : Study of Unix Shell and Environment Variables.
What is an environment variable?
Environment variables or ENVs basically define behavior of the environment. They can affect the
processes ongoing or the programs that are executed in the environment.

Scope of an environment variable


Scope of any variable is the region from which it can be accessed or over which it is defined. An
environment variable in Linux can have global or local scope.

Global
A globally scoped ENV that is defined in a terminal can be accessed from anywhere in that
particular environment which exists in the terminal. That means it can be used in all kind of scripts,
programs or processes running in the environment bound by that terminal.

Local
A locally scoped ENV that is defined in a terminal cannot be accessed by any program or process
running in the terminal. It can only be accessed by the terminal( in which it was defined) itself.

Variable Description

USER The username

HOME Default path to the user's home directory

EDITOR Path to the program which edits the content of files

UID User's unique ID

TERM Default terminal emulator

SHELL Shell being used by the user


Practical 10 :

AIM : Study of Advance commands and filters of Linux/UNIX.


Linux Filter commands accept input data from stdin (standard input) and produce output
on stdout (standard output). It transforms plain-text data into a meaningful way and can be used
with pipes to perform higher operations.
.
Linux Filter Commands
1. cat

Syntax:

cat <fileName> | cat or tac | cat or tac |. . .

2. cut

Syntax:

The 'cut' command is useful in selecting a specific column of a file. After (-d), delimiter (from
where you want to separate the columns) comes. Delimiters can be a space (' '), a hyphen (-), a slash
(/) or anything else. After (-f), column number is mentioned.

Syntax:

cut -d(delimiter) -f(columnNumber) <fileName>

3. grep

The 'grep' command is generally used with pipe (|).

Syntax:

command | grep <searchWord>


4. comm

The 'comm' command compares two files or streams. By default, 'comm' will always display three
columns. First column indicates non-matching items of first file, second column indicates non-
matching items of second file, and third column indicates matching items of both the files. Both the
files has to be in sorted order for 'comm' command to be executed.

Syntax:

comm <file1> <file2>

5. sed
Command 'sed' stands for stream editor. You can use this command to edit streams (files) using
regular expressions. But this editing is not permanent. It remains only in display, but in actual, file
content remains same.

Syntax:

command | sed 's/<oldWord>/<newWord>/'

6. tee

The 'tee' command is similar to 'cat' command with only one difference. It puts stdin on stdout and
also put them into a file.

Syntax:

cat or tac <fileName> | tee <newFile> | cat or tac |.....

7. tr

The command 'tr' stands for 'translate'. It is used to translate, like from lowercase to uppercase and
vice versa or new lines into spaces.

Syntax:

command | tr <'old'> <'new'>

8. uniq

With the help of uniq command you can form a sorted list in which every word will occur only
once.

Syntax:

command <fileName> | uniq

9. wc

The 'wc' command helps in counting the lines, words and characters in a file.

Syntax:

1. wc <fileName> (Counts words, lines and characters)


2. wc -l <fileName> (Counts only lines)
3. wc -w <fileName> (Counts only words)
4. wc -c <fileName> (Counts only characters)
10. od

The 'od' term stands for octal dump. It displays content of a file in different human-readable formats
like hexadecimal, octal and ASCII characters.

Syntax:

1. od -b <fileName> (display files in octal format)


2. od -t x1 <fileName> (display files in hexadecimal bytes format)
3. od -c <fileName> (display files in ASCII (backslashed) character format)
Seat No.: ________ Enrolment No.___________

GUJARAT TECHNOLOGICAL UNIVERSITY


BE - SEMESTER– IV(NEW) EXAMINATION – SUMMER 2023
Subject Code:3140702 Date:07-07-2023
Subject Name:Operating System
Time:10:30 AM TO 01:00 PM Total Marks:70
Instructions:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.
4. Simple and non-programmable scientific calculators are allowed.

Marks
Q.1 (a) Explain any three main functions of an Operating System. 03
(b) Describe the features of a distributed operating system. 04
(c) What is a process? Explain about various fields of process control block. 07

Q.2 (a) Define multi-threading? Explain its benefits. 03


(b) Describe the differences among long-term scheduling. short-term, and medium- 04
term scheduling.
(c) Demonstrate FIFO and Round Robin CPU scheduling algorithms with suitable 07
example.
OR
(c) What is semaphore? Explain its implementation as wait and signal for 07
providing process synchronization?

Q.3 (a) What are the advantages of inter-process communication? How communication 03
takes place in a shared-memory environment?
(b) What are the conditions under which a deadlock situation may arise? 04
(c) Explain the readers and writers problem. 07
OR
Q.3 (a) What is race condition? 03
(b) What are the methods for handling deadlocks? 04
(c) Explain the dining-philosophers problem. 07

Q.4 (a) Explain the difference between logical and physical addresses. 03
(b) When do page faults occur? Describe the actions taken by the operating system 04
when a page fault occurs.
(c) Explain Banker's deadlock-avoidance algorithm with an illustration. 07
OR
Q.4 (a) Explain the following allocation algorithms: 03
1) First-fit 2) Best-fit 3) Worst-fit
(b) Explain the difference between internal and external fragmentation. 04
(c) Explain the different file access methods in detail. 07

Q.5 (a) Explain domain of protection. 03


(b) Write a short note on: system threats. 04
(c) Explain in detail Synchronization implementation in Linux. 07
OR
Q.5 (a) What are the main difference between capability lists and access lists? 03
(b) Write a short note on: program threats. 04
(c) What is virtualization? Explain the benefits of virtualization. 07
*************
1
Seat No.: ________ Enrolment No.___________

GUJARAT TECHNOLOGICAL UNIVERSITY


BE - SEMESTER–IV (NEW) EXAMINATION – SUMMER 2022
Subject Code:3140702 Date:23-06-2022
Subject Name:Operating System
Time:10:30 AM TO 01:00 PM Total Marks: 70
Instructions:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.
4. Simple and non-programmable scientific calculators are allowed.

Marks
Q.1 (a) List any four functions of operating system? 03
(b) Explain the essential properties of 04
i) Batch system ii) Time sharing
iii) Real time iv) Distribute
(c) Explain process states and process control block in details. 07

Q.2 (a) What are the various criteria for a good process scheduling algorithm? 03
(b) What is thread? Explain classical thread model. 04
(c) How semaphores can be used to deal with n-process critical section 07
problem? Explain.
OR
(c) What is monitor? Explain solution for producer-consumer problem using 07
monitor.

Q.3 (a) Define preemption and nonpreemption. 03


(b) Explain the terms related to IPC: 04
i) Race condition ii) Critical section iii) Mutual exclusion iv) Semaphores
(c) How does deadlock avoidance differ from deadlock prevention? Write about 07
deadlock avoidance algorithm in detail.
OR
Q.3 (a) Give the Difference between Thread and Process. 03
(b) Explain the Priority scheduling algorithm. 04
(c) How to characterize the structure of deadlock? Explain the two solutions of 07
recovery from deadlock.

Q.4 (a) List out the seven RAID levels. 03


(b) Write short note on: Relocation problem for multiprogramming with fixed 04
partitions.
(c) What is paging? Discuss basic paging technique in details. 07
OR
Q.4 (a) What is the difference between logical I/O and device I/O? 03
(b) Write the first, best fit memory allocation techniques. 04
(c) Define Virtual Memory. Explain the process of converting virtual addresses 07
to physical addresses with a neat diagram.

Q.5 (a) Explain access control list. 03


(b) Differentiate between Windows and Linux file system. 04
(c) Write about Least Recently Used page replacement algorithm all its variants 07
with an example.
1
OR
Q.5 (a) Explain domain protection mechanism. 03
(b) Write a short note: Unix kernel. 04
(c) Describe in detail about variety of techniques used to improve the efficiency 07
and performance of secondary storage.
*************

2
Seat No.: ________ Enrolment No.___________

GUJARAT TECHNOLOGICAL UNIVERSITY


BE - SEMESTER–IV (NEW) EXAMINATION – SUMMER 2021
Subject Code:3140702 Date:03/09/2021
Subject Name:Operating System
Time:02:30 PM TO 05:00 PM Total Marks: 70
Instructions:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.
4. Simple and non-programmable scientific calculators are allowed.

Q.1 (a) Define the essential properties of the following types of operating systems: 03
(1) Batch (2) Time-sharing (3) Real-time
(b) What are the advantages of multiprogramming? 04
(c) What is the thread? What are the difference between user-level threads and kernel- 07
supported threads? Under what circumstances is one type “better” than the other?

Q.2 (a) What is Process? Give the difference between a process and a program. 03
(b) What is Process State? Explain different states of a process with various queues 04
generated at each stage.
(c) Write a bounded-buffer monitor in which the buffers (portions) are embedded within 07
the monitor itself.
OR
(c) What is Semaphore? Give the implementation of Readers-Writers Problem using 07
Semaphore.
Q.3 (a) Define the difference between preemptive and nonpreemptive scheduling. 03
(b) What are the Allocation Methods of a Disk Space? 04
(c) What is deadlock? Explain deadlock prevention in detail. 07
OR
Q.3 (a) What are the disadvantages of FCFS scheduling algorithm as compared to shortest 03
job first (SJF) scheduling?
(b) Distinguish between CPU bounded, I/O bounded processes. 04
(c) What is deadlock? Explain deadlock Avoidance in detail. 07
Q.4 (a) What is Access control? 03
(b) What are Pages and Frames? What is the basic method of Segmentation? 04
(c) Briefly explain and compare, fixed and dynamic memory partitioning schemes. 07
OR
Q.4 (a) Explain difference between Security and Protection? 03
(b) Differentiate external fragmentation with internal fragmentation. 04
(c) Explain the best fit, first fit and worst fit algorithm. 07

Q.5 (a) Explain the concept of virtual machines. 03


(b) Compare virtual machine and non virtual machine. 04
(c) What is “inode”? Explain File and Directory Management of Unix Operating System. 07
OR
Q.5 (a) What is marshalling and unmarshalling? 03
(b) What are components of Linux systems? 04
(c) Explain Disk arm scheduling algorithm. 07
*************

1
Seat No.: ________ Enrolment No.___________

GUJARAT TECHNOLOGICAL UNIVERSITY


BE - SEMESTER–IV (NEW) EXAMINATION – WINTER 2023
Subject Code:3140702 Date:11-01-2024
Subject Name: Operating System
Time:10:30 AM TO 01:00 PM Total Marks:70
Instructions:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.
4. Simple and non-programmable scientific calculators are allowed.

Marks

Q.1 (a) Define true virtualization with example. 03


(b) Write a shell script to find factorial of an user-defined natural number. 04
(c) Draw and explain seven state process state transition diagram in detail. 07

Q.2 (a) Explain the main function of a dispatcher in brief. 03


(b) List and briefly define four classes of real-time scheduling algorithms. 04
(c) Five batch jobs A, B, C, D and E arrive at same time. They have 07
estimated running times 10, 6, 3, 4 and 8 ms. For each of the following
algorithm determine mean process turnaround time. Consider process
swapping overhead is 1 ms.
1) FCFS
2) Round-Robin (Time quantum = 2 ms)
OR
(c) Five batch jobs P1, P2, P3, P4 and P5 arrive at 0, 1, 2, 3 and 4 ms. They 07
have estimated running times 14, 12, 8, 3 and 6 ms. Their priorities are
3, 5, 2, 1 and 4 respectively with 5 being highest priority. For each of
the following algorithm determine mean process turnaround time.
Consider process swapping overhead is 0.5 ms.
1) SJF (Non-preemptive)
2) Priority Scheduling (Preemptive)

Q.3 (a) Give the difference between weak semaphore and strong semaphore. 03
(b) Briefly explain critical section. 04
(c) Explain producer-consumer problem and solve it using semaphore. 07
Write pseudo code for the same.
OR
Q.3 (a) Give the key difference between a mutex and a binary semaphore. 03
(b) List the requirements for mutual exclusion. 04
(c) Explain Dining philosopher problem and its solution using semaphore. 07

Q.4 (a) Explain I/O buffering in brief. 03


(b) Write a short note on Access Control List. 04
(c) Write and explain Banker’s Algorithm for deadlock avoidance with 07
suitable example.
OR
Q.4 (a) Compare RAID level 3 with RAID level 4. 03
(b) Write a short note on design principles of OS security. 04
(c) Write and explain deadlock detection algorithm with suitable example. 07

1
Q.5 (a) Explain concept of thrashing. 03
(b) Given the following track requests in the disk 04
queue, compute for the Total Head Movement
(THM) of the read/write head and seek time needed for SSTF Disk
Scheduling approach:
86, 147, 91, 230, 94, 168, 270, 30
Consider that the read/write head is positioned at location 150. A seek
takes 3 ms per cylinder move. Consider a disk drive with 300 cylinders.
(c) Explain any three memory placement algorithms with suitable example. 07
OR
Q.5 (a) Compare and contrast paging with fragmentation. 03
(b) Given the following track requests in the disk 04
queue, compute for the Total Head Movement
(THM) of the read/write head and seek time needed for C-SCAN Disk
Scheduling approach:
95, 180, 34, 119, 11, 123, 62, 64
Consider that the read/write head is positioned at location 50. A seek
takes 5 ms per cylinder move. Consider a disk drive with 200 cylinders.
(c) Explain any three page replacement algorithms with suitable example. 07

*******

2
Seat No.: ________ Enrolment No.___________

GUJARAT TECHNOLOGICAL UNIVERSITY


BE - SEMESTER–IV(NEW) EXAMINATION – WINTER 2022
Subject Code:3140702 Date:13-12-2022
Subject Name:Operating System
Time:10:30 AM TO 01:00 PM Total Marks:70
Instructions:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.
4. Simple and non-programmable scientific calculators are allowed.
MARKS
Q.1 (a) Differentiate multiprocessing and multiprogramming operating system. 03
(b) Write the functions of operating system. 04
(c) What is process? Explain process control block with all parameters. 07

Q.2 (a) Differentiate user level and kernel level thread. 03


(b) What is scheduling? Explain the types of schedulers. 04
(c) List out various criteria for good process scheduling algorithms. 07
Illustrate non-preemptive priority scheduling algorithm.
OR
(c) Differentiate process and thread. Explain process state diagram. 07

Q.3 (a) Define following terms: 03


(i)Critical section (ii) Mutual exclusion (iii) Bounded waiting
(b) Define deadlock. Describe deadlock prevention in detail. 04
(c) Illustrate Readers and Writers IPC problem with solution. 07
OR
Q.3 (a) Explain Resource allocation graph. 03
(b) What is deadlock? List the conditions that lead to deadlock. 04
(c) Explain the Banker’s algorithm for deadlock avoidance with an 07
example.

Q.4 (a) Explain segmentation. 03


(b) What is external fragmentation? Explain the solution to external 04
fragmentation.
(c) Explain paging hardware with TLB. 07
OR
Q.4 (a) Explain address binding. 03
(b) Explain following allocation algorithm 1) First Fit 2) Best Fit. 04
(c) What is page fault? Explain steps to handle page fault with diagram. 07

Q.5 (a) Discuss the major goals of I/O software. 03


(b) What is virtualization? Explain the benefits of virtualization. 04

(c) Draw the block diagram for DMA. Write steps for DMA data transfer. 07
OR
Q.5 (a) Differentiate block and character devices. 03
(b) Explain following Unix command: grep, sort, chmod, mkdir. 04
(c) Write short note on RAID levels. 07

*************
1
Seat No.: ________ Enrolment No.___________

GUJARAT TECHNOLOGICAL UNIVERSITY


BE - SEMESTER–IV (NEW) EXAMINATION – WINTER 2021
Subject Code:3140702 Date:31/12/2021
Subject Name:Operating System
Time:10:30 AM TO 01:00 PM Total Marks: 70
Instructions:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.
4. Simple and non-programmable scientific calculators are allowed.

Q.1 (a) Define the followings: 03


(1) System bus
(2) Auxiliary memory
(b) What do you mean by cache memory? Explain the cache read operation. 04
(c) What is process? Explain the process creation and termination. 07

Q.2 (a) Define the term critical section. 03


(b) Difference between user level and kernel level thread. 04
(c) Consider following processes with length of CPU burst time in milliseconds 07
Process Burst time
P1 5
P2 10
P3 2
P4 1
All process arrived in order p1, p2, p3, p4 all time zero.
(1) Draw gantt charts illustrating execution of these processes for SJF and round
robin (quantum=1)
(2) Calculate waiting time for each process for each scheduling algorithm
(3) Calculate average waiting time for each scheduling algorithm
OR
(c) What are various criteria for a good process scheduling algorithm? Explain any 07
two preemptive scheduling algorithms in brief.
Q.3 (a) What is meant priority inversion? 03
(b) What is the criterion used to select the time quantum in case of round-robin 04
scheduling algorithm? Explain it with a suitable example.
(c) What is Semaphore? Give the implementation of Bounded Buffer Producer 07
Consumer Problem using Semaphore.
OR
Q.3 (a) What is Deadlock? List the conditions that lead to deadlock. 03
(b) List criterions used to evaluate the performance of CPU scheduling algorithms. 04
(c) What is advantage of using Monitor? Give the implementation of Bounded Buffer 07
Producer Consumer Problem using Monitor.
Q.4 (a) What is resource allocation graph? 03
(b) Explain paging technique. 04
(c) Explain the following allocation algorithms: 07
1
(1) First-fit
(2) Best-fit
(3) Worst-fit
OR
Q.4 (a) When is a system in a safe state? 03
(b) Explain segmentation. 04
(c) What is fragmentation? Explain the difference between internal and external 07
fragmentation.
Q.5 (a) Explain RAID. How it is helpful to increase CPU performance? 03
(b) Explain the following Linux commands: 04
(1) mkdir
(2) touch
(3) cat
(4) rm
(c) What do you mean by security? Discuss in brief access control list. 07
OR
Q.5 (a) Explain i/o buffering. 03
(b) What is virtualization? Explain the benefits of virtualization. 04
(c) Why is segmented paging important (as compared to a paging system)? What are 07
the different pieces of the virtual address in a segmented paging?

*************

2
Seat No.: ________ Enrolment No.___________

GUJARAT TECHNOLOGICAL UNIVERSITY


BE- SEMESTER–IV (NEW) EXAMINATION – WINTER 2020
Subject Code:3140702 Date:09/02/2021
Subject Name:Operating System
Time:02:30 PM TO 04:30 PM Total Marks:56
Instructions:
1. Attempt any FOUR questions out of EIGHT questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.
Marks
Q.1 (a) Explain structure of Operating System. 03
(b) Draw and explain five state Process State Transition Diagram. 04
(c) Solve following example by FCFS and SJF CPU scheduling 07
algorithm. Draw Gantt Chart and calculate Average Waiting Time
and Average Turnaround time.
Process Arrival Time Burst Time
P0 0 10
P1 1 6
P2 3 2
P3 5 4

Q.2 (a) State features of distributed operating system. 03


(b) Explain principle of concurrency in brief. 04
(c) Explain Dining philosopher problem and its solution using 07
semaphore.

Q.3 (a) Explain pure virtualization in brief. 03


(b) What is deadlock? List the conditions that lead to deadlock. 04
(c) State the need of demand paging. Explain the steps to handle a page 07
fault using demand paging.

Q.4 (a) Explain Access Control List in brief. 03


(b) Write a Shell script to find Factorial of a given number. 04
(c) Disk requests come in to the disk driver for cylinders 10, 22, 20, 2, 07
40, 6, and 38, in that order. A seek takes 6 msec per cylinder moved.
How much seek time is needed for
(a) First-come, first served.
(b) Closest cylinder next.
In all cases, the arm is initially at cylinder 20.

Q.5 (a) Explain different services provided by operating system. 03


(b) Explain process control block with diagram. 04
(c) Explain Thread Scheduling with suitable example. 07

Q.6 (a) Give the difference between multitasking OS and multiprogramming 03


OS.
(b) Explain Mutual Exclusion in brief. 04

1
(c) Explain producer-consumer problem and solve it using semaphore. 07
Write pseudo code for the same.

Q.7 (a) Explain need of Virtual Machines. 03


(b) How Resource Trajectories can be helpful in avoiding the deadlock? 04
(c) Given memory partitions of 100 KB, 500 KB, 200 KB, 300 KB and 07
600 KB (in order), how would each of the first-fit, best-fit and worst-
fit algorithms place processes of 212 KB, 417 KB, 112 KB and 426
KB (in that order) ? Which algorithm makes the most efficient use of
memory?

Q.8 (a) Write a note on Generic Security Attacks. 03


(b) Explain Unix Commands – grep, sort, cat, chmod. 04
(c) Explain RAID level system in detail. 07
*********

You might also like