0% found this document useful (0 votes)
135 views

OS Manual

The document provides information on various types of operating systems including batch, time-sharing, distributed, network, and real-time operating systems. It describes the key features of each type of operating system, including advantages and disadvantages. It also provides examples of operating systems that fall under each category.

Uploaded by

rguy5866
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
135 views

OS Manual

The document provides information on various types of operating systems including batch, time-sharing, distributed, network, and real-time operating systems. It describes the key features of each type of operating system, including advantages and disadvantages. It also provides examples of operating systems that fall under each category.

Uploaded by

rguy5866
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

Practical 1(A)

Aim: Study the features of all the major operating systems evolved and
perform comparative analysis.

a) Major operating systems:


1. Batch Operating System:
In this technique, similar types of jobs were batched together and executed in time.
In Batch operating system, access is given to more than one person; they submit their respective
jobs to the system for the execution.
The system put all of the jobs in a queue on the basis of first come first serve and then executes
the jobs one by one. The users collect their respective output when all the jobs get executed.
The purpose of this operating system was mainly to transfer control from one job to another as
soon as the job was completed. It contained a small set of programs called the resident monitor
that always resided in one part of the main memory. The remaining part is used for servicing
jobs.
Advantages of Batch Operating System:
 It is very difficult to guess or know the time required for any job to complete. Processors
of the batch systems know how long the job would be when it is in queue
 Multiple users can share the batch systems
 The idle time for the batch system is very less
 It is easy to manage large work repeatedly in batch systems
Disadvantages of Batch Operating System:
 The computer operators should be well known with batch systems
 Batch systems are hard to debug
 It is sometimes costly
 The other jobs will have to wait for an unknown time if any job fails
Examples of Batch based Operating System: Payroll System, Bank Statements, etc.

2. Time-Sharing Operating Systems:


In the Time Sharing operating system, computer resources are allocated in a time-
dependent fashion to several programs simultaneously.
Thus it helps to provide a large number of user's direct access to the main computer.
It is a logical extension of multiprogramming.
In time-sharing, the CPU is switched among multiple programs given by different users
on a scheduled basis.
A time-sharing operating system allows many users to be served simultaneously, so

Fundamentals of Operating System Page | 1


sophisticated CPU scheduling schemes and Input/output management are required.
Time-sharing operating systems are very difficult and expensive to build.
Advantages of Time-Sharing OS:
 Each task gets an equal opportunity
 Fewer chances of duplication of software
 CPU idle time can be reduced
Disadvantages of Time-Sharing OS:
 Reliability problem
 One must have to take care of the security and integrity of user programs and data
 Data communication problem
Examples of Time-Sharing OSs are: Multics, Unix, etc.

3. Distributed Operating System:


The Distributed Operating system is not installed on a single machine, it is divided into parts,
and these parts are loaded on different machines.
A part of the distributed Operating system is installed on each machine to make their
communication possible.
Distributed Operating systems are much more complex, large, and sophisticated than Network
operating systems because they also have to take care of varying networking protocols.
Advantages of Distributed Operating System:
 Failure of one will not affect the other network communication, as all systems are
independent from each other
 Electronic mail increases the data exchange speed
 Since resources are being shared, computation is highly fast and durable
 Load on host computer reduces
 These systems are easily scalable as many systems can be easily added to the network
 Delay in data processing reduces
Disadvantages of Distributed Operating System:
 Failure of the main network will stop the entire communication
 To establish distributed systems the language which is used are not well defined yet
 These types of systems are not readily available as they are very expensive. Not only
that the underlying software is highly complex and not understood well yet
Examples of Distributed Operating System are- LOCUS, etc.

Fundamentals of Operating System Page | 2


4. Network Operating System:
An Operating system, which includes software and associated protocols to communicate with
other computers via a network conveniently and cost-effectively, is called Network Operating
System.
Types of Network Operating System:
1. Peer to peer system.
2. Client-server system.
Advantages of Network Operating System:
 Highly stable centralized servers
 Security concerns are handled through servers
 New technologies and hardware up-gradation are easily integrated into the system
 Server access is possible remotely from different locations and types of systems
