Linux Notes
Linux Notes
OPERATING SYSTEM:
It is a package of Application software, system software and Kernal.
Operating system is a system program that serves as interface between computing system
and end user.
Ex: Windows, ubuntu, MAC OS
Application software:
The term “application software” refers to software that performs specific functions for a
user. When a user interacts directly with a piece of software, it is called application
software.
Ex: MS WORD, EXCEL etc.
System software:
system software is a set of programs that handles all the basic internal working of a computer.
Moreover, it executes and controls all the working of different peripheral devices and other basic
tasks and software.
Ex: compilers, device drivers etc.
Kernal:
It serves as the core of an operating system and the interface between software and hardware.
This means that the kernel is in constant use and is a key component of an operating system.
The kernel not only serves as the core of the system but is also a program that controls all
processor and memory access. It is responsible for the most important drivers and has direct
access to the hardware. It’s the basis for interactions between hardware and software and
manages their resources as efficiently as possible.
EG : Linux
EVOLUTION OF OPERATING SYSTEM
The first operating system used for real work was GM-NAA I/O, produced in 1956
by General Motors' Research division for its IBM 704.
Digital Equipment Corporation created several operating systems for its 16-bit PDP-
11 machines, including the simple RT-11 system, the time-sharing RSTS operating systems,
and the RSX-11 family of real-time operating systems, as well as the VMS system for the 32-
bit VAX machines.
The Unix operating system was developed at AT&T Bell Laboratories in the late 1960s,
originally for the PDP-7, and later for the PDP-11. Because it was essentially free in early
editions, easily obtainable, and easily modified, it achieved wide acceptance. It also became a
requirement within the Bell systems operating companies. Since it was written in the C
language, when that language was ported to a new machine architecture, Unix was also able
to be ported.
Numerous operating systems were based upon it including Minix, GNU/Linux
An OS provides a very easy way to interact with the computer. It provides different features and
GUI so that we can easily work on a computer. We have to interact just by clicking the mouse or
through the keyboard. Thus, we can say that an OS makes working very easy and efficient.
2. Booting
Booting is basically the process of starting the computer. When the CPU is first switched ON it
has nothing inside the memory. So, to start the computer, we load the operating system into the
main memory. Therefore, loading the OS to the main memory to start the computer is booting.
Hence, the Os helps to start the computer when the power is switched ON.
The OS helps to operate the different input/output devices. The OS decides which program or
process can use which device. Moreover, it decides the time for usage. In addition to this, it
controls the allocation and deallocation of devices.
4. Multitasking
The OS helps to run more than one application at a time on the computer. It plays an important
role while multitasking. Since it manages memory and other devices during multitasking.
Therefore, it provides smooth multitasking on the system.
5. Platform for other application software
Users require different application programs to perform specific tasks on the system. The OS
manages and controls these applications so that they can work efficiently. In other words, it acts
as an interface between the user and the applications.
It helps in managing the main memory of the computer. Moreover, It allocates and deallocates
memory to all the applications/tasks.
It helps to manage files on the system. As we know, all the data on the system is in the form of
files. It makes interaction with the files easy.
8. Provides Security
It keeps the system and applications safe through authorization. Thus, the OS provides security
to the system.
9. Acts as an Interface
Advantages of RTOS:
Maximum Consumption: Maximum utilization of devices and system, thus
more output from all the resources
Task Shifting: The time assigned for shifting tasks in these systems are very
less. For example, in older systems, it takes about 10 microseconds in shifting
one task to another, and in the latest systems, it takes 3 microseconds.
Focus on Application: Focus on running applications and less importance to
applications which are in the queue.
Real-time operating system in the embedded system: Since the size of
programs are small, RTOS can also be used in embedded systems like in
transport and others.
Error Free: These types of systems are error-free.
Memory Allocation: Memory allocation is best managed in these types of
systems.
Disadvantages of RTOS:
Limited Tasks: Very few tasks run at the same time and their concentration is
very less on few applications to avoid errors.
Use heavy system resources: Sometimes the system resources are not so good
and they are expensive as well.
Complex Algorithms: The algorithms are very complex and difficult for the
designer to write on.
Device driver and interrupt signals: It needs specific device drivers and
interrupts signals to respond earliest to interrupts.
Thread Priority: It is not good to set thread priority as these systems are very
less prone to switching tasks.
Examples of Real-Time Operating Systems are: Scientific experiments, medical imaging
systems, industrial control systems, weapon systems, robots, air traffic control systems, etc.
UNIPROGRAMMING VS MULTIPROGRAMMING:
What is uniprogramming
Uniprogramming means one program sits in main memory at a time. Uniprogramming was
used in old computers and mobiles. When the computer starts then operating system and
application programs are loaded into main memory. We only count user programs running in
RAM. RAM is also called main memory.
In old operating systems (OS) only one program runs on the computer at a time. Either of the
browser, calculator or word processor runs at a time. These type of operating systems in
which one program runs at a time are known as Uniprogramming operating systems.
What is multiprogramming
In multiprogramming, multiple programs reside in main memory (RAM) at a time. OS which
handles multiple programs at a time is known as multiprogramming operating system. One
processor or CPU can only run one process at a time. OS use context switching in main
memory for running multiple programs. Context switching is to switch programs so all
programs are given a suitable amount of time. OS can handle only a limited number of
programs. If we run many programs on the computer or mobile then the computer becomes
very slow or unresponsive.
Uniprogramming vs multiprogramming
In Uniprogramming only one program sits in main memory so it has a small size. But in the
case of multiprogramming main memory needs more space. Uniprogramming system runs
smoothly as only one task is run at a time. The slow processor can also work well in
Uniprogramming but in multiprogramming processor needs to be fast. In multiprogramming
large space of RAM is needed. Fixed size partition is used in Uniprogramming. Both fixed
and variable size partition can be used in multiprogramming systems.
Example of uniprogramming
Example of multiprogramming
Multi-tasking :
Multi-tasking is the logical extension of multiprogramming. In this system, the CPU
executes multiple jobs by switching among them typically using a small time quantum, and
these switches occur so frequently that the users can interact with each program while it is
running. Multitasking is further classified into two categories: Single User & Multiuser.
1. Single User Multi Tasking:
Examples of multiprogramming
Examples of multitasking
Multi Processing:
Multiprocessing is a system that has two or more than two processors. In this, CPUs are
added for increasing computing speed of the system. Because of Multiprocessing, there are
many processes that are executed simultaneously. Multiprocessing is further classified into
two categories: Symmetric Multiprocessing and Asymmetric Multiprocessing.
DISTRIBUTED SYSTEMS:
As we can see that each Autonomous System has a common Application that can
have its own data that is shared by the Centralized Database System.
To Transfer the Data to Autonomous Systems, Centralized System should be
having a Middleware Service and should be connected to a Network.
Middleware Services enables some services which are not present in the local
systems or centralized system default by acting as an interface between the
Centralized System and the local systems. By using components of Middleware
Services systems communicate and manage data.
The Data which is been transferred through the database will be divided into
segments or modules and shared with Autonomous systems for processing.
The Data will be processed and then will be transferred to the Centralized system
through the network and will be stored in the database.
Characteristics of Distributed System:
Resource Sharing: It is the ability to use any Hardware, Software, or Data
anywhere in the System.
Openness: It is concerned with Extensions and improvements in the system (i.e.,
How openly the software is developed and shared with others)
Concurrency: It is naturally present in the Distributed Systems, that deal with the
same activity or functionality that can be performed by separate users who are in
remote locations. Every local system has its independent Operating Systems and
Resources.
Scalability: It increases the scale of the system as a number of processors
communicate with more users by accommodating to improve the responsiveness
of the system.
Fault tolerance: It cares about the reliability of the system if there is a failure in
Hardware or Software, the system continues to operate properly without
degrading the performance the system.
Transparency: It hides the complexity of the Distributed Systems to the Users
and Application programs as there should be privacy in every system.
Heterogeneity: Networks, computer hardware, operating systems, programming
languages, and developer implementations can all vary and differ among
dispersed system components.
Advantages of Distributed System:
Applications in Distributed Systems are Inherently Distributed Applications.
Information in Distributed Systems is shared among geographically distributed
users.
Resource Sharing (Autonomous systems can share resources from remote
locations).
It has a better price performance ratio and flexibility.
It has shorter response time and higher throughput.
It has higher reliability and availability against component failure.
It has extensibility so that systems can be extended in more remote locations and
also incremental growth.
Disadvantages of Distributed System:
Relevant Software for Distributed systems does not exist currently.
Security possess a problem due to easy access to data as the resources are shared
to multiple systems.
Networking Saturation may cause a hurdle in data transfer i.e., if there is a lag in
the network then the user will face a problem accessing data.
In comparison to a single user system, the database associated with distributed
systems is much more complex and challenging to manage.
If every node in a distributed system tries to send data at once, the network may
become overloaded.
Applications Area of Distributed System:
Finance and Commerce: Amazon, eBay, Online Banking, E-Commerce
websites.
Information Society: Search Engines, Wikipedia, Social Networking, Cloud
Computing.
Cloud Technologies: AWS, Salesforce, Microsoft Azure, SAP.
Entertainment: Online Gaming, Music, youtube.
Healthcare: Online patient records, Health Informatics.
Education: E-learning.
Transport and logistics: GPS, Google Maps.
Environment Management: Sensor technologies.
COMPONENTS OF OS:
Process management
Files management
Command Interpreter
System calls
Signals
Network management
Security management
I/O device management
Secondary storage management
Main memory management
Process Management :
Files Management :
Files are used for long-term storage. Files are used for both input and output. Every
operating system provides a file management service. This file management service can
also be treated as an abstraction as it hides the information about the disks from the user.
The operating system also provides a system call for file management. The system call for
file management includes –
File creation
File deletion
Read and Write operations
Files are stored in a directory. System calls provide to put a file in a directory or to remove
a file from a directory. Files in the system are protected to maintain the privacy of the user.
Below shows the Hierarchical File Structure directory.
Command Interpreter :
There are several ways for users to interface with the operating system. One of the
approaches to user interaction with the operating system is through commands. Command
interpreter provides a command-line interface. It allows the user to enter a command on
the command line prompt (cmd). The command interpreter accepts and executes the
commands entered by a user. For example, a shell is a command interpreter under UNIX.
The commands to be executed are implemented in two ways:
The command interpreter itself contains code to be executed.
The command is implemented through a system file. The necessary system file
is loaded into memory and executed.
System Calls :
System calls provide an interface to the services made by an operating system. The user
interacts with the operating system programs through System calls. These calls are
normally made available as library functions in high-level languages such as C, Java,
Python etc. It provides a level of abstraction as the user is not aware of the implementation
or execution of the call made. Details of the operating system is hidden from the user.
Different hardware and software services can be availed through system calls.
System calls are available for the following operations:
Process Management
Memory Management
File Operations
Input / Output Operations
Signals :
Signals are used in the operating systems to notify a process that a particular event has
occurred. Signals are the software or hardware interrupts that suspend the current execution
of the task. Signals are also used for inter-process communication. A signal follows the
following pattern :
A signal is generated by the occurrence of a particular event it can be the
clicking of the mouse, the execution of the program successfully or an error
notifying, etc.
A generated signal is delivered to a process for further execution.
Once delivered, the signal must be handled.
A signal can be synchronous and asynchronous which is handled by a default
handler or by the user-defined handler.
The signal causes temporarily suspends the current task it was processing, saves its
registers on the stack, and starts running a special signal handling procedure, where the
signal is assigned to it.
Network Management :
In today’s digital world, the complexity of networks and services has created modern
challenges for IT professionals and users. Network management is a set of processes and
procedures that help organizations to optimize their computer networks. Mainly, it ensures
that users have the best possible experience while using network applications and services.
Network management is a fundamental concept of computer networks. Network
Management Systems is a software application that provides network administrators with
information on components in their networks. It ensures the quality of service and
availability of network resources. It also examines the operations of a network, reconstructs
its network configuration, modifies it for improving performance of tasks.
Security Management:
The security mechanisms in an operating system ensure that authorized programs have
access to resources, and unauthorized programs have no access to restricted resources.
Security management refers to the various processes where the user changes the file,
memory, CPU, and other hardware resources that should have authorization from the
operating system.
The I/O device management component is an I/O manager that hides the details of
hardware devices and manages the main memory for devices using cache and spooling.
This component provides a buffer cache and general device driver code that allows the
system to manage the main memory and the hardware devices connected to it. It also
provides and manages custom drivers for particular hardware devices.
The purpose of the I/O system is to hide the details of hardware devices from the
application programmer. An I/O device management component allows highly efficient
resource utilization while minimizing errors and making programming easy on the entire
range of devices available in their systems.
Main memory is a flexible and volatile type of storage device. It is a large sequence of
bytes and addresses used to store volatile data. Main memory is also called Random Access
Memory (RAM), which is the fastest computer storage available on PCs. It is costly and
low in terms of storage as compared to secondary storage devices. Whenever computer
programs are executed, it is temporarily stored in the main memory for execution. Later, the
user can permanently store the data or program in the secondary storage device.