3. What is Open Source.
Linux Operating System
History of linux
Linux distributors
Features of linux
Linux kernel
Process management in linux
Input/output in linux
Memory management in linux
Advantages of linux
4. whose source code is available.
People improve it, people adapt it, people fix
bugs.
The freedom to run the program for any purpose
The freedom to study how the program works, and adapt it
to your needs
The freedom to redistribute copies
The freedom to improve the program
5.
6. 7-Zip
Eclipse
GIMP
Chromium
Blender
Mozilla Firefox
Open Office
11. In 80’s, Microsoft’s DOS was mostly used OS for PC
UNIX was much better, but much more expensive.
Only for minicomputer for commercial applications
Apple MAC OS was better, but was also expensive
People were looking for an Operating system, which
is cheaper and can easily run on PC
All DOS, MAC and UNIX were proprietary, i.e., the
source code of their kernel was protected
No modification was possible without paying high
License fees
12. Linus Torvalds was a student at the University of
Helsinki, he was using a version of the UNIX operating
system called ‘Minix‘. When Linus and other users
found that some modifications can make the OS even
better he and the other users sent requests for
modifications and improvements to Minix’s creator,
Andrew Tanenbaum, but Andrew felt that these
changes are not necessary and didn’t make the
changes. That was the time when Linus decided to
create his own operating system that would take into
account user’s comments and suggestions for
improvements.
As Linus was a student of C Language he started writing
the codes in C, around 95% of the Linux was written in
C, and 2nd most used language for the Linux
development was ‘Assembly‘ language i.e. around
2.8%
13. Linux is UNIX-based operating system.
In Sept 1991, Linus Torvalds , a second year
student of Computer Science at the University of
Helsinki, developed the preliminary
kernel of Linux, known as Linux
version 0.0.1
Its was originally named as Freax
It is licenced under GNU General
Public licence.
14. Tux is a penguin character and the official
mascot of the Linux kernel.
15. It was originally developed for 32-bit x86-based
PCs (386 or higher), but today Linux also runs on
(at least) the Compaq Alpha AXP, Sun SPARC and
UltraSPARC, Motorola 68000, PowerPC,
PowerPC64, ARM, Hitachi SuperH, Cell, IBM
S/390, MIPS, HP PA-RISC, Intel IA-64, DEC VAX,
AMD x86-64, AXIS CRIS, Xtensa, Tilera TILE,
AVR32 and Renesas M32R architectures.
16.
17. Linux is free i.e. open source
Linux is portable to any hardware platform
Linux is secure and versatile
Linux is scalable
The Linux OS and most Linux applications have
very short debug-times
It is case sensitive
Multiuser multi-tasking ,multiprogramming
Supports multi shell
Modularity .
In Linux everything is file.
18. Kernel is the core part of linux operating
system.
Monolithic kernel is used in linux.
Function of linux kernel:-
Memory management
Process management
Device management
Storage management
Network management
Architectural prespective of linux kernel
20. The User Space is the space in memory
where user processes run.
This Space is protected.
The system prevents one process from
interfering with another process.
Only Kernel processes can access a user
Process.
21. The kernel Space is the space in memory
where kernel processes run.
The user has access to it only through the
system call.
22.
23. The fork system call creates an exact copy of the
original process. The forking process is called the
parent process. The new process is called the child
process.
Each process has a unique identifier (Process ID).
Each process is represented by a task_struct data
structure.
The task_vector is an array of pointers to every
task_struct data structure in the system.
This means that the maximum number of
processes in the system is limited by the size of
the task vector.
24. Along with the foreground processes, dozens
of background processes are also running ,
known as daemons.
A typical cron daemon is used in linux.
25. As a process executes it changes state
according to its circumstances. Linux
processes have the following states:
1. Running The process is either running or it
is ready to run.
2. Waiting The process is waiting for an event
or for a resource. Linux differentiates
between two types of waiting process;
interruptible and uninterruptible.
Interruptible waiting processes can be
interrupted by signals whereas
uninterruptible waiting processes are
waiting directly on hardware conditions and
cannot be interrupted under any
circumstances.
26. Cont……
3. Stopped The process has been stopped, usually
by receiving a signal. A process that is being
debugged can be in a stopped state.
4.Zombie This is a halted process which, for some
reason, still has a task_struct data structure in
the task vector. It is what it sounds like, a dead
process.
27.
28.
29. Processes in Linux can communicate with each
other using a form of message passing.
Channels are created through pipes.
Shell pipelines are implemented with pipes. When
the shell sees a line like
sort <f | head
Another way of communication is : software
interrupts.
A process can send a signal to another process.
30. In linux scheduling is based on threads, not
processes.
Linux distinguishes three classes of threads for
scheduling purposes:
1. Real-time FIFO.
2. Real-time round robin.
3. Timesharing.
31. A key data structure used by the Linux
scheduler is a runqueue.
A runqueue is associated with each CPU in
the system, and among other information, it
maintains two arrays:
active
expired.
32.
33. LINUX follows the philosophy that every thing is a
file.
The I/O system in Linux looks much like that in
any UNIX system.
All device drivers appear as normal files.
Users can open an access channel to a device in
the same way they open any other file.
Devices can appear as objects within the file
system.
A user can access a device in the same way as he
opens any other file.
The administrator can set access permission for
each device.
34. Linux splits all devices into three classes:
1) Block devices.
2) Character devices.
3) Network devices.
35. provide the main interface to all disk devices in a
system.
It include all devices that allow random access to
completely independent, fixed-sized blocks of
data, including hard disks and floppy disks , CD-
ROMs and Blu-ray discs, and flash memory.
used to store file systems
The request manager manages the reading and
writing of buffer contents to and from a block
device driver.
36. • Used in version 2.6
• Associates a deadline with each request ,thus
addressing the starvation issue
• Maintains three queues:
• Sorted queue
• Read queue
• Write queue
• By default the deadline for read request is 0.5
seconds and for write requests is 5 seconds
37. A device driver which does not offer random access to
fixed blocks of data.
A character device driver must register a set of functions
which implement the driver’s various file I/O operations.
The kernel performs almost no preprocessing of a file read
or write request to a character device, but simply passes on
the request to the device.
The main exception to this rule is the special subset of
character device drivers which implement terminal
devices, for which the kernel maintains a standard
interface.
e.g. keyboards, mouse, serial ports
38. Users can’t directly transfer data to network
devices
They communicate indirectly by opening a
connection to the kernel’s networking subsystem.
Networking in the Linux kernel is implemented by
three layers of software:
1. The socket interface
2. Protocol drivers
3. Network-device drivers
39. User applications perform all networking
requests through the socket interface.
It looks like the BSD socket layer, so that any
programs designed to make use of Berkeley
sockets will run on Linux without any source-
code changes.
The BSD socket interface is sufficient to
represent network addresses for a wide range
of networking protocols.
40. o It is the second layer of software .
o When data arrive at this layer, either from an
application’s socket or from a network-device
driver , the data are expected to have been tagged
with an identifier specifying which network
protocol they contain.
o Functions of protocol layer:
1. rewrite packets
2. create new packets
3. split or reassemble packets into fragments
4. discard incoming data.
41. o communication between the layers of the
networking stack is performed by passing single
skbuff (socket buffer) structures.
o A skbuff set of pointers into a single continuous
area of memory , representing a buffer inside
which network packets can be constructed.
o The networking code either add or trim data from
the end of packets.
o The most important set of protocols in the Linux
networking system is the TCP/IP protocol suite.
42. IP protocol implements routing between different
hosts anywhere on the network.
On top of the routing protocol are the UDP, TCP,
and ICMP protocols.
The UDP protocol carries arbitrary individual
datagram between hosts. The
TCP protocol implements reliable connections
between hosts.
ICMP protocol carries various error and status
messages between hosts.
43. Cont…..
Incoming IP packets are delivered to the IP driver.
this layer performs routing.
After deciding where the packet is to be sent, the
IP driver forwards the packet to the appropriate
internal protocol driver to be delivered locally or
injects it back into a selected network-device-
driver queue to be forwarded to another host.
The routing can be done using two tables:
1. forwarding information base (FIB).
2. cache of recent routing decisions.
44. Cont……
Large outgoing packets are split up into smaller
fragments.
At the receiving host, these fragments are
reassembled.
Incoming fragments are matched against each
known ipq. If a match is found, the fragment is
added to it ; otherwise, a new ipq is created.
Once the final fragment has arrived for a ipq , a
completely new skbuff is constructed to hold the
new packet, and this packet is passed back into the
IP driver.
45.
46. Memory management under Linux has two
components:
1. The first deals with allocating and freeing physical
memory-pages, groups of pages, and small
blocks of memory.
2. The second handles virtual memory, which is
memory mapped into the address space of
running processes.
47. Linux separates physical memory into three
different zones, or regions:
ZONE_DMA
ZONE_NORMAL
ZONE_HIGHMEM
48. Zone_DMA (0-16MB): Permanently mapped into the
kernel address space.
.
Zone_Normal (16MB-896MB): Permanently mapped
into the kernel address space.
ZONE_HIGH_MEM (896MB-above): not permanently
mapped into the kernel's address space.
49. The page allocator allocates and frees all physical
pages; it can allocate ranges of physically-contiguous
pages on request.
The allocator uses a buddy-heap algorithm to keep
track of available physical pages.
Each allocatable memory region is paired with an
adjacent partner.
Whenever two allocated partner regions are both freed
up they are combined to form a larger region.
If a small memory request cannot be satisfied by
allocating an existing small free region, then a larger
free region will be subdivided into two partners to
satisfy the request.
Memory allocations in the Linux kernel occur either
statically (drivers reserve a contiguous area of memory
during system boot time) or dynamically (via the page
allocator).
51. The VM system maintains the address space
visible to each process: It creates pages of virtual
memory on demand, and manages the loading of
those pages from disk or their swapping back out
to disk as required.
The VM manager maintains two separate views of
a process’s address space:
A logical view describing instructions concerning
the layout of the address space.
The address space consists of a set of non
overlapping regions, each representing a
continuous, page-aligned subset of the address
space.
52. The paging system can be divided into two
sections:
Policy algorithm:
decides which pages to write out to disk and
when to write them.
Paging mechanism:
carries out the transfer and pages data back
into physical memory when they are needed
again.
53. Linux is easy to install!
Errors in the code itself are far more likely to be caught
and quickly fixed under the watchful eyes of peers.
Kernel of the Linux can be customized to user’s needs.
Under Linux user can run any program allowed by the
system administrator on server without having to
redesign that program.
Under the GPL system programmers can release code
without the fear of being used
54. Linux is less vulnerable to computer
malware! Because most
computer malware are designed to
attack Windows (often through Active X which is
not typically found in Linux)
the odds are considerably less for Linux to be
infected with a virus than Windows
The same holds true with spyware, trojans,
and worms. While Linux malware does exist, they
are relatively few in number and none have
become widespread so far