Introduction to Linux Operating System
Introduction to Linux Operating System
Linux is a community of open-source Unix like operating systems that are based on
the Linux Kernel.
It was initially released by Linus Torvalds on September 17, 1991.
It is a free and open-source operating system and the source code can be modified
and distributed to anyone commercially or non-commercially under the GNU General
Public License.
Initially, Linux was created for personal computers and gradually it was used in other
machines like servers, mainframe computers, supercomputers, etc.
Nowadays, Linux is also used in embedded systems like routers, automation controls,
televisions, digital video recorders, video game consoles, smartwatches, etc.
The biggest success of Linux is Android(operating system) it is based on the Linux
kernel that is running on smartphones and tablets. Due to android Linux has the
largest installed base of all general-purpose operating systems. Linux is generally
packaged in a Linux distribution.
Linux distribution is an operating system that is made up of a collection of
software based on Linux kernel or you can say distribution contains the Linux
kernel and supporting libraries and software.
One can get Linux based operating system by downloading one of the Linux
distributions and these distributions are available for different types of devices
like embedded devices, personal computers, etc.
Around 600 + Linux Distributions are available and some of the popular Linux
distributions are:
MX Linux Debian Manjaro
Linux Mint Deepin Redhat
Ubuntu Garuda Linux
Elementary EndeavourOS
Fedora Linux
openSUSE
LINUX stands for Lovable Intellect Not Using XP.
Linux was developed by Linus Torvalds and named after him.
Linux is an open-source and community-developed operating system for
computers, servers, mainframes, mobile devices, and embedded devices.
Linux receives requests from system programs and it relays them into
computer hardware.
Linux is flexible, reliable, secure and it has large community user’s
support.
Linux is compatible with almost every possible file format and can run on
a large number of devices.
Events Leading to the Creation of Linux
The emergence of Linux, one of the world’s most widely used open-source
operating systems, can be traced to several important events and the work of a
few people. Below is a summary of the major events that led to the emergence
of Linux.
Unix development: Linux was heavily influenced by the Unix operating system
developed by Bell Labs in the late 1960s and early 1970s by Ken Thompson.
Unix was developed as a multi-user, multi-tasking operating system and has
been widely used in science and research.
Minix is born: In the early 1980s, computer science professor Andrew S.
Tanenbaum created a small Unix-like operating system called Minix. Minix was
developed as an educational tool and the source code was made available to
students.
Linux is born: In 1991, a 21-year-old student named Linus Torvalds began
working on a new operating system he named Linux. Linus was inspired by his
Minix and used its source his code as a starting point for his own projects. He
also drew heavily on Unix design principles.
A popular open-source operating system is Linux.
It was initially created by Linus Torvalds in 1991.
At the time, Torvalds was a computer science student at the University of
Helsinki, Finland and began working on the Linux project as a personal
endeavour.
The name Linux is a combination of his first name, Linus, and Unix, the
operating system that inspired his projects.
At the time, most operating systems were proprietary and expensive.
Torvalds wanted to create an operating system that was freely available to
anyone who wanted to use the operating system.
He originally released Linux as free software under the GNU General Public
License. This meant that anyone could use, modify, and redistribute his
source code.
Release of Linux 0.01: In September 1991, Linus released the first version of his
Linux called Linux 0.01. It was a command-line operating system and was freely
distributed on the Internet.
Linux community development: In the years that followed, Linux quickly gained
popularity among programmers and enthusiasts. A community of developers
began to form around Linux, contributing to the development of the operating
system by writing code, filing bug reports, and providing feedback.
Enterprise Adoption: In the late 1990s and early 2000s, the open-source nature
of Linux made it more flexible, cost-effective, and more secure than proprietary
operating systems such as Windows, making it a popular choice for enterprises
and businesses. started being hired by companies. This increased acceptance led
to the development of commercial support and services for Linux.
Linux Distribution Growth: As Linux became more popular, various groups
of developers began creating their own versions of the operating system,
called distributions. Some of the most popular distributions are Red Hat,
Debian, and Ubuntu. These distros contain the Linux kernel and a number of
his packages of easy-to-use tools and software that make using his Linux
easy for both developers and end users.
Linux in the Enterprise: With the growth of cloud computing and the
Internet of Things, Linux continues to gain traction in the enterprise. Linux
is now widely used as an operating system for servers, mainframes, and
supercomputers. It’s also used in embedded systems, mobile devices, and
the Internet of Things.
Linux in the Consumer Market: Linux has also entered the consumer
market with the advent of Linux-based mobile devices, smart TVs, and other
consumer electronics.
The official Linux mascot is a penguin named Tux.
Created by artist Larry Ewing in 1996, the penguin was first used as his Linux
mascot for the Linux kernel.
Tux quickly became popular in the Linux community and is now one of
Linux’s most recognizable icons.
Tux was chosen as the mascot because the penguin is a rare animal found in
the wild in Antarctica, just as Linux is a unique and powerful operating
system.
The name Tux comes from the short form “Torvalds Unix“, in honor of the
creator of Linux, Linus Torvalds.
The Linux ecosystem is a constantly evolving and expanding platform, so there is a lot
of development going on. Notable recent developments include:
Linux 5.11 kernel release. It includes new features such as AMD Zen 3 processor
support, memory management system improvements, and new hardware support.
Continued development of various Linux distributions. Ubuntu 21.04 released in April
2021. It features an updated Gnome desktop environment, improved ZFS file system
support, and new security features.
Development of new open-source software and tools for Linux. For example, the
release of version 6.0 of Ansible automation tools brings new features such as
support for Windows Subsystem for Linux 2 (WSL2) and improved support for
Kubernetes.
The rise of containerization and orchestration technologies such as Docker and
Kubernetes. They are becoming more and more common in deploying and managing
Linux-based applications.
Linux is growing in popularity in the cloud computing space, with many major cloud
providers offering Linux-based virtual machines and managed services.
In 80’s, Microsoft’s DOS was the dominated OS for PC
Apple MAC was better, but expensive
UNIX was much better, but much, much more expensive. Only for
minicomputer for commercial applications
People were looking for a UNIX based system, which is cheaper
and can run on PC
Both DOS, MAC and UNIX were proprietary, i.e., the source code of
their kernel is protected
No modification is possible without paying high license fees
Established in 1984 by Richard Stallman, who believes that software
should be free from restrictions against copying or modification in
order to make better and efficient computer programs
Soon more than a hundred people joined the Linux camp. Then thousands.
Then hundreds of thousands
It was licensed under GNU General Public License, thus ensuring that the
source codes will be free for all to copy, study and to change.
no networking
ran only on 80386 compatible Intel Processors and PC hardware
limited device driver support
Virtual memory subsystem was very basic
Shared pages with copy-on-write
Supported only Minix file system
Released in March 1994
Networking (supported TCP/IP, BSD compatible socket interface)
Device driver support for running IP over Ethernet
Enhanced file system not just restricted to Minix
Virtual memory subsystem supporting paging to swap files and
memory mapping
Extra hardware support
Further enhancements seen in version 1.1, 1.2,1.3
Released in June 1996
Support for multiple architectures
Support for multiprocessor architecture
Memory management code improved to provide a unified cache for
file system data independent of the caching of block devices. Thus
increased file system and virtual memory performance.
Improved TCP/IP performance and support to other protocols
Support for internal kernel threads for handling loadable modules
LINUX TODAY
Linux has been used for many computing platforms
– PC, PDA, Supercomputer,…
Not only character user interface but graphical user interface is
available
Commercial vendors moved in Linux itself to provide freely distributed
code. They make their money by compiling up various software and
gathering them in a distributable format
– Red Hat, Slackware, etc
LINUX - FREE SOFTWARE
Free software, as defined by the FSF (Free Software Foundation), is
a "matter of liberty, not price." To qualify as free software by FSF
standards, you must be able to:
Run the program for any purpose you want to, rather than be
restricted in what you can use it for.
View the program's source code.
Study the program's source code and modify it if you need to.
Share the program with others.
Improve the program and release those improvements so that
others can use them.
When programmers on the Internet can read, redistribute, and modify the
source for a piece of software, it evolves
People improve it, people adapt it, people fix bugs. And this can happen at
a speed that, compared to conventional software development, seems
astonishing
The Architecture Of Operating system consist of 5 parts:-
Shell
Kernel
System Utilities
User Applications
Hardware Platform
Kernel is the core of the Linux based operating system.
It act as an interface between operating system and other hardware resources.
It is the main part of the operating system that loads firsts and remains in the main
memory.
It is the bridge between the application and the actual data processing to support the
application.
It is responsible for task management, memory management and disk management .
Its primary function is to manage the computer resources and support other program
who want to use these resources.
Different types of the kernel are:
Monolithic Kernel
Hybrid kernels
Exo kernels
Micro kernels
It acts as an interface between user and the operating system.
It is a software that provides an interface for user of an operating
system which need services of a kernel.
The shell is the utility that processes your requests. When you type in
a command at your terminal, the shell interprets the command and
calls the program that you want. So basically, you communicate with
the kernel through this program.(It is an interface to the kernel which
hides the complexity of the kernel’s functions from the users. It takes
commands from the user and executes the kernel’s functions. )
An operating system shell is divided into two parts:-
Command line
GUI
Command line Shell
It is the part of the operating system which receives and executes the operating
system command by the user.
The commands are then send to the kernel for execution.
If the command is valid the kernel starts the execution else error will be produced.
A system call is how a program requests a service from an operating system's kernel.
This may include hardware related services (e.g. accessing the hard disk), creating
and executing new processes, and communicating with integral kernel services (like
scheduling). System calls provide an essential interface between a process and the
operating system.
System calls can also be viewed as clearly-defined, direct entry points into the kernel
through which programs request services from the kernel. They allow programs to
perform tasks that would not normally be permitted.
eg. A user has requested to MS paint. This request will be sent to the operating
system, and then the operating system will generate some activity to support MS
paint and run on the system.
File Management System call – For performing open, close, read, write etc
operations.
Process Control System Call – For performing Load, execute, create etc
operations.
Device Management System Call – For performing request device, write
device, release device etc operations.
Communication System call – For performing Send message, transfer
status operations etc.
These are the applications which a user uses to perform his task.
Linux and other operating system come up which various different
application in it
Kernel is used to generate processes to support these applications.
Linux operating system contains a hardware layer that consists of
several peripheral devices like CPU, HDD and RAM.
These libraries can be specified as some special functions. These are applied
for implementing the operating system's functionality and don't need code
access rights of the modules of kernel.
Types of Kernel
Linus Torvalds introduced the concept of a monolithic kernel in 1991 as a part of
the Linux kernel. A monolithic kernel is a single large program that contains all
operating system components. However, the Linux kernel evolved over the years
and now consists of different types of kernels, as listed below.
1. Monolithic Kernel As the name suggests, a monolithic kernel is a single large
program that contains all operating system components. The entire kernel executes
in the processor’s privileged mode and provides full access to the system’s
hardware. Monolithic kernels are faster than microkernels because they don’t have
the overhead of message passing. This type of kernel is generally used in
embedded systems and real-time operating systems.
2. Microkernel A microkernel is a kernel that contains only the essential
components required for the basic functioning of the operating system. All other
components are removed from the kernel and implemented as user-space
processes. The microkernel approach provides better modularity, flexibility, and
extensibility. It is also more stable and secure than monolithic kernels.
3. Hybrid Kernel A hybrid kernel is a kernel that combines the best features of both
monolithic kernels and microkernels. It contains a small microkernel that provides the
essential components for the basic functioning of the OS. The remaining components are
implemented as user-space processes or as loadable kernel modules. This approach
provides the best of both worlds, namely, the performance of monolithic kernels and the
modularity of microkernels.
4. Exokernel An exokernel is a kernel that provides the bare minimum components
required for the basic functioning of the operating system. All other components are
removed from the kernel and implemented as user-space processes. The exokernel
approach provides the best possible performance because there is no kernel overhead.
However, it is also the most difficult to implement and is not widely used.
There are four shells that are commonly supported by UNIX vendors:
the Bourne shell(sh), the Korn shell(ksh), the C shell(csh) and Bourne
Again Shell (bash).
In the next segment, we will study Bash (Bourne Again Shell) that is
compatible with Bourne shell and borrows best features from the other
shells. Bash is becoming the most popular shell - it is the default shell
in Linux.
SELECTING A SHELL
When you are provided with a UNIX account,the system administrator chooses
a shell for you.
To find out which shell was chosen for you, look at your prompt.
36
The Bourne Shell –
Denoted as sh
It was written by Steve Bourne at AT&T Bell Labs.
It is the original UNIX shell. It is faster and more preferred.
It lacks features for interactive use like the ability to recall
previous commands.
It also lacks built-in arithmetic and logical expression handling.
The GNU Bourne-Again Shell (Bash)
The Bourne-Again shell is an updated version of the original
Bourne shell that was created by the Free Software Foundation for
its open source GNU project. For this reason, it is a widely used
shell in the open source community.
Its syntax is similar to that used by the Bourne shell, however it
incorporates some of the more advanced features found in the C,
TC and Korn shells.
Bash provides a range of features, including command history, tab
completion, and scripting.
It is also highly customizable and can be configured to suit
individual needs.
The popularity of sh motivated programmers to develop a shell that was compatible
with it, but with several enhancements.
Linux systems still offer the sh shell, but "bash" -- the "Bourne-again Shell," based on
sh -- has become the new default standard.
One attractive feature of bash is its ability to run sh shell scripts unchanged.
Shell scripts are complex sets of commands that automate programming and
maintenance chores; being able to reuse these scripts saves programmers time.
C Shell
C shell, also known as csh, is a shell that is popular among
programmers and developers.
Itincludes many features designed to make programming and
development tasks more efficient.
The C shell was created at the University of California by Bill Joy.
It was developed to include useful programming features like in-built
support for arithmetic operations and a syntax similar to the C
programming language.
Further, it incorporated command history which was missing in
different types of shells in Linux like the Bourne shell. Another
prominent feature of a C shell is “aliases”.
C shell includes advanced command history, job control, and advanced
scripting capabilities.
Ken Greer, working at Carnegie-Mellon University, took csh concepts a
step forward with a new shell, tcsh, which Linux systems now offer.
T Shell
Tcsh is an upgraded C shell. This shell can be used as a shell
script command processor and interactive login shell.
Tcsh shell includes the following characteristics:
C like syntax
Filename completion and programmable word
Command-line editor
Job control
Spelling correction
Korn shell
The Korn shell was developed at AT&T Bell Labs by David Korn, to improve the
Bourne shell.
It is denoted as ksh.
The Korn shell is essentially a superset of the Bourne shell.
Besides supporting everything that would be supported by the Bourne shell, it
provides users with new functionalities.
It allows in-built support for arithmetic operations while offering interactive
features which are similar to the C shell.
The Korn shell runs scripts made for the Bourne shell, while offering string, array
and function manipulation similar to the C programming language.
It also supports scripts which were written for the C shell. Further, it is faster
than most different types of shells in Linux, including the C shell.
Fundamental Architecture of Linux
The fundamental architecture of Linux is divided into main two
parts:
User Space
Kernel Space
1. User Space:
The User Space is the domain where user applications and processes operate.
It is the area where most user-level programs, such as software applications and
utilities, execute.
User Space does not have direct access to memory or hardware.
It connects to the hardware via kernel space.
User-space processes or programs can only access some parts of memory via
system calls.
Crashes in user mode are recoverable due to complete protection.
The GNU C library in the user space provides the mechanism for switching user
space applications to the kernel space.
2. Kernel Space:
The Kernel Space, also referred to as the System Space, is a privileged domain
dedicated to the execution of kernel programs.
It includes all the memory and facilitates interaction with hardware components
such as RAM and hard disks.
Within the Kernel Space, different blocks and modules handle various
operations essential to the operating system, including file management,
memory management, and process management.
The Kernel Space includes components such as the system call interface,
the kernel itself (the core component of Linux), and device modules.
Architecture of Kernel
The architecture of a kernel follows a modular approach. It consists of several
components that work together to manage system resources and facilitate
communication between different parts of the operating system. The following
are the core Subsystems of the Linux Kernel:
The Process Scheduler
The Memory Management Unit (MMU)
The Virtual File System (VFS)
The Networking Unit
Inter-Process Communication Unit
The Process Scheduler
This is the primary subsystem of the kernel as it is responsible for distributing the CPU
time and resources among all the processes or applications in a fairway.
Its purpose is to ensure that no process runs out of CPU resources, allowing multiple
applications to run simultaneously without affecting the performance of one.
The process scheduler provides fairness, efficiency, and responsiveness by utilizing
various scheduling algorithms such as round-robin, priority-based, or multi-level
feedback queues.
The Memory Management Unit (MMU)
This kernel subsystem is responsible for managing and organizing the system's
memory resources.
It is responsible for ensuring that memory is allocated and distributed appropriately
among multiple processes and applications, preventing issues such as crashes or
kernel mode errors caused by insufficient memory.
By efficiently managing memory, this subsystem ensures that processes and
applications have access to the necessary memory resources and prevents memory-
related errors.
The Virtual File System (VFS)
The Virtual File System (VFS) subsystem inside the kernel is responsible for providing an
equal interface to all available filesystems on the computer and allowing them to access the
stored data on those file systems.
It abstracts the details of different file systems, such as ext4, NTFS, or FAT, and provides a
consistent file I/O interface to user programs. Regardless of the underlying file system, the
VFS layer enables programs to do file-related actions such as opening, reading, writing, and
closing files.
The Networking Unit
The Networking Unit subsystem in the Linux kernel is an essential component located
within the kernel space.
It plays a crucial role in facilitating communication between hosts, even if they are not
directly connected.
In X-Windows, the network subsystem is used for client-server communication, allowing
applications to connect over a network. The Linux Kernel's networking stack handles
incoming packets, processing them from Layer 2 (data link layer) up to the network layer.
Inter-Process Communication Unit
The inter-process communication (IPC) unit facilitates communication and data sharing
between distinct operating system processes or threads.
Linux supports a number of Inter-Process Communication (IPC) mechanisms. Signals and
pipes are two of them, but Linux also supports the System V IPC mechanisms, which are
named after the Unix TM release in which they were initially introduced.
Multitasking: Several programs can run at the same time.
Multiuser: Several users can logon to the same machine at the same
time There is no need to have separate user licenses.
Multiplatform: Linux runs on many different CPUs, that means it
supports multiprocessor machine.
Multithreading: Linux has native kernel support for multiple
independent threads of control within a single process memory
space.
• GUI – with x-windows 2 popular desktop environments GNOME and
KDE
• Shell – CLI to OS
• Hierarchical File System – Entire File system is tree structured and
anchored to a single directory root
• Robust Programming and Application Environments – C Complier,
C++, assemblers, Perl, Python are available in Linux
• Freedom – free to choose any distribution
• Compatible File, Device and Interprocess I/O – Redirection is
possible without changing the program
• •
• Free and Open source code for all: All source code of Linux
is available, including the whole kernel and all drivers, the
development tools and all user programs; also, all of it is
freely distributable. Plenty of commercial programs are being
provided for Linux without source, but everything that has
been free, including the entire base operating system, is still
free.
• Linux supports pseudoterminals (pty's)
and multiple virtual consoles: By several
independent login sessions through the
console, you can switch between by pressing
a hot-key combination (not dependent on
video hardware). These are dynamically
allocated; you can use up to 64.
• Linux supports several common file systems, including minix,
Xenix, and all the common system V file systems, and has an
advanced file system of its own EXT2 EXT3, which offers file
systems of up to 4 TB, and names up to 255 characters long.