Disadvantages of Network Operating System:
 Servers are costly.
 User has to depend on a central location for most operations
 Maintenance and updates are required regularly
Examples of Network Operating System are: Microsoft Windows Server 2003, Microsoft
Windows Server 2008, UNIX, Linux, Mac OS X, Novell NetWare, and BSD, etc.

5. Real Time Operating System:


In Real-Time Systems, each job carries a certain deadline within which the job is supposed to
be completed, otherwise, the huge loss will be there, or even if the result is produced, it will be
completely useless.
The Application of a Real-Time system exists in the case of military applications, if you want
to drop a missile, then the missile is supposed to be dropped with a certain precision.
Types of Real-Time Operating System:
1. Hard Real-Time Operating System.
In Hard RTOS, all critical tasks must be completed within the specified time duration, i.e.,
within the given deadline. Not meeting the deadline would result in critical failures such as
damage to equipment or even loss of human life.
Example: Medical critical care system, Aircraft systems, etc.

2. Soft Real-Time Operating System.


Soft RTOS accepts a few delays via the means of the Operating system. In this kind of RTOS,
there may be a closing date assigned for a particular job, but a delay for a small amount of time
is acceptable. So, cut off dates are treated softly via means of this kind of RTOS.
Example: Online Transaction system and Livestock price quotation System.

Fundamentals of Operating System Page | 3


3. Firm Real-Time Operating System.
In Firm RTOS additionally want to observe the deadlines. However, lacking a closing date
might not have a massive effect, however may want to purposely undesired effects, like a
massive discount within the fine of a product.
Example: Various types of Multimedia applications.

Advantages of Real-time operating system:


 Easy to layout, develop and execute real-time applications under the real-time operating
system.
 In a Real-time operating system, the maximum utilization of devices and systems.

Disadvantages of Real-time operating system:


 Real-time operating systems are very costly to develop.
 Real-time operating systems are very complex and can consume critical CPU cycles.

Fundamentals of Operating System Page | 4


PRACTICAL 1(B)
Aim: Execute general purpose utility commands of linux operating system:
man, echo, printf, cal, date, who, who am i, history.

Man: man command in Linux is used to display the user manual of any command that we can
run on the terminal.

Syntax: $man [OPTION]... [COMMAND NAME]...

Description:

Option Use

-I It considers the command as case sensitive.

-a This option helps us to display all the available intro


manual pages in succession.

-w This option returns the location in which the manual page of a


given command is present.

Example:

Echo: It's used for displaying lines of text or string which are passed as arguments on the
command line.

Syntax: $man [OPTION]... [COMMAND NAME]...

Description:

Option Use

\t This option is used to create horizontal tab spaces.

-n This option is used to omit echoing trailing newline.

Fundamentals of Operating System Page | 5


\r Carriage return with backspace interpreter ‘-e‘ to have
specified carriage return in output.

Example:

Printf: It's used to display the given string, number or any other format specifier on the
terminal window.

Syntax: $printf [-v var] format [arguments]

Description:

Option Use

%b It is same as string specifier but it allows us to interpret


escape sequences with an argument.

%s It is basically a string specifier for string output.

%d It is an integer specifier for showing the integral values.

Example:

Cal: cal command displays a calendar of the specified year or month. The Year parameter
names the year for which you want a calendar.Syntax: cal [ [ month ] year]

Description:

Option Use

Fundamentals of Operating System Page | 6


cal 08 2000 Shows calendar of selected month and year.

cal -y Shows the calendar of the complete current year with the
current date highlighted.

cal 2018 Shows the whole calendar of the year.

Example:

Date: date command is used to display the system date and time. date command is also used
to set date and time of the system.

Syntax: date [OPTION]... [+FORMAT]

Description:

Option Use

-r This is used to display the last modified timestamp of a


datefile.

–file or -f This is used to display the date string present at each line of file
in the date and time format.

