Operating System Assignment: Process and Storage Management Concepts

Verified

Added on  2022/12/15

|12
|1547
|401
Homework Assignment
AI Summary
This assignment solution addresses key concepts in operating systems, focusing on process and storage management within a Unix environment. The solution begins by defining core terms such as terminal emulator, shell, program, process, and pipe, and then delves into the mechanisms of process creation and program execution, illustrating the relationships between processes using diagrams. The document explains how pipes facilitate communication between processes, clarifying which processes can read and write to the pipe, and includes diagrams. The assignment also covers process termination, detailing the exit() system call and the handling of child processes. The second part of the assignment explores storage management, including the geometry of a magnetic disk and calculating its capacity. Furthermore, it discusses the structure of directories, file system access controls using the chmod command, and the role of umask in setting file permissions. References to source materials are provided throughout the document.
Document Page
Running Head: Operating System 0
Operating System
Individual task
Student name
tabler-icon-diamond-filled.svg

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
Operating System 1
1. (a)
Terminal emulator: Terminal emulator is a command prompt in UNIX, which is used for
Appling commands and there results. It can be open by ctrl plus alt plus T button from keyboard
( Arrows , 2018).
Shells: Shell uses for interpret commands from terminal emulator. It is a command interpretor in
Linux. There are different types of shell available in the operating system based on their
requirements. Defaults shell is bash shell in Linux. There are other shells are available in Linux,
which are TSH, Ksh, Zsh, and many others ( Kili, 2016).
Program: A program is collection of number of instruction in different language, such as
machine language, assembly language, and high-level languages.
Process: it is an execution of a program in memory by processor to manage different works. It is
a way to manage different works, which are created by user and system processes. System can
manage its works using creating new processes from a specific system call, such as fork().
Pipe: Pipe is a concept in which different processes are in a queue and they are executing one by
one, as their order is decided by pipe. It is a pipelining concept in the operating system
(b) Process Management:
ps command is used for list all processes and option –e is used for show all processes, not just
those belonging to the user. Option –f shows processes in full format, which have more details
about the processes ( Kili , 2017). grep command is used for find lines containing a pattern in a
file or output. Process name is used for the pattern, which is used by the grep command.
Document Page
Operating System 2
Source: (softprayog.in, 2019)
Process creation and execution are two state of a process and they are started with fork command
in the UNIX operating system. It is a way to create a new process with child processes ( Kili,
2016).
Process management is a process in which different types of process manage by the processor
with the help of inter-process communication and message passing.
(c)
Pipe is used to make a communication and synchronization between different processes.
Therefore, it is necessary to make proper management of process to avoid confusion for
execution and other processes. Processes are communicated with each other through proper
channel, which is called inter-process communication. Processes are communicated using
message passing and pipe. Pipe can manage all the processes according to their respective order
and requirements (Roz, 2017).
There are different step of piping in the process management. These are the following steps:
Document Page
Operating System 3
Source: (Roz, 2017)
Source: (Roz, 2017)
Source: (Roz, 2017)
tabler-icon-diamond-filled.svg

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
Operating System 4
Source: (Roz, 2017)
Source: (Roz, 2017)
Source: (Roz, 2017)
Document Page
Operating System 5
Source: (Roz, 2017)
Source: (Roz, 2017)
Source: (Roz, 2017)
Document Page
Operating System 6
(d)
Process termination is a process in which processes may request their own termination using the
exit () system call. It can return two types of values, which are zero or non-zero value. Zero is
used for successful completion and non-zero in the event of problems.
child code:
int exitCode;
exit( exitCode );
It is a code for exit the child process prom pipe or queue.
parent code:
pid_t pid;
int status
pid = wait( &status );
It is a code for exiting a parent process from queue.
System can terminate process for different reasons. System can terminate process because
inability of the system resources. System can use KILL command for handle interrupt from a
process. Parent process can also kill child process, which is no longer needed. If the parent
process request for exit () then child process are generally inherited by init, which then proceed
to kill them. In some cases, UNIX nohup command allow child processes to continue in system.
When a process terminates from the system then all of its child processes and resources are freed
up. Processes which are trying to terminate but which cannot because their parent is not waiting
for them are termed zombies.
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
Operating System 7
2. Storage management
(a) Geometry of a typical magnetic disk.
Source: ( Castilla, 2015)
Source: (brainbell.com, 2019)
Document Page
Operating System 8
Source: (brainbell.com, 2019)
Source: (brainbell.com, 2019)
Cylinders, heads, and sectors per track are known collectively as the CHS values. The capacity
of any hard disk drive can be determined from these three values.
The maximum CHS values are:
1024 cylinders.
16 heads.
63 sectors per track.
Document Page
Operating System 9
512 bytes per sector.
Based on given values, we can calculate size of magnetic disk 1024 x 16 x 63 x 512 bytes/sector
= 528,482,304 bytes (528 million bytes or 504 MB)
(b)
Tree structure provides unique path to reach at any node. A directory contains directories and
files. Therefore, it is necessary to provide unique path to each files and directory. There are many
types of structure to arrange a directory, such as single-level directory, two-level-directory, tree-
structured directory, acyclic graph directory, and many more.
Tree structured directory are having many advantages, such as very generalize, scalable,
collision less, better searching, and many others.
(c) UNIX operating system control access:
UNIX operation system uses chmod command to provide different persimmon for user, group,
and others, such as read, write, and execute of a file. File system provide all the permission based
on the user, group and others. There is an example of access controls (Krzyzanowski , 2019).
localhost:Desktop admin$ ls -la dir1
total 0
drwxr-xr-x 2 admin staff 68 May 19 16:19 .
localhost:Desktop admin$ ls -la file1
-rw-r--r-- 1 admin staff 4 May 19 16:20 file1
User can change these permissions as mention in below example.
localhost:Desktop admin$ chmod 777 dir1
localhost:Desktop admin $ chmod 600 file1
localhost:Desktop admin $ ls -la file1
-rw------- 1 admin staff 4 May 19 16:20 file1
tabler-icon-diamond-filled.svg

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
Operating System 10
localhost:Desktop admin $ ls -la dir1
total 0
drwxrwxrwx 2 admin staff 68 May 19 16:19 .
User can manage permissions of a file or directory using chmod command and its
options.
There are different options with the chmod command ( Prusty, 2014).
(d)
An umask of 002 is good when we share data with other users in the same group. It is 777-
002=775, which means rwxrwxr-x permissions to the directory. Members of your group can
create and modify data files. Therefore, it is successful with those attributes. Those outside our
group can read data file, but cannot modify it. We can set our umask to 007 to completely
exclude users who are not group members (cyberciti.biz, 2007). File and directory access can
change using chmod and it has different options.
Document Page
Operating System 11
References
Arrows , K., 2018. What is a Terminal Emulator. [Online]
Available at: https://appuals.com/what-is-a-terminal-emulator/
[Accessed 1 May 2019].
Kili , A., 2017. 30 Useful ‘ps Command’ Examples for Linux Process Monitoring. [Online]
Available at: https://www.tecmint.com/ps-command-examples-for-linux-process-monitoring/
[Accessed 1 May 2019].
Kili, A., 2016. 5 Most Frequently Used Open Source Shells for Linux. [Online]
Available at: https://www.tecmint.com/different-types-of-linux-shells/
[Accessed 1 May 2019].
Prusty, N., 2014. UNIX File System Permissions Tutorial. [Online]
Available at: http://qnimate.com/understanding-unix-filesystem-permissions/
[Accessed 1 May 2019].
Roz, 2017. Pipes, Forks, & Dups: Understanding Command Execution and Input/Output Data
Flow. [Online]
Available at: http://www.rozmichelle.com/pipes-forks-dups/
[Accessed 1 May 2019].
softprayog.in, 2019. Creating processes with fork and exec in Linux. [Online]
Available at: https://www.softprayog.in/programming/creating-processes-with-fork-and-exec-in-
linux
[Accessed 1 May 2019].
chevron_up_icon
1 out of 12
circle_padding
hide_on_mobile
zoom_out_icon
logo.png

Your All-in-One AI-Powered Toolkit for Academic Success.

Available 24*7 on WhatsApp / Email

[object Object]