BN104 Operating System: Device, File, and Process Management

Verified

Added on  2023/04/25

|13
|1143
|297
Homework Assignment
AI Summary
This document is a comprehensive solution to an Operating Systems assignment, addressing key concepts in operating system design and functionality. The assignment covers disk scheduling algorithms (FCFS, SSTF, LOOK) and their performance analysis, including the calculation of total and average track movements. It also delves into the concept of deadlock, explaining its causes and illustrating it with an example involving processes and resources. The document further explores file management, differentiating between fixed and variable length fields and relative and complete file names. Additionally, it provides detailed explanations and examples of essential UNIX commands such as chmod, cd, ls, and mkdir, demonstrating their usage in file and directory manipulation. The assignment concludes with a bibliography of relevant academic sources.
Document Page
Running head: OPERATING SYSTEM
Operating System
Name of the Student:
Name of the University:
Author Note
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
1
OPERATING SYSTEM
Answer to question number B - Q1
a)
i)
FCFS
19 -> 36 17
36 -> 2 34
2 -> 27 25
27 -> 0 27
0 -> 21 21
21 -> 18 3
18 -> 55 37
Document Page
2
OPERATING SYSTEM
55 -> 22 33
ii)
SSTF
19 -> 21 2
21 -> 22 1
22 -> 27 3
27 -> 36 9
36 -> 55 19
55 -> 18 37
18 -> 2 16
2 -> 0 2
Document Page
3
OPERATING SYSTEM
iii)
LOOK
19 -> 18 1
18 -> 2 16
2 -> 0 2
0 -> 21 21
21 -> 22 1
22 -> 27 5
27 -> 36 9
36 -> 55 19
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
4
OPERATING SYSTEM
b)
i) FCFS
The number of total tracks are: (17 + 34 + 25 + 27 + 21 + 3 + 37 + 33) = 197 tracks
Number of average tracks: (1947/8) = 24.625
ii) SSTF
The number of total tracks are: (2 + 1 + 3 + 9 + 19 + 37 + 16 + 2) = 89 tracks
Number of average tracks: (89/ 8) = 11.125
iii) LOOK
The number of total tracks are: (1 + 16 + 2 + 21 + 1 + 5 + 9 + 19) = 74 tracks
Number of average tracks: (74/ 8) = 9.25
Answer to question number B – Q2
a)
Deadlock is a state where any two processes in a system requires a single resource
however the resource is already allocated to some other process and hence the process goes to
a waiting state and cannot continue much further with the process if they do not get the
required resource on time.
b)
Document Page
5
OPERATING SYSTEM
The four processes that are considered here for the example are P1, P2, P3 and P4.
The resources available to the system are R1, R2 and R3. An instance has been considered
here for the deadlock criteria. The processes P1 and P4 currently hold the resource R2.
However process P3 cannot proceed further without the obtaining the resource P3. Similarly
the processes P2, P3 and P4 also goes into a waiting state. Hence, the system goes to a
deadlock state.
c)
i)
Fixed Lengths and Variable Length field:
The variable length is used for referral to a record of variable length, whereas a fixed
length field is required for the referral to a record having fixed lengths.
For example:
The data storage for an employee of an organization has been considered in this
instance.
For the consideration a fixed length field of 3 has been considered here.
Document Page
6
OPERATING SYSTEM
ID E00
Name DEV
ADDRESS 1AD
The same data stored in variable length would be represented as:
ID E001
Name DIVINE
ADDRESS 1ADENVER
ii)
Relative and Complete File name:
The relative file name provides the name of the directory that would be used a root
and the file obtained from the relative file name would be complete file. The position of the
file in the physical storage system would be considered as the complete file name and the
logical position of the file in the data storage system would be considered as the relative file
name.
Examples of the complete file:
C:\Documents\example.docx
http://www.facebook.com/image.png
Example of a relative file:
Dashboard/ example.docx
Student\student1\ image.png
Answer to question number B-Q3
chmod
Introduction
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
7
OPERATING SYSTEM
The command helps with the change of permissions for the files and directories of the
system. The mode of the file is changed with the help of this command.
Syntax
chmod [OPTION]... MODE[,MODE]... FILE...
chmod [OPTION]... OCTAL-MODE FILE...
chmod [OPTION]... --reference=RFILE FILE...
Examples
chmod 754
chmod 777
chmod 754
cd
Document Page
8
OPERATING SYSTEM
Introduction
This command is used to change the present directory the user is in.
Syntax
cd [option] [directory]
Examples
cd new
ls
Introduction
This command helps to identify all the sub-directories and the files present inside the
directory.
Document Page
9
OPERATING SYSTEM
Syntax
ls [option ...] [file]...
Examples
ls – l
ls – a
mkdir
Introduction
This command helps to create a directory.
Syntax
mkdir [-m=mode] [-p] [-v] [-Z=context] directory [directory ...]
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
10
OPERATING SYSTEM
mkdir –version
mkdir --help
Examples
mkdir sample
mkdir new
Document Page
11
OPERATING SYSTEM
chevron_up_icon
1 out of 13
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]