-s or –set To set the system date and time -s or –set option is used.

Example:

Fundamentals of Operating System Page | 7


Who: The who command is used to get information about currently logged in user on to
system.

Syntax: $who [options] [filename]

Description:

Option Use

who -b -H To show time of the system when it booted last time.

who -T -H To show status of the users message as +, – or.

who -u To show list of users logged in to system.

Example:

Who am i: whoami command is used both in Unix Operating System and as well as in
Windows Operating System.
● It is basically the concatenation of the strings “who”,”am”,”i” as whoami.
● It displays the username of the current user when this command is invoked.
● It is similar as running the id command with the options -un.

Syntax: $whoami

Description:

Option Use

–help It gives the help message and exit.

–version It gives the version information and exit.

Example:

Fundamentals of Operating System Page | 8


History: history command is used to view the previously executed command. This feature was
not available in the Bourne shell. Bash and Korn support this feature in which every command
executed is treated as the event and is associated with an event number using which they can
be recalled and changed if required. These commands are saved in a history file. In Bash shell
history command shows the whole list of the command.

Syntax: $ history

Description:

Option Use

history -c The whole history can be removed.

history Command shows the whole list of the command.

history 5 To show the limited number of commands that executed


previously.

Example:

Fundamentals of Operating System Page | 9


PRACTICAL 2(A)
Aim: Execute File system commands: cd, pwd, mkdir, rmdir, Is, cat, cp, rm,
mv, absolute path, relative path, and chmod.

Cd: cd command in linux known as change directory command. It is used to change current
working directory.

Syntax: $ cd [directory]

Description:

Option Use

cd ~ This command is used to change directory to the home


directory.

cd This command also work same as cd ~ command.

cd .. This command is used to move to the parent directory of current


directory, or the directory one level up from the current
directory. “..” represents parent directory.

Example:

Pwd: pwd stands for Print Working Directory. It prints the path of the working directory,
starting from the root.

Syntax: $ pwd

Fundamentals of Operating System Page | 10


Description:

Option Use

pwd -L Prints the symbolic path.

pwd -P Prints the actual path.

Example:

Mkdir: mkdir command in Linux allows the user to create directories. This command can
create multiple directories at once as well as set the permissions for the directories.

Syntax: mkdir [options...] [directories ...]

Description:

Option Use

–version It displays the version number, some information regarding the


license and exits.

–help It displays the help related information and exits.

-v It displays a message for every directory created.

Example:

Fundamentals of Operating System Page | 11


Rmdir: rmdir command is used remove empty directories from the filesystem in Linux.

Syntax: rmdir [-p] [-v | –verbose] [–ignore-fail-on-non-empty] directories …

Description:

Option Use

–help It will print the general syntax of the command along with the
various options that can be used with the rmdir command as well
as give a brief description about each option.

–version This option is used to display the version information and exit.

Example:

Fundamentals of Operating System Page | 12


Ls: ls is a Linux shell command that lists directory contents of files and directories.

