Chapter 5
Chapter 5
Table of Contents
Chapter five ........................................................................................................................................ 3
1 Operating systems overview ....................................................................................................... 3
1.1 Introduction to operating system :( DOS, WINDOWS, UNIX, LINUX) ............................ 3
1.1.1 Definition .................................................................................................................... 3
1.2 Function of Operating system ............................................................................................. 4
1.2.1 Major Functions of Operating System: ........................................................................ 4
1.3 Types of Operating system .................................................................................................. 6
1.3.1 Batch operating system ............................................................................................... 6
1.3.2 Time-sharing operating systems .................................................................................. 6
Homework .................................................................................................................................. 7
1.3.3 Distributed operating System ...................................................................................... 7
1.3.4 Network operating System .......................................................................................... 7
1.3.5 Single user operating system ....................................................................................... 8
1.3.6 Multi user operating system ........................................................................................ 8
1.3.7 Real time operating system ......................................................................................... 8
1.3.8 Multitasking operating system..................................................................................... 8
1.3.9 Multiprogramming ...................................................................................................... 9
Advantages ............................................................................................................................... 11
Disadvantages ........................................................................................................................... 11
2 Graphical user interface as Windows operating system ........................................................... 12
3 Character user interface as DOS ............................................................................................... 14
3.1 MS-DOS system files:....................................................................................................... 14
3.2 Internal and External MS-DOS Command ........................................................................ 14
4 UNIX operating system ............................................................................................................ 19
4.1 Features of UNIX Operating System: ............................................................................... 19
4.2 The structure of Unix OS Layers are as follows:............................................................... 21
4.2.1 Layer-1: Hardware - .................................................................................................. 21
4.2.2 Layer-2: Kernel - ....................................................................................................... 22
4.2.3 Layer-3: The Shell - .................................................................................................. 23
4.2.4 Types of Shell in UNIX System: ............................................................................... 23
4.2.5 Layer-4: Application Programs Layer - ..................................................................... 24
5 LINUX ...................................................................................................................................... 24
5.1 Evolution of Linux OS ...................................................................................................... 24
5.2 Structure Of Linux Operating System ............................................................................... 24
5.3 1) Kernel ........................................................................................................................... 25
5.4 2) System Libraries ........................................................................................................... 26
2078 1 upendra malla
Introduction an Operating system
5.5 3) System Tools ................................................................................................................ 27
5.6 4) Development Tools ....................................................................................................... 27
5.7 5) End User Tools ............................................................................................................. 27
5.8 Why use Linux? ................................................................................................................ 27
5.8.1 Free & Open Source Operating System ..................................................................... 28
5.8.2 It is secure ................................................................................................................. 28
5.8.3 Favorable choice of Developers ................................................................................ 28
5.8.4 A flexible operating system ....................................................................................... 29
5.9 Linux Distributions ........................................................................................................... 29
5.10 How does Linux work? ..................................................................................................... 29
5.11 How to use Linux? ............................................................................................................ 29
The operating system is a system program that serves as an interface between the computing system
and the end-user. Operating systems create an environment where the user can run any programs or
communicate with software or applications in a comfortable and well-organized way.
Furthermore, an operating is a software program that manages and controls the execution of
application programs, software resources and computer hardware. It also helps manage the
software/hardware resource, such as file management, memory management, input/ output and many
peripheral devices like a disk drive, printers, etc. These are the popular operating system: Linux
OS, Windows OS, Mac OS, VMS, OS/400 etc
An Operating System (OS) is an interface between a computer user and computer hardware. An
operating system is a software which performs all the basic tasks like file management, memory
management, process management, handling input and output, and controlling peripheral devices
such as disk drives and printers.
Some popular Operating Systems include Linux Operating System, Windows Operating System,
VMS, OS/400, AIX, z/OS, etc
5.1.1 Definition
An operating system is a program that acts as an interface between the user and the computer
hardware and controls the execution of all kinds of programs.
Some popular Operating Systems include Linux Operating System, Windows Operating System,
2078 1 upendra malla
Introduction an Operating system
VMS, OS/400, AIX, z/OS, etc.
o Run software applications: It offers the environment to run or use software applications
developed to perform specific tasks, for example, Ms Word, Ms Excel, Photoshop, etc.
o Data management: It helps in data management by offering and displaying directories for
data management. You can view and manipulate files, folders, e.g., you can move, copy,
name, or rename, delete a file or a folder.
o Evaluates the system's health: It gives us an idea about the performance of the hardware of
the system. For example, you can see how busy the CPU is, how fast the data is retrieved
from the hard disk, etc.
o Provides user interface: It acts as an interface between the user and the hardware. It can be
a GUI where you can see and click elements on the screen to perform various tasks. It
enables you to communicate with the computer even without knowing the computer's
language.
o I/O management: It manages the input output devices and makes the I/O process smooth
and effective. For example, it receives the input provided by the user through an input
device and stores it in the main memory. Then it directs the CPU to process this input and
accordingly provides the output through an output device such as a monitor.
o Security: It has a security module to protect the data or information stored in the memories
of the computer against malware and unauthorized access. Thus, it not only manages your
data but also helps to protect it.
o Time Management: It helps CPU in time management. The Kernel OS keeps checking the
frequency of processes that requests CPU time. When two or more processes that are equally
important compete for the CPU time, then the CPU time is sliced into segments and
allocated to these processes in a round-robin fashion to prevent a single process from
monopolizing the CPU.
o Deadlock Prevention: Sometimes a resource that is supposed to be shared by two or more
processes is held by one process due to which the resource cannot continue. This situation is
known as deadlock. The OS does not let this situation arise by carefully distributing the
resources among the different processes.
o Interrupt Handling: OS also responds to interrupts, which are signals generated by a
program or a device to seek the attention of the CPU. The OS checks the priority of the
interrupt, and if it is more important than the currently running process, it stops the
execution of the current process and preserves this state of CPU then executes the requested
process. Thereafter the CPU returns to the same state where it was stopped.
Problem of reliability.
Question of security and integrity of user programs and data.
2078 1 upendra malla
Introduction an Operating system
Problem of data communication.
Homework
1. What is an operating system? List the function of operating system.
2. What is batch operating system? Write example of batch operating system.
3. What is time sharing operating system?
With resource sharing facility, a user at one site may be able to use the resources available at
another.
Speedup the exchange of data with one another via electronic mail.
If one site fails in a distributed system, the remaining sites can potentially continue
operating.
Better service to the customers.
Reduction of the load on the host computer.
Reduction of delays in data processing.
5.3.9 Multiprogramming
Sharing the processor, when two or more programs reside in memory at the same time, is referred
as multiprogramming. Multiprogramming assumes a single shared processor. Multiprogramming
increases CPU utilization by organizing jobs so that the CPU always has one to execute. Example:
windows, Mac, linux etc.
The following figure shows the memory layout for a multiprogramming system.
5.3.10 Multithreading
A program in execution in known as processes. A process can be further divided into multiple sub
processers. These sub processors are known as threads. A multi-threading OS can divide process into
threads and execute those threads. This increases operating speed but also increases the complexity.
For example: UNIX, server edition or Linux and windows.
Advantages
Disadvantages
In other sides, we are categories into two of Operating system according to the interface and user
frequently. They are:
a) Graphical user interface
b) Character user interface
h. Browser
i. Word processing
j. Windows security
k. Firewall
2078 1 upendra malla
Introduction an Operating system
l. Desktop
m. Disk defragment / disk clean up
i) Working in desktop application and window environment
ii) Managing filing and folders with file explorer
iii) Installing and removing other software
iv) Manage passwords privacy levels
v) Use of control panel, system tools and accessories.
1.CLS
To clear the screen.
Syntax:
[drive name]/cls
Example:
C:\desktop\cls
2.DIR
To display the all directories.
Syntax:
[drive name]:\ dir
Example:
C:\dir
2078 1 upendra malla
Introduction an Operating system
3. MD
To make a directory
Syntax:
[drive name]:\MD [directory name]
Example
C:\MD Himal
4. CD
To change the directory location
Syntax:
[Drive name]:\cd [drive name]
Example :
C:\cd D:
5. Copy con
To create a new file.
Syntax:
[drive name]:\ copy con [file name]
Example:
C:\ copy con dinesh.txt
For saving file “CTRL + z
6. Type
To read the information in a file.
Syntax:
[drive name]:\ type [file name]
Example:
C:\type dinesh.txt
7. Format
To format the any selected drive.
Syntax:
[drive name]:\ format [drive name]
Example:
C:\ format d:
8. Del
To delete the selected file or directory
Syntax:
[drive name]:\ del [file name]
Example:
C:\ del dinesh.txt
9. ATTRIB
10. TREE
11. XCOPY
12. EXIT
13. VOL
http://www.ordiecole.com/html/ms-dos_commands.pdf
TIME
Displays current time and allows it to be changed.
Syntax:
TIME
DATE
Displays current date and allows it to be changed.
Syntax:
DATE
CLS
Clears the screen.
Syntax:
CLS
DIR
Shows directory information of a diskette: name, size, and the date and time stamp of files.
Syntax:
DIR [d:][path]
Optional switches:
/p Display dir info and pauses display when the screen is full
/w Display names and extensions only in five columns
COPY
Copies a file. Name of copy may be the same as original, or different. Syntax:
COPY [d:][path][name.ext] [d:][path][name.ext]
Optional switches:
/v Verify, copies the file and compares it with the original
2078 1 upendra malla
Introduction an Operating system
/b Binary file
TYPE
Displays the contents of a file.
Syntax:
TYPE [d:][path][name.ext]
DEL
Deletes a file from disk.
Syntax:
DEL [d:][path][name.ext]
REN
Renames a file.
Syntax:
REN [d:][path][name.ext] [d:][path][newname.ext]
MD
Makes (creates) a new directory.
Syntax:
MD [d:][path][dirname]
RD
Removes an existing directory (directory must be empty).
Syntax:
RD [d:][path][dirname]
2078 1 upendra malla
Introduction an Operating system
CD
Changes the current directory.
Syntax:
CD [path][dirname]
UNIX is a powerful Operating System initially developed by Ken Thompson, Dennis Ritchie at
AT&T Bell laboratories in 1970. It is prevalent among scientific, engineering, and academic
institutions due to its most appreciative features like multitasking, flexibility, and many more. In
UNIX, the file system is a hierarchical structure of files and directories where users can store and
retrieve information using the files.
Multitasking: A UNIX operating system is a multitasking operating system that allows you to
initiate more than one task from the same terminal so that one task is performed as a foreground and
the other task as a background process.
Multi-user: UNIX operating system supports more than one user to access computer resources like
main memory, hard disk, tape drives, etc. Multiple users can log on to the system from different
terminals and run different jobs that share the resources of a command terminal. It deals with the
principle of time-sharing. Time-sharing is done by a scheduler that divides the CPU time into several
segments also called a time slice, and each segment is assigned to each user on a scheduled basis.
This time slice is tiny. When this time is expired, it passes control to the following user on the
system. Each user executes their set of instructions within their time slice.
Portability: This feature makes the UNIX work on different machines and platforms with the easy
transfer of code to any computer system. Since a significant portion of UNIX is written in C
language, and only a tiny portion is coded in assembly language for specific hardware.
File Security and Protection: Being a multi-user system, UNIX makes special consideration for file
and system security. UNIX has different levels of security using assigning username and password
to individual users ensuring the authentication, at the level providing file access permission viz. read,
write and execute and lastly file encryption to change the file into an unreadable format.
Command Structure: UNIX commands are easy to understand and simple to use. Example: "cp",
mv etc. While working in the UNIX environment, the UNIX commands are case-sensitive and are
entered in lower case.
Open Source: UNIX operating system is open source it means it is freely available to all and is a
community-based development project.
Accounting: UNIX keeps an account of jobs created by the user. This feature enhances the system
performance in terms of CPU monitoring and disk space checking. It allows you to keep an account
of disk space used by each user, and the disk space can be limited by each other. You can assign
every user a different disk quota. The root user can perform these accounting tasks using various
commands such as quota, df, du, etc.
UNIX Tools and Utilities: UNIX system provides various types of tools and utilities facilities such
as UNIX grep, sed and awk, etc. Some of the general-purpose tools are compilers, interpreters,
network applications, etc. It also includes various server programs which provide remote and
administration services.
While working with UNIX OS, several layers of this system provide interaction between the pc
hardware and the user. Following is the description of each and every layer structure in UNIX
system:
This layer of UNIX consists of all hardware-related information in the UNIX environment.
The core of the operating system that's liable for maintaining the full functionality is named the
kernel. The kernel of UNIX runs on the particular machine hardware and interacts with the hardware
effectively.
It also works as a device manager and performs valuable functions for the processes which require
access to the peripheral devices connected to the computer. The kernel controls these devices
through device drivers.
The kernel also manages the memory. Processes are executed programs that have owner's humans or
systems who initiate their execution.
The system must provide all processes with access to an adequate amount of memory, and a few
processes require a lot of it. To make effective use of main memory and to allocate a sufficient
amount of memory to every process. It uses essential techniques like paging, swapping, and virtual
storage.
The Shell is an interpreter that interprets the command submitted by the user at the terminal, and
calls the program you simply want.
It also keeps a history of the list of the commands you have typed in. If you need to repeat a
command you typed it, use the cursor keys to scroll up and down the list or type history for a list of
previous commands. There are various commands like cat, mv, cat, grep, id, wc, and many more.
o Bourne Shell: This Shell is simply called the Shell. It was the first Shell for UNIX OS. It is
still the most widely available Shell on a UNIX system.
o C Shell: The C shell is another popular shell commonly available on a UNIX system. The C
shell was developed by the University of California at Berkeley and removed some of the
shortcomings of the Bourne shell.
o Korn Shell: This Shell was created by David Korn to address the Bourne Shell's user-
interaction issues and to deal with the shortcomings of the C shell's scripting quirks.
It is the outermost layer that executes the given external applications. UNIX distributions typically
come with several useful applications programs as standard. For Example: emacs editor, StarOffice,
xv image viewer, g++ compiler etc
9 LINUX
Linux is an open-source operating system like other operating systems such as Microsoft Windows,
Apple Mac OS, iOS, Google android, etc. An operating system is a software that enables the
communication between computer hardware and software. It conveys input to get processed by the
processor and brings output to the hardware to display it. This is the basic function of an operating
system. Although it performs many other important tasks, let's not talk about that.
Linux is around us since the mid-90s. It can be used from wristwatches to supercomputers. It is
everywhere in our phones, laptops, PCs, cars and even in refrigerators. It is very much famous
among developers and normal computer users.
The Linux OS was developed by Linus Torvalds in 1991, which sprouted as an idea to improve the
UNIX OS. He suggested improvements but was rejected by UNIX designers. Therefore, he thought
of launching an OS, designed in a way that could be modified by its users.
Nowadays, Linux is the fastest-growing OS. It is used from phones to supercomputers by almost all
major hardware devices.
9.3 1) Kernel
Linux kernel is the core part of the operating system. It establishes communication between devices
and software. Moreover, it manages system resources. It has four responsibilities:
o device management: A system has many devices connected to it like CPU, a memory
device, sound cards, graphic cards, etc. A kernel stores all the data related to all the devices
in the device driver (without this kernel won't be able to control the devices). Thus kernel
knows what a device can do and how to manipulate it to bring out the best performance. It
also manages communication between all the devices. The kernel has certain rules that have
to be followed by all the devices.
o Memory management: Another function that kernel has to manage is the memory
management. The kernel keeps track of used and unused memory and makes sure that
processes shouldn't manipulate data of each other using virtual memory addresses.
o Process management: In the process, management kernel assigns enough time and gives
priorities to processes before handling CPU to other processes. It also deals with security
and ownership information.
o Handling system calls: Handling system calls means a programmer can write a query or ask
the kernel to perform a task.
System libraries are special programs that help in accessing the kernel's features. A kernel has to be
triggered to perform a task, and this triggering is done by the applications. But applications must
know how to place a system call because each kernel has a different set of system calls.
Programmers have developed a standard library of procedures to communicate with the kernel. Each
2078 1 upendra malla
Introduction an Operating system
operating system supports these standards, and then these are transferred to system calls for that
operating system.
The most well-known system library for Linux is Glibc (GNU C library).
Linux OS has a set of utility tools, which are usually simple commands. It is a software which GNU
project has written and publish under their open source license so that software is freely available to
everyone.
With the help of commands, you can access your files, edit and manipulate data in your directories
or files, change the location of files, or anything.
With the above three components, your OS is running and working. But to update your system, you
have additional tools and libraries. These additional tools and libraries are written by the
programmers and are called toolchain. A toolchain is a vital development tool used by the
developers to produce a working application.
These end tools make a system unique for a user. End tools are not required for the operating system
but are necessary for a user.
Some examples of end tools are graphic design tools, office suites, browsers, multimedia players,
etc.
This is one of the most asked questions about Linux systems. Why do we use a different and bit
complex operating system, if we have a simple operating system like Windows? So there are
various features of Linux systems that make it completely different and one of the most used
operating systems. Linux may be a perfect operating system if you want to get rid of viruses,
malware, slowdowns, crashes, costly repairs, and many more. Further, it provides
various advantages over other operating systems, and we don't have to pay for it. Let's have a look at
some of its special features that will attract you to switch your operating system.
Most OS come in a compiled format means the main source code has run through a program called a
compiler that translates the source code into a language that is known to the computer.
On the other hand, open-source is completely different. The source code is included with the
compiled version and allows modification by anyone having some knowledge. It gives us the
freedom to run the program, freedom to change the code according to our use, freedom to
redistribute its copies, and freedom to distribute copies, which are modified by us.
In short, Linux is an operating system that is "for the people, by the people."
And we can dive in Linux without paying any cost. We can install it on Multiple machines without
paying any cost.
9.8.2 It is secure
Linux supports various security options that will save you from viruses, malware, slowdowns,
crashes. Further, it will keep your data protected. Its security feature is the main reason that it is the
most favorable option for developers. It is not completely safe, but it is less vulnerable than others.
Each application needs to authorize by the admin user. The virus cannot be executed until the
administrator provides the access password. Linux systems do not require any antivirus program.
Linux is suitable for the developers, as it supports almost all of the most used programming
languages such as C/C++, Java, Python, Ruby, and more. Further, it facilitates with a vast range of
useful applications for development.
Developers find that the Linux terminal is much better than the Windows command line, So, they
prefer terminal over the Windows command line. The package manager on Linux system helps
programmers to understand how things are done. Bash scripting is also a functional feature for the
programmers. Also, the SSH support helps to manage the servers quickly.
2078 1 upendra malla
Introduction an Operating system
Linux is a flexible OS, as, it can be used for desktop applications, embedded systems, and server
applications. It can be used from wristwatches to supercomputers. It is everywhere in our phones,
laptops, PCs, cars and even in refrigerators. Further, it supports various customization options.
Many agencies modified the Linux operating system and makes their Linux distributions. There are
many Linux distributions available in the market. It provides a different flavor of the Linux
operating system to the users. We can choose any distribution according to our needs. Some popular
distros are Ubuntu, Fedora, Debian, Linux Mint, Arch Linux, and many more.
For the beginners, Ubuntu and Linux Mint are considered useful and, for the proficient developer,
Debian and Fedora would be a good choice. To Get a list of distributions, visit Linux Distributions.
Linux is a UNIX-like operating system, but it supports a range of hardware devices from phones to
supercomputers. Every Linux-based operating system has the Linux kernel and set of software
packages to manage hardware resources.
Also, Linux OS includes some core GNU tools to provide a way to manage the kernel resources,
install software, configure the security setting and performance, and many more. All these tools are
packaged together to make a functional operating system.
We can use Linux through an interactive user interface as well as from the terminal (Command Line
Interface). Different distributions have a slightly different user interface but almost all the commands
will have the same behavior for all the distributions. To run Linux from the terminal, press the
"CTRL+ALT+T" keys. And, to explore its functionality, press the application button given on the
left down corner of your desktop.