Download - Mitra.ac.in

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

MTS system architecture wikipedia , lookup

Mobile operating system wikipedia , lookup

Library (computing) wikipedia , lookup

Copland (operating system) wikipedia , lookup

Unix wikipedia , lookup

Berkeley Software Distribution wikipedia , lookup

RSTS/E wikipedia , lookup

Distributed operating system wikipedia , lookup

VS/9 wikipedia , lookup

CP/M wikipedia , lookup

Plan 9 from Bell Labs wikipedia , lookup

Burroughs MCP wikipedia , lookup

Mandriva Linux wikipedia , lookup

Linux wikipedia , lookup

Process management (computing) wikipedia , lookup

Linux kernel wikipedia , lookup

Caldera OpenLinux wikipedia , lookup

Spring (operating system) wikipedia , lookup

DNIX wikipedia , lookup

Linux adoption wikipedia , lookup

Unix security wikipedia , lookup

Smallfoot wikipedia , lookup

Security-focused operating system wikipedia , lookup

Transcript
THE LINUX SYSTEM
CHAPTER 6
Designed by .VAS
LINUX HISTORY
• In the early 1990s, Linus Torvalds became interested in a freeware
product called Minix were written by Andrew S. Tanenbaum.
• Minix was a clone of the commercial UNIX operating system.
• Linux version 0.02, released on October 5, 1991, consisted of only
the Linux kernel and three utilities:
■ bash : a command-line interface
■ update : a utility for flushing file system buffers
■ gcc : a C++ compiler
LINUX HISTORY . . .
• THE FIRST LINUX KERNEL RELEASED TO THE PUBLIC WAS VERSION 0.01, DATED MAY
14,1991.
• IT HAD NO NETWORKING , RAN ONLY ON 80386- COMPATIBLE INTEL PROCESSORS
AND PC HARDWARE ,AND HAD EXTREMELY LIMITED DEVICE- DRIVER SUPPORT.
• THE LINUX SYSTEM AS A WHOLE IS MAINTAINED BY A LOOSE NETWORK OF
DEVELOPERS COLLABORATING OVER THE INTERNET, WITH SMALL GROUPS OR
INDIVIDUALS.
• THE FILE SYSTEM HIERARCHY STANDARD DOCUMENT IS ALSO MAINTAINED BY THE
LINUX COMMUNITY AS A MEANS OF KEEPING COMPATIBILITY ACROSS THE VARIOUS
SYSTEM COMPONENTS.
LINUX DISTRIBUTION
• TODAY THERE ARE HUNDREDS OF DIFFERENT DISTRIBUTIONS AVAILABLE POPULAR
LINUX DISTRIBUTIONS INCLUDE
■ SUSE LINUX
■ TURBOLINUX
■ FEDORA LINUX
■ MANDRAKE LINUX
■ RED HAT ENTERPRISE LINUX ■ LYCORIS LINUX
■ DEBIAN LINUX
■ CENTOS
■ LINSPIRE
■ ALT LINUX
■ GENTOO LINUX
■ UBUNTU
■SLACKWARE LINUX
DESIGN PRINCIPLES
• LINUX RESEMBLES ANY OTHER TRADITIONAL ,NON MICRO KERNEL UNIX
IMPLEMENTATION.
• IT IS A MULTIUSER , MULTI TASKING SYSTEM WITH A FULL SET OF UNIXCOMPATIBLE TOOLS.
• ALTHOUGH LINUX RUNS ON A WIDE VARIETY OF PLATFORMS , IT WAS DEVELOPED
EXCLUSIVELY ON PC ARCHITECTURE.
• MORE POWERFUL AND AS MEMORY.
• SPEED AND EFFICIENCY ARE STILL IMPORTANT DESIGN GOALS .
• STANDARDIZATION - PORTABLE OPERATING SYSTEM INTERFACE (POSIX)
COMPONENTS OF A LINUX SYSTEM
• 1- THE KERNEL : it is s in charge for maintaining all the vital
abstractions of the operating system .
• The linux kernel forms the central part of linux operating system. It
provides all the functionality compulsory to run processes, and it also
provides "system services"
• 2- THE SYSTEM LIBRARIES: "The system libraries" describe a typical
set of functions through which applications can interrelate through the
kernel.
COMPONENTS OF A LINUX SYSTEM . . .
• 3- THE SYSTEM UTILITIES: "The system utilities" are the programs that
execute individual, particular and specialized managing tasks.
• Some of the system utilities may be invoked just once to initialize and
configure some features of the system .
• Others (known as daemons in UNIX language ) may run enduringly,
conducting such tasks as responding to inward or incoming network
connections
KERNEL MODULES
• The linux kernel has the ability to load and unload arbitrary sections
of kernel code on demand.
• Kernel modules are convenient for several reasons.
• Linux's source code is free ,so anybody wanting to write kernel
code is able to compile a modified kernel and to reboot to load that
new functionality.
• If you use kernel modules ,you do not have to make a new kernel to
test a new driver.
KERNEL MODULES . . .
• Kernel modules allow a linux system to be setup with a standard ,
minimal kernel , without any extra device drivers built-in.
• Any device drivers that the user need scan be either loaded
explicitly by the system at startup or loaded automatically by the
system on demand and unloaded when not in use.
• For example , a CD-ROM driver might be loaded when a CD is
mounted.
• Components : - Module management , Driver registration ,
Conflict-resolution mechanism .
PROCESS MANAGEMENT
• A process is the basic context within which all user-requested activity is
serviced within the operating system.
• The fork() and exec() Process Model
• Process ID (PID) . Credentials . Personality . (Process Identity)
• Process Context - In contrast to Process identity , process context
is the state of the running program at any one time ; it changes
constantly .
PROCESS MANAGEMENT . . .
Process context includes the following parts.
• Scheduling context.
• Accounting
• File table
• File-system context
• Signal-handler table
• Virtual memory context.
PROCESS MANAGEMENT . . .
• PROCESSES AND THREADS –
• Linux provides the fork() system call with the traditional functionality
of duplicating a process.
• Linux also provides the ability to create threads using the clone()
system call.
SCHEDULING
• Scheduling is the job of allocating CPU time to different tasks within an
operating system.
• Process scheduling - linux has two separate process-scheduling
algorithms.
• One is a time-sharing algorithm for fair, preemptive scheduling among
multiple processes;
• The other is designed for real-time tasks, where absolute priorities are
more important than fairness.
SCHEDULING . . .
The Linux scheduler is a
preemptive ,priority-based algorithm
with two separate priority ranges: a
real-time range from 0 to 99 and a
nice value ranging from 100 to 140.
These two ranges map into a
global
priority
numerically
lower
higher priorities.
scheme
values
whereby
indicate
SCHEDULING . . .
• KERNEL SYNCHRONIZATION :- The way the kernel schedules its own
operations is fundamentally different from the way it schedules
processes.
• A request for kernel-mode execution can occur in two ways.
1. Running program may request an operating-system service, either
explicitly via a system call or implicitly .
2. Alternatively, a device driver may deliver a hardware interrupt that
causes the cpu to start executing a kernel-defined handler for that
interrupt.
SCHEDULING . . .
• The linux 2.0 kernel was the first stable linux kernel to support
symmetric multiprocessor (SMP) hardware, allowing separate
processes to execute in parallel on separate processors.
MEMORY MANAGEMENT
• 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.
• Management of physical memory –
1. Zone_dma 2. Zonenormal 3. Zone_highmem
MEMORY MANAGEMENT . .
MEMORY MANAGEMENT . .
MEMORY MANAGEMENT . .
• Another strategy adopted by linux for allocating kernel memory is known
as slab allocation. A slab is used for allocating memory for kernel data
structures and is made up of one or more physically contiguous pages.
• A cache consists of one or more slabs and there is a single cache for each
unique kernel data structure .
MEMORY MANAGEMENT . .
VIRTUAL MEMORY
• The linux virtual memory system is responsible for maintaining 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.
• Kernel virtual memory – Linux reserves for its own internal use a constant
• The page-table entries that map to these kernel pages are marked as
protected, so that the pages are not visible or modifiable when the processor
is running in user mode
FILE SYSTEMS
• Linux retains unix's standard file-system model.
• Device drivers can appear as files, and inter process communication
channels or network connections also look like files to the user.
• The linux kernel handles all these types of file by hiding the
implementation details of any single file type behind a layer of
software, the virtual file system (vfs).
FILE SYSTEMS . . .
• The vfs defines four main object types:
1. An inode object represents an individual file.
2. A file object represents an open file.
3. A superblock object represents an entire file system.
4. A dentry object represents an individual directory entry.
FILE SYSTEMS . . .
• THE LINUX EXT2FS FILE SYSTEM
• The standard on-disk file system used by linux is called ext2fs, for
historical reasons.
• Linux was originally programmed with a Minix compatible file system
• File system was severely restricted by 14-character file-name limits and a
maximum file-system size of 64 MB.
• The Minix file system was superseded by a new file system, which was
christened the extended file system (extfs).
FILE SYSTEMS . . .
• Journaling file system - ( circular buffer system ) ext3 , ext4 .
journaling file systems are also typically faster than non-journaling
systems, as updates proceed much faster when they are applied to the
in-memory journal rather than directly to the on-disk data structures.
• Proc file system -not use for stored but computed only on demand
according to user file i/o requests. Also used for kernel's process
debugging support .
INPUT AND OUTPUT
• All device drivers appear as normal files . devices can appear as objects within
the file system .
• Linux splits all devices into three classes: block devices, character devices, and
network devices
INTER PROCESS COMMUNICATION
• Communication may be just a matter of letting another process know that
some event has occurred, or it may involve transferring data from one
process to another.
• Synchronization and signals –
• Signals can be sent from any process to any other process, with
restrictions on signals sent to processes owned by another user
• Internally, the linux kernel does not use signals to communicate with
processes running in kernel mode.
INTER PROCESS COMMUNICATION . . .
• Communication about incoming asynchronous events within the kernel is
performed through the use of scheduling states and wait_queue structures.
• PASSING OF DATA AMONG PROCESSES
• Linux offers several mechanisms for passing data among processes .
• The standard UNIX pipe mechanism allows a child process to inherit a
communication channel from its parent
• Data written to one end of the pipe can be read at the other.
• SHARED MEMORY
NETWORK STRUCTURE & SECURITY
• NETWORKING IS A KEY AREA OF FUNCTIONALITY FOR LINUX.
Refer remaining topics from BOOK OS
by … silbershatz