Professional Documents
Culture Documents
Dhindsa © 2007
Lecture Series By :
1
LINUX -- HISTORY
• Linux is a modem, free operating system based on UNIX
standards.
• First developed as a small but self-contained kernel in
1991 by Linus Torvalds, with the major design goal of
UNIX compatibility.
• Its history has been one of collaboration by many users
from all around the world
• It has been designed to run efficiently and reliably on
common PC hardware, but also runs on a variety of other
platforms.
• The core Linux operating system kernel is entirely original,
but it can run much existing free UNIX software, resulting
in an entire UNIX-compatible operating system free from
proprietary code. 2
O.S. by Er. K.S.Dhindsa © 2007
LINUX -- HISTORY
4
O.S. by Er. K.S.Dhindsa © 2007
LINUX SYSTEM
• Linux uses many tools developed as part of Berkeley’s BSD
operating system, MIT’s X Window System, and the Free
Software Foundation's GNU project.
• The min system libraries were started by the GNU project,
with improvements provided by the Linux community.
• Linux networking-administration tools were derived from
4.3BSD code
• The Linux system is maintained by a loose network of
developers collaborating over the Internet, with a small
number of public ftp sites acting as de facto standard
repositories.
5
O.S. by Er. K.S.Dhindsa © 2007
LINUX LICENSING
6
O.S. by Er. K.S.Dhindsa © 2007
DESIGN PRINCIPLES
Module management
Driver registration
Conflict resolution 9
O.S. by Er. K.S.Dhindsa © 2007
Reg. Tables & Conflict resolution
10
O.S. by Er. K.S.Dhindsa © 2007
PROCESS CONTEXT
11
O.S. by Er. K.S.Dhindsa © 2007
PROCESS CONTEXT
Whereas the file table lists the existing open files, the
file-system context applies to requests to open new files.
The current root and default directories to be used for new
file searches are stored here
12
O.S. by Er. K.S.Dhindsa © 2007
PROCESSES & THREADS
14
O.S. by Er. K.S.Dhindsa © 2007
Interrupt Protection Levels
16
O.S. by Er. K.S.Dhindsa © 2007
PROCESS SCHEDULING
Linux 2.0 was the first Linux kernel to support SMP hardware;
separate processes or threads can execute in parallel on
separate processors.
MEMORY MANAGEMENT
18
O.S. by Er. K.S.Dhindsa © 2007
Splitting of Memory in a HEAP
25
O.S. by Er. K.S.Dhindsa © 2007
BLOCK DEVICES
26
O.S. by Er. K.S.Dhindsa © 2007
INTERPROCESS COMMUNICATION
28
O.S. by Er. K.S.Dhindsa © 2007
Network Structure
29
O.S. by Er. K.S.Dhindsa © 2007
Network Structure
– On top of the routing protocol are built the UDP, TCP and
ICMP protocols
30
O.S. by Er. K.S.Dhindsa © 2007
SECURITY IN LINUX
31
O.S. by Er. K.S.Dhindsa © 2007
SECURITY IN LINUX
1) The user types a command after the shell prompt and sends it to the
shell;
2) The shell determine whether it is a built-in command or if it is an
application program. If it is an application program, it locates the
application in the directories listed in the shell's search path and inform
the kernel;
3) When ready, the kernel then tell the shell to run the application;
4) The shell launch the application; The user interacts with the application
directly;
5) The shell maintains the necessary data flow between the application35and
kernel.
Linux Execution Environment
MATH
APPLICATION (mpg123) LIBRARY
• Program
• Libraries
STANDARD C
LIBRARY
b
OPERATING SYSTEM
Network
Subsystem
Memory
Manager
File System
Devices
Character
Devices
Architecture
Dependent
Code
• Kernel
subsystems
Disk
task
list task task task task
struct struct struct struct
37
O.S. by Er. K.S.Dhindsa © 2007
The ‘States’ of A Linux Process
38
State-transition Diagram
UNINTERRUPTIBLE
RUNNING INTERRUPTIBLE
create event
schedule
signal wait
preempt
STOPPED
ZOMBIE
39
‘Program’ Versus ‘Process’
40
GNU Project & LINUX
GNU project
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
GNU is a recursive acronym for “GNU's Not Unix”
– Stallman built the first free GNU C Compiler in 1991. But still, an
OS was yet to be developed
Beginning of Linux
– A famous professor Andrew Tanenbaum developed
Minix, a simplified version of UNIX that runs on PC
– Minix is for class teaching only. No intention for
commercial use
– 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 41
Linux version 0.0.1 O.S. by Er. K.S.Dhindsa © 2007
Linux Pros and Cons
Advantages over Windows
– It's almost free to relatively inexpensive
– Source code is included
– Bugs are fixed quickly and help is readily available
through the vast support in Internet
– Linux is more stable than Windows
– Linux is truly multi-user and multi-tasking
– multiuser: OS that can simultaneously serve a number of users
– multitasking: OS that can simultaneously execute a number of
programs
– Linux runs on equipment that other operating systems
consider too underpowered, e.g. 386 systems, PDA, etc
42
O.S. by Er. K.S.Dhindsa © 2007
Linux Pros and Cons (Cont)
Disadvantages compared with Windows
– My program cannot run on Linux
– Isn't as popular as Windows
– No one commercial company is responsible for Linux
– Linux is relatively hard to install, learn and use
43
O.S. by Er. K.S.Dhindsa © 2007
LINUX SYSTEM ARCHITECTURE
44
LINUX SYSTEM ARCHITECTURE
Kernel
– The part of an OS where the real work is done
System call interface
– Comprise a set of functions (often known as API) that
can be used by the applications and library routines
to use the services provided by the kernel
Application User’s Interface
– Interface between the kernel and user
– Allow user to make commands to the system
– Divided into text based and graphical based
45
File Management
– Control the creation, removal of files and provide directory
maintenance
– For a multiuser system, every user should have its own right to
access files and directories
Process Management
– For a multitask system, multiple programs can be executed
simultaneously in the system
– When a program starts to execute, it becomes a process
– The same program executing at two different times will become
two different processes
– Kernel manages processes in terms of creating, suspending,
and terminating them
– A process is protected from other processes and can
communicate with the others 46
Memory management
– Memory in a computer is divided into main memory
(RAM) and secondary storage (usually refer to hard disk)
– Memory is small in capacity but fast in speed, and hard
disk is vice versa
– Data that are not currently used should be saved to hard
disk first, while data that are urgently needed should be
retrieved and stored in RAM
– The mechanism is referred as memory management
Device drivers
– Interfaces between the kernel and the BIOS
– Different device has different driver
47
Linux File Management
50
O.S. by Er. K.S.Dhindsa © 2007
SECURITY IN UNIX
51
O.S. by Er. K.S.Dhindsa © 2007
The Linux File System
52
THREADS
53
O.S. by Er. K.S.Dhindsa © 2007
54