Unit3
Unit3
Linux Overview
Linux was first developed by Linus Torvalds, a student in Finland, in 1991. But, now,
Linux is not owned by anyone. No one company or individual “owns” Linux, like as
Windows are owned by a single company Microsoft.
Linux is the most famous, free and open source Operating System.
Open source Operating Systems are available in source-code format rather than as
compiled binary code. Free software means not by money point of view. But,
software that is free, like Linux, is distributed along with its source code. So that,
anyone who receives it is free to make changes and redistribute it.
Many people have done such type of work, and as a result there are many versions of
Linux available in the market. Some of the known versions are Red Hat Enterprise
Linux and its derivatives such as Fedora and CentOS, Debian and its derivatives such
as Ubuntu and Linux Mint, Linspire, PCLinux.
It is multi-tasking Operating System that also supports a handy (useful) Graphical
User Interface (GUI). It is quite (relatives) robust (strong) and secure. You will rarely
hear about virus attack on Linux system (as with Windows).
Linux can be found in a wide range of devices – from personal computers, mobiles,
tablets and embedded systems to mainframe computers and supercomputers.
Features of Linux
As an operating system, Linux contains all the features that any operating system should
have. Also, Linux is a UNIX-like Operating System. So, it contains most of the features of
UNIX too. In addition to these, Linux contains some special features, which makes it so
much popular.
Different users can login from different machines into the same machine by using
programs like ‘TELNET’.
4. Multi-tasking System:
Linux is a multi-tasking Operating System too. It allows multiple programs to run
simultaneously.
Among simultaneously running processes, one process will be foreground process.
User can interact with this process directly. While other processes will be background
processes. They execute in background without requiring user interaction.
5. High Performance and Reliability:
Linux provides high performance with minimum requirements of hardware compared
to other Operating Systems.
No other Operating System is more stable and reliable than Linux. System crashes,
hangs, virus attacks are almost absent from the Linux world.
6. The Building-block Approach:
Linux uses the building-block approach to perform complex tasks.
It provides a few hundred commands each of which can perform one simple job. To
perform complex tasks, such simple commands can be combined using pipes and
filters. Thus, the small-is-beautiful philosophy is implemented here. (Pipes and filters
are described later in this chapter.)
7. Flexible Interface:
Linux supports both types of interfaces – GUI (Graphical User Interface) as well as
CLI (Command Line Interface).
GUI makes task of users easy, and so, makes Operating System user friendly. CLI
provides more options and control to the user. For example, complex tasks can be
performed by combing multiple commands or creating shell scripts.
User can choose any interface according to their convenience and expertise.
8. File System Support:
Linux supports a wide range of file systems such as ext, ext2, ext3, ext4, XFS, JFS,
etc.
Along Operating Systems, it also supports file systems supported by other Operating Systems
such as NTFS, so that, Linux users can also access files managed by those Operating
Systems.
9. Programming Facility:
The Linux shell is also a programming language.
It supports all the programming features such as variable, control structures, loops and
so on.
These features can be used to develop shell programs, called shell scripts. Such
programs can be used to control and automate(computerize) many of the system’s
functions. (Shell scripts are described in detail in section 5.9).
Linux architecture is also known as the layered structured of the Linux. As Linux is a
Unix-like Operating System, its architecture resembles to that of UNIX.
Hardware:
The bottom layer is the hardware.
It consists of various physical devices such as CPU, memory, disks, monitors,
printers, etc.
These devices provide various services. For example, printers are used for printout
purposes.
Linux Kernel:
The next higher layer is the Linux Kernel. It represents the core of the Operating
System. (A kernel is described next).
It manages all the underlying hardware.
It directly interacts with the hardware and provides user programs required services.
It hides the complex details of hardware also.
In short, it provides the simple interface between user programs and hardware.
The main services of an operating system includes process management, memory
management, files system management, I/O management etc.
Standard Library:
Above operating system, next layer in for standard library.
It contains a set of procedures, one procedure per system call.
These procedures are written in assembly language and used to invoke(raise) various
system calls from user programs.
Users:
The top-most layer is of users.
Users programs come in this layer. They interact with the system either by using
library procedures to invoke system calls, or by using utility programs such as shell.
1. Debian
2. Ubuntu
o Ubuntu is based on Debian, but it has its own software
repositories.
3. Linux Mint
o Mint is a Linux distribution built on top of Ubuntu.
o It uses Ubuntu’s software repositories.
o It included media codecs and proprietary software that Ubuntu didn’t
include by default.
o You get a more traditional Cinnamon or MATE desktop.
o Mint takes a more relaxed approach to software updates and won’t
automatically install critical software updates.
4. Fedora
o Fedora is a project with a strong focus on free
software — you won’t find an easy way to install proprietary graphics
drivers here, although third-party repositories are available.
o Fedora is bleeding edge and contains the latest
versions of software.
o Fedora doesn’t make its own desktop environment or
other software.
o Instead, the Fedora project uses “upstream” software, providing a
platform that integrates all this upstream software without adding their
own custom tools or patching it too much.
o Fedora comes with the GNOME 3 desktop environment by default,
although you can also get “spins” that come with other desktop
environments.
5. CentOS/Red Hat
7. Mageia
o Mageia is a fork of Mandriva Linux created in 2011.
Mandriva was once one of the great user-friendly Linux distributions.
o Like Fedora and openSUSE, this is a community-
created project to create an open-source Linux distribution.
o Mandriva SA no longer creates a consumer Linux
distribution for desktop PCs, but their business Linux server projects
are based on Mageia code.
o It provides code to its enterprise.
8. Arch Linux
o Arch Linux is more old school than many of the other Linux
distributions here.
o It’s designed to be flexible, lightweight, minimal, and to “Keep it
Simple.”
o Keeping it simple doesn’t mean Arch provides tons of graphical
utilities and automatic configuration scripts to help you set up your
system.
o You’re in charge of configuring your system properly and installing the software you
like. Arch doesn’t provide an official graphical interface for its package manager or
complex graphical configuration tools. Instead, it provides clean configuration files
designed for easy editing.
o The installation disc dumps you at a terminal, where you’ll need to enter the
appropriate commands to configure your system, partition your disks, and install the
operating system yourself.
o This version was designed for users who know how their systems work or who are at
least willing to learn.
o However, Arch uses binary packages while Gentoo had an (unnecessary) focus on
compiling every bit of software from source — this means it’s quick to install
software on Arch as you don’t have to spend CPU cycles and time waiting for
software to compile.
9. Slackware Linux
3 Linux Mint Lefebvre dev team 2006 18.3 years (main editions) 27-11-2017 Ubuntu desktop
Kernel
The next higher layer is the Linux Kernel. It represents the core of the
Operating System.
It manages all the underlying hardware.
It directly interacts with the hardware and provides user programs required
services.
It hides the complex details of hardware also.
In short, it provides the simple interface between user programs and
hardware.
The main services of an operating system includes process management,
memory management, file system management, I/O management etc.
System Library
System libraries are special functions or programs using which application
programs or system utilities accesses Kernel's features.
These libraries implement most of the functionalities of the operating system
and do not require kernel module's code access rights.
System Utility
System Utility programs are responsible to do specialized, individual level
tasks.
This programs are stored on disk and when user wants to perform any task
then respective utility program is stored on main memory for
execution.Kernel Mode vs User Mode
Kernel Mode:
Kernel component code executes in a special privileged (private) mode called kernel
mode with full access to all resources of the computer.
This code represents a single process, executes in single address space and do not
require any context switch and hence is very efficient and fast. Kernel runs each
process and provides system services to processes, provides protected access to
hardware to processes.
The system starts in kernel mode when it boots and after the operating system is
loaded, it executes applications in user mode. There are some privileged instructions
that can only be executed in kernel mode.
These are interrupt (stop) instructions, I/P management etc. If the privileged
instructions are executed in user mode, it is illegal and a trap is generated. The mode
bit is set to 0 in the kernel mode. It is changed from 0 to 1 when switching from
kernel mode to user mode.
User Mode:
Support code which is not required to run in kernel mode is in System Library. User
programs and other system programs works in User Mode which has no access to
system hardware and kernel code. User programs/ utilities use System libraries to
access Kernel functions to get system's low level tasks.
The system is in user mode when the operating system is running a user application
such as handling a text editor. The transition from user mode to kernel mode occurs
when the application requests the help of operating system or an interrupt or a
system call occurs.
The mode bit is set to 1 in the user mode. It is changed from 1 to 0 when switching
from user mode to kernel mode.
In the above image, the user process executes in the user mode until it gets a system call.
Then a system trap is generated and the mode bit is set to zero. The system call gets
executed in kernel mode. After the execution is completed, again a system trap is generated
and the mode bit is set to 1. The system control returns to kernel mode and the process
execution continues.
LINUX OS WINDOWS OS
Introduction Linux is a free open source operating system Windows is not open source software.
means source code can be changed.
Development and Linux is developed by Open Source Developed and distributed by Microsoft.
Distribution development i.e. through sharing and
collaboration of code and features through
forums etc and it is distributed by various
vendors.
Company / developer Linus Torvalds and the Linux community. Microsoft
Update method Many Windows Update
Preceded by Basic Terminal (CLI) – command line interface MS-DOS
License GNU General Public License Proprietary
Available language(s) Multilingual Multilingual
OS family GNU DOS
Programmed in C Assembly, C, C++
Marketing target Server, Personal, Personal, business
Compatibility New version of Linux support many kinds of Can coexist on local networks with Windows,
hardware BSD, Macs, and other Unix-like systems.
Sometimes file compatibility issues may arise.
Usage Linux can be installed on a wide variety of On PC's desktops, laptops, servers and some
computer hardware, ranging from mobile phones.
phones, tablet computers and video game
consoles, to mainframes and supercomputers.
Default user interface Gnome or KDE Graphical (Windows Aero)
Source model Free Software Closed / Shared source
Users Regular Administrator
Administrative(root) Standard
Service Child
Guest
File System Unix/Linux uses a tree like a hierarchical file Windows uses different data drives like C: D:
system. E to stored files and folders.
Drives There are no drives in Linux Windows has different drives like C: D: E
Peripheral Device Peripherals like hard drives, CD-ROMs, printers Hard drives, CD-ROMs, printers are
are also considered files in Linux/Unix considered as devices
Privileges(rights) Root user is the super user and has all Administrator user has all administrative
administrative privileges. privileges of computers.
File name Linux file naming convention is case sensitive. In Windows, you cannot have 2 files with the
Thus, sample and SAMPLE are 2 different files same name in the same folder
in Linux
Default Directory For every user /home/username directory is In windows, My Documents is default home
created which is called his home directory. directory.