Syntax: $ ls [Option]…[

Description:

Option Use

-a Display Hidden Files.

-A To show the hidden files, but not the ‘.’ (current directory) and
‘..’ (parent directory).

-D List directories themselves , not their contents.

Example:

Fundamentals of Operating System Page | 13


Cat: cat(concatenate) command is very frequently used in Linux. It reads data from the file
and gives their content as output. It helps us to create, view, concatenate files. So let us see
some frequently used cat commands.

Syntax: $cat filename


Description:
Option Use
$cat *.txt Cat command to display the content of all text files in the folder.
$cat -n filename To view contents of a file preceding with line numbers.
$cat file1 file2 To view multiple files.

Example:

Cp: cp stands for copy. This command is used to copy files or group of files or directory. It
creates an exact image of a file on a disk with different file name. cp command require at
least two filenames in its arguments.
Syntax:
cp [OPTION] Source Destination

Fundamentals of Operating System Page | 14


cp [OPTION] Source Directory
cp [OPTION] Source-1 Source-2 Source-3 Source-n Directory

Description:
Option Use
-i With this option system first warns the user before overwriting
the destination file.
With this option cp command creates the backup of the
-b destination file in the same folder with the different name and in
different format.
If the system is unable to open destination file for writing
-f operation because the user doesn’t have writing permission for
this file then by using -f option with cp command, destination file
is deleted first and then copying of content is done from source to
destination file.

Example:

Fundamentals of Operating System Page | 15


Rm: rm stands for remove here. rm command is used to remove objects such as files,
directories, symbolic links and so on from the file system like UNIX. To be more precise, rm
removes references to objects from the filesystem, where those objects might have had
multiple references (for example, a file with two different names).
Syntax: rm [OPTION]... FILE...

Description:

Option Use

The -i option makes the command ask the user for confirmation
-i before removing each file, you have to press y for confirm
deletion, any other key leaves the file un-deleted.
The -f option overrides this minor protection and removes the file
-f forcefully.
With -r(or -R) option rm command performs a tree-walk and will
-r delete all the files and sub-directories recursively of the parent
directory.

Example:

Fundamentals of Operating System Page | 16


Mv: mv stands for move. mv is used to move one or more files or directories from one
place to another in a file system like UNIX.

Syntax: mv [Option] source destination

Description:

Option Use
The -i option makes the command ask the user for confirmation
-i before moving a file that would overwrite an existing file, you
have to press y for confirm moving, any other key leaves the file
as it is.
The -f option overrides this minor protection and overwrites the
-f destination file forcefully and deletes the source file.
With -n option, mv prevent an existing file from being
-n overwritten.

Example:

Fundamentals of Operating System Page | 17


Practical 2(B)

Aim: Execute memory management commands: free, df, top, ps and kill.

Free: This command shows the free and used memory (RAM) on the Linux system.

Syntax: $free [OPTION]


Description:

Option Use
-b It displays the memory in bytes.
-k It displays the amount of memory in kilobytes(default).
-m It displays the amount of memory in megabytes.

Example:

Df: This utility reports the free disk space(Hard Disk) on all the file systems

Syntax: df [OPTION]... [FILE]...


Description:

Option Use
-a If you want to display all the file system.
-h Display size in power of 1024.
-H Display sizes in power of 1000.

Example:

Fundamentals of Operating System Page | 18


Top: Details on all Active Processes

Syntax: $top [OPTION]

Description:

Option Use
-s Use top in Secure mode.
-b Send output from top to file or any other programs.
-c The command starts top with last closed state.

Example:

Ps: To check all the processes running under a user, use the command.

Syntax: ps [options]

Description:

Option Use
-T View all processes associated with this terminal.
-r View all the running processes.
-x View all processes owned by you.

Example:

Fundamentals of Operating System Page | 19


Kill: To use these utilities you need to know the PID (process id) of the process you want to
kill

Syntax: $kill -l
Description:

Option Use

pid To show how to use a PID with the kill command.


-s To show how to send signal to processes.
-L This command is used to list available signals in a table format.

Example:

Fundamentals of Operating System Page | 20


Practical 3

Aim: Write a program using the following system calls of UNIX operating system: fork,
exec, getpid, exit, wait.

Code:

#include<stdio.h>
#include<unistd.h>
#include<sys/types.h>
#include<sys/wait.h>
#include<stdlib.h>

void main()
{
int p;
int status;
p=fork();
printf("PID BEFORE fork: %u\n",getpid());
if(p==0)
{
printf("For Child process: \n");
printf("PID of child process: %u\n",getpid());
printf("PPID of child process: %u\n",getppid());
execl("/bin/ls","ls","-l",(char*)0);
_exit(1);
}
else
{
printf("For Parent process: \n");
printf("PID of parent process: %u\n",getpid());
printf("PPID of parent process: %u\n",getppid());
wait(&status);
}

if(p==-1)
{
printf("Can't fork");
_exit(1);
}
}

Output:

Fundamentals of Operating System Page | 21


Fundamentals of Operating System Page | 22

You might also like