Pook
Pook
College of Computer
Laboratory Manual
Laboratory Manual Operating Systems (CS222)
Lab Page 2
Objective:
To understand the operating system concepts such as multi-threading, multi-tasking,
multi-user’s, and GUI and with an example for each.
● Operating system
An operating system, or OS, is a software program that enables the computer
hardware to communicate and operate with the computer software. In other words, it
is a software that enables the interaction between hardware and software. Without a
computer operating system, a computer would be useless.
1. GUI - Short for Graphical User Interface, a GUI Operating System contains
graphics and icons and is commonly navigated by using a computer mouse or by
touch. Below are some examples of GUI Operating Systems:
1) macOS
2) Windows
College of Computer
Laboratory Manual Operating Systems (CS222)
Lab Page 3
2. Single-user – One user can effectively do one thing at a time. Example: MS-DOS.
3. Multi-user - A multi-user operating system allows for multiple users to use the
same computer at the same time and/or different times. Below are some examples
of multi-user operating systems:
1) GNU/Linux
2) Unix
3) Windows
4) GNU/Linux
5) Unix
6) Windows
College of Computer
Laboratory Manual Operating Systems (CS222)
Lab Page 4
1) QNX
2) RTLINUX
1) GNU/Linux
2) Unix
3) Windows
1) GNU/Linux
2) Unix
3) Windows
Exercise:
1- Android and iOS are widely used operating systems. What categories of operating
systems do they fall in?
2- Describe three functions or services that are provided by operating systems.
College of Computer
Laboratory Manual Operating Systems (CS222)
Lab Page 5
--------------------------------------------------------------------------------------------------
HW: Do the exercise given and submit your work to the blackboard.
--------------------------------------------------------------------------------------------------
College of Computer
Laboratory Manual Operating Systems (CS222)
Lab Page 6
Lab #2
MS-DOS
(Windows Command Prompt)
Objective:
Method:
Work with MS-DOS OS and type some commands by using Command Line
Interface.
MS-DOS:
College of Computer
Laboratory Manual Operating Systems (CS222)
Lab Page 7
To open a Microsoft MS-DOS command prompt shell window, first click the
Windows Start menu (located at the very lower-left corner of your computer's
desktop) and select "Run...".
Then if you are using Windows XP or Vista or Windows 7, type cmd into the Run
box and click "OK". You could also type cmd.exe
Hello, World!
D:\CS222>echo %PATH%
College of Computer
Laboratory Manual Operating Systems (CS222)
Lab Page 8
● CHKDSK used to scan through your entire hard drive to find and fix problems
C:\Windows\system32>chkdsk
College of Computer
Laboratory Manual Operating Systems (CS222)
Lab Page 9
Examples:
1) MD d1
2) CD d1
3) CD ..
4) TREE
5) RD d1
o Copy in the same location with different name: copy file1.txt file2.txt
o Copy to another location with the same name: copy file1.txt dd
o Copy to another location with different name: copy file1.txt dd\f1.txt
College of Computer
Laboratory Manual Operating Systems (CS222)
Lab Page 10
FIND used to report the location of a specific string of text characters in one or more
files.
3) To count and display the numbers of lines having the text string on the screen.
find “ABC” file1.txt /c
To print the command’s info and help append /h or /? after the name of the command
D:\CS222>comp /?
Compares the contents of two files or sets of files.
College of Computer
Laboratory Manual Operating Systems (CS222)
Lab Page 11
Exercise:
1. Create file using editor and write the following text in this file :
ABC
aBc
abc
----------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------
b) What is the output of this command find “abc” /i /c file1.txt?
----------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------
College of Computer
Laboratory Manual Operating Systems (CS222)
Lab Page 12
---------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------
2. What does the MORE command do? What is the difference between MORE and TYPE?
3. What is the difference between an absolute path and a relative path? Give an
example on each.
--------------------------------------------------------------------------------------------------
HW: Do the exercise given and submit your work to the blackboard.
--------------------------------------------------------------------------------------------------
College of Computer
Laboratory Manual Operating Systems (CS222)
Lab Page 13
Lab #3
GNU Bash
(Shell & General Commands)
Objectives:
To deal with a GNU/Linux Environment
To understand how to use bash
To understand how to type General Commands
Method:
Work with the bash shell and type some commands by using Command Line
Interface.
A GNU/Linux terminal provides access to all the native Linux commands as well as
command-line applications that often provide many more features than desktop
applications.
To achieve the lab task, make sure you have the two software tools below:
● VirtualBox.
College of Computer
Laboratory Manual Operating Systems (CS222)
Lab Page 14
● Launch VirtualBox and click the “New” toolbar icon to open the Create Virtual
Machine dialog.
● Enter a name for the VM image and select the appropriate Type and Version.
● Use the folder icon to browse and locate the Ubuntu 16.04 VDI image
College of Computer
Laboratory Manual Operating Systems (CS222)
Lab Page 15
● Now we can click “Start” in VirtualBox Manager window to start the Ubuntu VM.
College of Computer
Laboratory Manual Operating Systems (CS222)
Lab Page 16
During the lab: You have VirtualBox installed and a Ubuntu image available in
D: drive.
College of Computer
Laboratory Manual Operating Systems (CS222)
Lab Page 17
● Open the Dash by clicking the Ubuntu icon in the upper-left, type "terminal", and
select the Terminal application from the results that appear.
Basic Commands
College of Computer
Laboratory Manual Operating Systems (CS222)
Lab Page 18
5. ls: to know what files are in the directory you are in.
6. cd: to go to a directory. (cd alone without arguments moves you to your home
directory)
9. man, info, and help: to know more about a command and how to use it
example: ”man cd” shows the manual pages of the cd command
College of Computer
Laboratory Manual Operating Systems (CS222)
Lab Page 19
12. locate (or find -name “name of file”: used to locate a file in a Linux
system, just like the search command in Windows
13. clear:
14. exit: quit
College of Computer
Laboratory Manual Operating Systems (CS222)
Lab Page 20
Intermediate Commands
17. sudo and su: stands for "SuperUser Do". If you want any command to be done
with administrative or root privileges, you can use the sudo command
College of Computer
Laboratory Manual Operating Systems (CS222)
Lab Page 21
. Current directory
.. Parent directory
~ Home directory
Exercise:
● Show the output of head and tail on the same text file.
● Display the amount of used and free memory (RAM) in a human readable format.
The commands you need to achieve these tasks are not given in this manual. You are
expected to access external materials to accomplish your exercise.
--------------------------------------------------------------------------------------------------
College of Computer
Laboratory Manual Operating Systems (CS222)
Lab Page 22
HW: Do the exercise given and submit screenshots of your work to the
blackboard.
--------------------------------------------------------------------------------------------------
Lab #4
System Calls
College of Computer