Escolar Documentos
Profissional Documentos
Cultura Documentos
Material
Operating S ystems
Basic Principles of Operating Systems
No.
1. What if there is no interface to the key board?
2. What if there is nothing that will control the
output to VGA card?
3. What if there is no interface to the human user
so that he can switch on “MS Word “ ?
Yes the answers to all these questions is operating
system.
ALU
Cache
GROWING SPEED AND COST
Main Memory
Magnetic tape
Objectives of an OS
• It is a program that
controls the execution of application programs
acts as an interface between applications and
computer hardware
manages the resources associated with a
computer
Objectives of an O.S.
Convenience of use of the computer
Utilities
Programmer
Operating System
Shell
Kernel and
system software
Users
Other Applications
What the hell are
these…..
• User – The system representation of the
human operator who requests for services.
• Application Software – Special software to
help the user do his task (E.g.. MS Word)
• Shell – The program that interprets the
commands or requests given by the user
and gets the job done by the kernel.
• Kernel – The core of the operating system.
It uses the hardware to do the jobs required
by the user or the system. It coordinates
among the hardware and interfaces it with
the above layers.
• System Software – Software that can
access the hardware directly and generally
provides various system services. (E.g.. The
kernel itself, device drivers etc.).
• Hardware – The set of electronic devices
that work together to ultimately do the job
Why Unix or Linux?
How the hell are they different from
others?
Techniques of Multiprocessing –
• Multiprogramming
• Timesharing
Note that Multiuser is maintained using
multiprocessing techniques – especially timesharing
technique.
Multiprogramming: When one process
waits to get some job done which does
not requires the CPU, instead of sitting
idle the CPU picks up another process to
work on.
Timesharing: The CPU time is equally
divided among the processes in small
Closer look to the above
techniques
P1, P2, P3 are three different
Multiprogramming
processes
P1 Run Wait Run Wait
P1, P2, P3 Run Run Run Wait Run Run Run Wait
Any Advantage?
So what is timesharing?
P1
P2
P3
I/O Started by P1
So which is better?
Multiprogramming or Timesharing
Program code
Program code
context
context
data
data
Process Control Block
A data structure by which the system
identifies a process.
It contains -
• Identifier: A unique integer associated with a
process
• State : A currently executing process is in
running state
• Priority : Priority level relative to other
processes
• Program counter : Address of the next
instruction of the
program to be executed.
• Memory pointers: pointers to the program
code and data
associated with the process, and any shared
Other fundas…
Resource Management
Responsibilities of the OS in Resource
Management
america schedule
The above diagram is only a part of the file system. The tree can be
bigger and any number of nodes can exist under another.
Typical example of a
DOS/Windows file system.
The names of common directories have been left to
the reader to fill up.
C: D:
/ /
Directory Structure of
Linux File System
Direct
Content
ory
Common programs, shared by the system, the
/bin
system administrator and the users.
The startup files and the kernel, vmlinuz. In recent
distributions also grub data. Grub is the GRand
/boot
Unified Boot loader and is an attempt to get rid of
the manyreferences
Contains different boot-loaders weperipheral
to all the CPU know today.
/dev hardware, which are represented as files with
special properties.
Most important system configuration files are in
/etc /etc, this directory contains data similar to those in
the Control Panel in Windows
/home Home directories of the common users.
(on some distributions) Information for booting. Do
/initrd
not remove!
Library files, includes files for all kinds of programs
/lib
needed by the system and the users.
Directo
ry
Content
…
/lost+fou Every partition has a lost+found in its upper directory. Files
nd that were saved during failures are here.
/misc For miscellaneous purposes.
Standard mount point for external file systems, e.g. a CD-
/mnt
ROM or a digital camera.
/net Standard mount point for entire remote file systems
/opt Typically contains extra and third party software.
A virtual file system containing information about system
resources. More information about the meaning of the files in
/proc
proc is obtained by entering the command man proc in a
terminal window. user's home directory. Mind the
The administrative
/root difference between /, the root directory and /root, the home
directory
Programs of
forthe
useroot
by user.
the system and the system
/sbin
administrator.
/tmp Temporary space for use by the system.
Programs, libraries, documentation etc. for all user-related
/usr
programs.
Storage for all variable files and temporary files created by
users, such as log files, the mail queue, the print spooler
/var
area, space for temporary storage of files downloaded from
the Internet, or to keep an image of a CD before burning it.
Some important concepts
Data Communication
Data Communication is an important function of
the Operating System.
Communication always takes place between two
processes. This is because processes are the
only active entity inside a computer system.
The punch word in Data Communication is IPC
(Inter Process Communication). IPC is the
communication of data between two
processes.
Different Techniques of IPC are
Message Passing – Data is sent from one
process to another via the kernel and other
subsystems.
Some technologies to
implement the IPC concepts
• Pipes – A virtual data flow is established
between two processes. The shared
memory concept is implemented using
pipes.
• Sockets – A logical connection point is
opened for a process. The kernel an
network subsystems take responsibility
to efficiently manage the sending and
receiving of data. The message passing
concept is implemented in this way.
• Memory Mapped Files – A portion of
the memory is mapped to a file.
Security and Protection
The system may be vulnerable to
attacks
More the functionalities in the
system more the loop holes and
more vulnerable to external or
internal attacks
A B
Continued
Antiviruses – These are programs which
catch Viruses (Nowadays they detect all
malicious programs – Trojans, Worms etc.)
either when they are resident on the disk in
some form or when trying to enter the
system from some source.
Firewalls – Firewall blocks access of the
system by any means from some specified
external machines. So we create a firewall
against some machine if we distrust it.
However inspite of all these security
measures, 100% security can never be
ensured as any functionality in the
Protection
The components in a system can also be
vulnerable to internal malfunctioning. Just
consider the situation that normal users
are allowed to add new users. So any
body can be bribed or made to create a
new user which makes intrusion so easy.
Let’s take another situation. Just suppose
that a normal user can modify the
configuration file that contains
information for the network configuration.
As he does not have the knowledge of the
full network, his modifications may lead to
Ways to ensure protection
The most widely used technique for ensuring
protection is maintaining an access matrix. The
components of the system are called entities. A
matrix is maintained with the “entities to protect” on
one axis and “entities to protect from” on the other.
The cell corresponding to these two contain the
access rights (Who can access what).
file1 CD Writer
Happy Studying!!!!