This ppt contains basic concepts of operating system such as evolution of operating system, functions of operating system , introduction to LINUX OS and basic shell commands.
2. WHAT IS OPERATING SYSTEM ?
• Operating System lies in the category of system software. It basically manages
all the resources of the computer.
• An operating system acts as an interface between the software and different
parts of the computer or the computer hardware.
• The operating system is designed in such a way that it can manage the overall
resources and operations of the computer.
• Operating System is a fully integrated set of specialized programs that handle
all the operations of the computer. It controls and monitors the execution of all
other programs that reside in the computer, which also includes application
programs and other system software of the computer. Examples of Operating
Systems are Windows, Linux, Mac OS, etc.
• An Operating System (OS) is a collection of software that manages computer
hardware resources and provides common services for computer programs. The
operating system is the most important type of system software in a computer
system.
3.
4. EXAMPLES OF OPERATING SYSTEMS
• Windows (GUI-based, PC)
• GNU/Linux (Personal, Workstations, ISP, File, and
print server, Three-tier client/Server)
• macOS (Macintosh), used for Apple’s personal
computers and workstations (MacBook, iMac).
• Android (Google’s Operating System for
smartphones/tablets/smartwatches)
• iOS (Apple’s OS for iPhone, iPad, and iPod Touch)
5. WHAT IS AN OPERATING SYSTEM USED FOR?
• The operating system helps in improving the computer software as well as
hardware. Without OS, it became very difficult for any application to be user-
friendly.
• The Operating System provides a user with an interface that makes any
application attractive and user-friendly. The operating System comes with a
large number of device drivers that make OS services reachable to the hardware
environment.
• Each and every application present in the system requires the Operating System.
The operating system works as a communication channel between system
hardware and system software.
• The operating system helps an application with the hardware part without
knowing about the actual hardware configuration. It is one of the most important
parts of the system and hence it is present in every device, whether large or
small device.
6. OS ACTS AS MEDIUM BETWEEN HARDWARE
AND APPLICATION PROGRAMS
7. EVOLUTION OF OPERATING SYSTEMS
• First Generation (1945-1955)
• It is the beginning of the development of
electronic computing systems which are
substitutes for mechanical computing systems.
Because of the drawbacks in mechanical
computing systems like, the speed of humans to
calculate is limited and humans can easily make
mistakes. In this generation there is no operating
system, so the computer system is given
instructions which must be done directly.
• Example − Types of operating systems and
devices used is Plug Boards.
8. Second Generation (1955-1965)
The Batch operating system was introduced in the second
generation, where a job or a task that can be done in a
series, and then executed sequentially. In this
generation, the computer system is not equipped with
an operating system, but several operating system
functions exist like FMS and IBSYS.
Example − Type of operating system and devices used
is Batch systems.
9. Third Generation (1965-1980)
The development of the operating system was developed
to serve multiple users at once in the third generation.
Here the interactive users can communicate through an
online terminal to a computer, so the operating system
becomes multi-user and multiprogramming.
Example − Type of operating system and devices used is
Multiprogramming.
10. Fourth Generation (1980-Now)
In this generation the operating system is used for computer
networks where users are aware of the existence of computers that
are connected to one another.
At this generation users are also comforted with a Graphical User
Interface (GUI) which is an extremely comfortable graphical computer
interface, and the era of distributed computing has also begun.
With the occurrence of new wearable devices like Smart Watches,
Smart Glasses, and others, the demand for conventional operating
systems has also increased.
And, with the onset of new devices like wearable devices, which
includes Smart Watches, Smart Glasses, etc, the demand for
unconventional operating systems is also rising.
Example − Type of operating system and devices used is personal
computers
12. MEMORY MANAGEMENT
• The operating system manages the Primary Memory or Main
Memory. Main memory is made up of a large array of bytes or
words where each byte or word is assigned a certain address.
• Main memory is fast storage and it can be accessed directly by
the CPU. For a program to be executed, it should be first loaded
in the main memory.
• An operating system manages the allocation and deallocation
of memory to various processes and ensures that the other
process does not consume the memory allocated to one
process.
13. Operating System performs the following activities
for memory management:
•It keeps track of primary memory, i.e., which bytes of memory
are used by which user program. The memory addresses that
have already been allocated and the memory addresses of the
memory that has not yet been used.
•In multiprogramming, the OS decides the order in which
processes are granted memory access, and for how long.
•It Allocates the memory to a process when the process
requests it and deallocates the memory when the process has
terminated or is performing an I/O operation.
14. PROCESSOR MANAGEMENT
• In a multi-programming environment, the OS decides the order in
which processes have access to the processor, and how much
processing time each process has. This function of OS is
called Process Scheduling.
An Operating System performs the following activities
for Processor Management.
• An operating system manages the processor’s work by allocating
various jobs to it and ensuring that each process receives enough
time from the processor to function properly.
Keeps track of the status of processes.
• The program which performs this task is known as a traffic
controller. Allocates the CPU that is a processor to a process.
De-allocates processor when a process is no longer required.
15. DEVICE MANAGEMENT
• An OS manages device communication via its respective drivers.
It performs the following activities for device management.
• Keeps track of all devices connected to the system.
• designates a program responsible for every device known as the
Input/Output controller.
• Decide which process gets access to a certain device and for
how long. Allocates devices effectively and efficiently.
• Deallocates devices when they are no longer required. There are
various input and output devices.
• an OS controls the working of these input-output devices. It
receives the requests from these devices,
• performs a specific task, and communicates back to the
requesting process.
16. FILE MANAGEMENT
• A file system is organized into directories for efficient or easy
navigation and usage. These directories may contain other
directories and other files.
• An Operating System carries out the following file management
activities. It keeps track of where information is stored,
• user access settings, the status of every file, and more. These
facilities are collectively known as the file system.
• An OS keeps track of information regarding the creation, deletion,
transfer, copy, and storage of files in an organized way.
• It also maintains the integrity of the data stored in these files,
including the file directory structure, by protecting against
unauthorized access.
17. SECURITY MANAGEMENT
• The operating system uses password protection to protect user
data and similar other techniques.
• it also prevents unauthorized access to programs and user data.
• The operating system provides various techniques which assure
the integrity and confidentiality of user data.
The following security measures are used to protect user data:
• Protection against unauthorized access through login.
• Protection against intrusion by keeping the firewall active.
• Protecting the system memory against malicious access.
• Displaying messages related to system vulnerabilities.
18. ERROR-DETECTING AIDS
• The operating system constantly monitors the system to
detect errors and avoid malfunctioning computer systems.
• From time to time, the operating system checks the system
for any external threat or malicious software activity.
• It also checks the hardware for any type of damage. This
process displays several alerts to the user so that the
appropriate action can be taken against any damage caused
to the system.
19. VIRTUAL MACHINES
• A virtual machine (VM) is a software-based emulation of a
physical computer. It allows you to run multiple operating
systems on a single physical machine, enabling greater
flexibility, resource utilization, and isolation.
• Virtualization technology is widely used in data centers,
development environments, and testing scenarios.
20. VIRTUAL MACHINES WITH AN EXAMPLE:
1. Hypervisor:
• A hypervisor, also known as a Virtual Machine Monitor
(VMM), is a crucial component that manages and allocates
resources for virtual machines. There are two types of
hypervisors:
• Type 1 (bare-metal) runs directly on the hardware, while
• Type 2 (hosted) runs on top of an operating system.
2. Virtualization Layer:
• The virtualization layer abstracts the physical hardware and
creates virtual resources that can be allocated to virtual
machines. This layer is managed by the hypervisor.
21. 3. Virtual Machines:
•Virtual machines are instances of emulated computers
running on a host machine.
•Each VM has its own virtual hardware, including a virtual
CPU, memory, storage, and network interfaces.
22. Example:
•Let's say you have a powerful server with a hypervisor
installed, such as VMware vSphere (a popular Type 1
hypervisor). You want to run multiple operating systems on
this server.
•Step 1: Hypervisor Installation
• Install the hypervisor on the physical server.
•Step 2: Virtual Machine Creation
• Use the hypervisor's management interface to create
virtual machines. For example, you decide to create
two VMs: one running Windows Server and another
running Linux.
•Step 3: Resource Allocation
• Specify the amount of CPU cores, RAM, and storage
each VM should have. The hypervisor ensures that
these resources are isolated and allocated to the
respective VMs.
23. Step 4: Operating System Installation
•Install the operating systems (Windows Server and Linux) on each virtual
machine as if they were running on physical hardware.
Step 5: Running Multiple OSes Simultaneously
•Now, you can run both virtual machines simultaneously on the same physical
server. Each VM operates independently, and the hypervisor ensures that they
don't interfere with each other.
Benefits of Virtual Machines:
•Isolation: VMs are isolated from each other, preventing one VM from affecting
others.
•Resource Utilization: Multiple VMs can share the same physical resources efficiently.
•Flexibility: VMs can be easily moved, copied, or modified, providing flexibility in
managing and deploying software.
Virtual machines are a fundamental technology in modern computing, providing a
versatile and efficient way to utilize hardware resources.
24. INTRODUCTION TO LINUX OS
• Linux is an operating system, similar to Windows or macOS,
but it's open-source, meaning that its source code is freely
available for anyone to view, modify, and distribute.
1.What is Linux?
• Linux is an operating system, the software that manages all
the hardware and software resources on your computer. It's
part of a family of free and open-source operating systems
based on the Linux kernel.
2.Open Source:
• Linux is open source, which means that its source code is
accessible to everyone. This encourages collaboration and
allows users to customize and improve the system.
25. 3.Distributions (Distros):
• Different versions of Linux are packaged and distributed by
various organizations or communities. These versions are
called distributions or distros. Examples include Ubuntu,
Fedora, and Debian.
4.Graphical User Interface (GUI) vs. Command Line Interface
(CLI):
• Linux provides both a graphical desktop environment
(similar to Windows or macOS) and a command-line
interface (text-based). Users can choose the interface that
suits them best.
5. Multitasking and Multiuser:
• Linux supports multitasking, allowing you to run multiple
applications simultaneously. It's also a multiuser system,
meaning multiple users can log in and use the system
concurrently.
26. 6. File System:
• Linux uses a hierarchical file system, organizing files and
directories in a tree-like structure. The root directory ("/")
is the top-level directory.
7. Terminal and Commands:
• The command-line interface, accessed through a terminal,
allows users to interact with the system using commands.
Commands are typed in text form to perform various tasks
like file manipulation, system configuration, and software
installation.
8. Package Management:
• Linux uses package management systems to install,
update, and remove software. Users can easily install new
applications and keep the system up to date using package
managers like apt, yum, or dnf.
27. 9. Security:
1. Linux is known for its security features. Users operate with
different levels of permissions, and the system has robust
security mechanisms to protect against malware and
unauthorized access.
10. Servers and Embedded Systems:
1. Linux is widely used for servers, running the backbone of the
internet and hosting various services. It's also prevalent in
embedded systems, like routers and smart devices.
In summary, Linux is an open-source operating system that provides
users with a choice of interfaces, powerful command-line
capabilities, and a robust and secure environment. It's versatile and
used in various applications, from personal computers to servers
and embedded systems.
29. 1. Kernel:
Kernel is the main core component if Linux, it controls the
activity of other hardware components.
It visualizes the common hardware resources and provide
each process with necessary virtual resources.
It makes the process to wait in the ready queue and
execute in consequently to avoid any kind of conflict.
30. 2. System Library:
System libraries are some predefined functions by using which any
application programs or system utilities can access kernel’s
features. These libraries are the foundation upon which any
software can be built.
Some of the most common system libraries are:
1.GNU C library: This is the C library that provides the most
fundamental system for the interface and execution of C programs.
This provides may in-built functions for the execution.
2.libpthread (POSIX Threads): This library plays important role
for multithreading in Linux, it allows users for creating and
managing multiple threads.
3.libdl (Dynamic Linker): This library is responsible for the loading
and linking file at the runtime.
4.libm (Math Library): This library provides user with all kind of
mathematical function and their execution.
31. 3. Shell: It is an interface among the kernel and user. It can afford the services of
kernel. It can take commands through the user and runs the functions of the
kernel.
The shell is available in distinct types of OSes. These operating systems are
categorized into two different types, which are the graphical shells and command-
line shells.
The graphical line shells facilitate the graphical user interface, while the command
line shells facilitate the command line interface. Thus, both of these shells
implement operations. However, the graphical user interface shells work slower as
compared to the command-line interface shells.
There are a few types of these shells which are categorized as follows:
•Korn shell
•Bourne shell
•C shell
•POSIX shell
32. 4. Hardware Layer:
Hardware layer of Linux is the lowest level of operating
system track.
It is plays a vital role in managing all the hardware
components.
It includes device drivers, kernel functions, memory
management, CPU control, and I/O operations.
This layer generalizes hard complexity, by providing an
interface for software by assuring proper functionality of all
the components.
33. 5. System utility:
System utilities are the command line tools that
preforms various tasks provided by user to make system
management and administration better.
These utilities enables user to perform different tasks,
such as file management, system monitoring, network
configuration, user management etc.
34. BASH SHELL SCRIPTING
• Bash Script:
• A Bash Shell Script is a plain text file containing a set of
various commands that we usually type in the command
line. It is used to automate repetitive tasks on Linux
filesystem. It might include a set of commands, or a single
command, or it might contain the hallmarks of imperative
programming like loops, functions, conditional constructs,
etc. Effectively, a Bash script is a computer program written
in the Bash programming language.
35. HOW TO CREATE AND RUN A BASH SCRIPT?
1. Create the Bash Script:
• Open a text editor (like nano, vim, emacs, or even a
graphical text editor like gedit).
• Write your Bash script in the editor. For example, let's
create a simple script named myscript.sh:
#!/bin/bash
echo "Hello, this is my Bash script!“
• Save file with .sh extension (myscript.sh)
36. 2. MAKE THE SCRIPT EXECUTABLE:
• In order to run the script, you need to make it executable. Open a terminal and
use the chmod command:
• chmod +x myscript.sh
• In the context of the chmod command, the +x flag is used to add the execute
permission to a file. Here's what each part of the command means:
• chmod: This is the command to change file permissions in Unix-like operating
systems.
• +x: This flag specifies that you want to add the execute permission. The letter
x stands for execute.
• myscript.sh: This is the name of the file for which you want to modify
permissions.
So, chmod +x myscript.sh means you are adding execute permission to the file
37. 3.RUN THE BASH SCRIPT:
• You can now execute your script using ./ followed by the script name:
./myscript.sh
• Alternative Ways to Run the Script:
you can also run the script using the bash command:
bash myscript.sh
• Or by using the source command:
source myscript.sh
38. BASH COMMANDS
1. Echo and Variables:
# Echo command
echo "Hello,World!"
#Variables
name="John"
echo "My name is $name"
39. 2. USER INPUT
• # Reading user input
• echo -n "Enter your name: "
• read username
• echo "Hello, $username!"
40. 3. CONDITIONAL STATEMENTS (IF-ELSE):
• # Conditional statement
• if [ "$name" == "John" ]; then
• echo "You are John."
• else
• echo "You are not John."
• fi
41. 4. LOOPS (FOR LOOP):
• # Conditional statement
• if [ "$name" == "John" ]; then
• echo "You are John."
• else
• echo "You are not John."
• fi
43. 6. CONDITIONAL STATEMENTS
(CASE): *)
echo "Unknown fruit."
;;
esac
# Case statement
fruit="apple“
case $fruit in
"apple")
echo "It's an apple."
;;
"banana")
echo "It's a banana."
;;
44. 7.FILE OPERATIONS:
• # Creating a file
touch newfile.txt
• # Writing to a file
echo "This is some text." > newfile.txt
• # Appending to a file
echo "More text." >> newfile.txt
• # Reading from a file
content=$(cat newfile.txt)
echo "File content: $content"
45. • Redirect to a File (>):
The > operator is used to redirect standard output to a file. If the
file doesn't exist, it will be created. If it already exists, its contents
will be overwritten.
command > output.txt
• Append to a File (>>):
The >> operator is similar to >, but it appends the output to the
end of the file instead of overwriting the file.
command >> output.txt