Professional Documents
Culture Documents
Operating System
Operating System
Operating System
Material
Operating S ystems
1.
2.
3.
CONTROL UNIT
OUTPUT
ALU
INPUT: Input devices (Keyboard, Mouse etc.) (RAW MATERIALS)
OUTPUT: Output devices (VDU, Printers etc. ) (FINISHED PRODUCTS)
MEMORY: Main memory (Volatile commonly known as RAM)
(GODOWN / INVENTORY)
CONTROL UNIT: A device that generates Signals to command other units that what to do
and what not to. (TOP MANAGEMENT)
ALU: Arithmetic Logic Unit The unit that performs the computations. (MACHINES)
Registers
GROWING SPEED AND COST
Cache
Main Memory
Magnetic tape
Memory Hierarchy
Objectives of an OS
It is a program that
Objectives of an O.S.
Convenience of use of the computer
End user
Utilities
Programmer
Operating System
Computer Hardware
OS System
Designer
Access to I/O devices Each I/O device has its own set of
Instructions and control signals. O.S. hides these details to provide a
common interface to the user/programmer.
Controlled access to files- nature of I/O device (disk drive, tape drive) and
structure of the data stored in the files in the storage medium. In the case of
multiple users accessing the processor concurrently, proper protection
mechanisms have to be used.
System access- For shared or public systems, the O.S. controls access to
the system as a whole and to specific system resources. Access system provides
protection of resources, and data from unauthorized users, and resolves resource
conflicts
Error detection and response Variety of errors may occur in computer
system. Responses may range from program termination, retrial of the same
operation, or reporting error to the application.
Accounting collecting usage statistics, CPU usages, monitor
performance, etc.
Shell
Kernel and
system software
Users
Other Applications
My God
Techniques of Multiprocessing
Multiprogramming
Timesharing
Note that Multiuser is maintained using multiprocessing techniques especially
timesharing technique.
P1
Run
P2
Wait
P3
P1, P2, P3
Wait
Run
Wait
Run
Wait
Run
Run
Run
Run
Wait
Run
Wait
Wait
Run
Wait
Run
Run
Any Advantage?
Run
Wait
Wait
So what is timesharing?
P1
P2
P3
P1 Completed
So which is better?
Multiprogramming or Timesharing
Processes
A process is
Normal: A program in state of execution
Waste of words: An instance of a program running on a computer
Fundoo: The entity that can be assigned to and executed on a
processor
More fundoo?... A unit of activity characterized by a single
sequential thread of execution, a current state, and an associated
set of system resources
Parts of a Process
Components of a process
An executable program
Associated data required by the program (variable, work space, buffer,
etc.)
Execution context: internal data used by O.S. to supervise a process =
process state.
Process list
Main memory
Program code
data
context
Program code
data
context
program to be executed.
Memory pointers: pointers to the program code and data
associated with the process, and any shared memory blocks
Context data: Data in the registers in the processor during
process execution.
I/O status information: outstanding I/O requests, I/O devices
allocated to the process, a list of files is use by the process, etc.
Accounting information: amount of processor time, etc.
Other fundas
Resource Management
Responsibilities of the OS in Resource Management
Scheduling The management of the queue of processes so as to make
the decisions of when to execute which process.
O.S. manages the resources of a computer system and rations them
among the processes.
Factors for scheduling policy:
Fairness: processes competing for a resource should be given fair chance
of resource access
Differential responsiveness: O.S. should make allocation and scheduling
decisions to meet total set of requirements, and in a dynamic manner. E.g., if
a process is waiting for an I/O device, O.S. may schedule that process as
soon as the device is free.
Efficiency: Maximize throughput, minimize response time, and
accommodate as many concurrent users as possible.
Memory Management
The OS manages the computers memory and allocates
memory to processes and data.
Out of various memory management schemes the mot used
nowadays is Virtual Memory. The fundas for Virtual
Memory are given below
1. A facility that allows programs to address memory from a logical viewpoint
2. Disregards the amount of physical memory actually available
3. Meets the requirements of multiple user processes to reside
simultaneously in main memory without any interference
4. (Demand) Paging system and Page faults
5. Address of a word of a program = page number + offset within page
6. Pages vs. Blocks mapping
Physical memory is not alone now !!!
It uses a fast disk (Backing store) to keep the parts of the
processes not in use at the moment of time.
The process's memory (also called logical memory) is
divided into pages of equal size and kept in the backing
store. The pages are brought in t the physical memory as
and when required.
The pages are kept in blocks created in the physical
memory called frames. The sizes of frames and pages are
equal. The allocation of block to a page depends upon the
allocation policy used by the system.
root
bin
donkey
home
monkey
dev
etc
yankee
usr
bin
sbin
america schedule
washington
I am a
directory
texas
california
I am a file
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:
Content
/bin
/boot
The startup files and the kernel, vmlinuz. In recent distributions also grub
data. Grub is the GRand Unified Boot loader and is an attempt to get rid
of the many different boot-loaders we know today.
/dev
/etc
/home
/initrd
/lib
Library files, includes files for all kinds of programs needed by the system
and the users.
Directory
Content
/lost+found
Every partition has a lost+found in its upper directory. Files that were saved during
failures are here.
/misc
/mnt
Standard mount point for external file systems, e.g. a CD-ROM or a digital camera.
/net
/opt
/proc
/root
The administrative user's home directory. Mind the difference between /, the root
directory and /root, the home directory of the root user.
/sbin
/tmp
/usr
/var
Storage for all variable files and temporary files created by users, such as log files,
the mail queue, the print spooler area, space for temporary storage of files
downloaded from the Internet, or to keep an image of a CD before burning it.
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. Whatever is written to the file gets written to the memory
an vice versa. The shared memory concept is implemented in
this way.
Continued
Spoofing This is a method to access a system one is not
meant to access. The intruder takes form of a valid user or
process and enters the system.
Phising This is a hacking method very much in use nowadays.
The intruder creates a login screen similar to some well known
site or system (Yahoo/ Google/ Unix or Linux login screen) and
puts in online. Some way the fake login screen is run when the
user needs to login. The user delivers the username and
password without the knowledge of what is actually happening
and this data is stored to a database accessible by the intruder.
Continued
Encryption However good a password is, it is of no use without a good
encryption algorithm protecting it. Encryption is a technique of generating a
new text by applying some functions on the original text. The new text is
called Cipher text. Some encryption algorithms allow the Cipher text to be
Decrypted to the original text and some dont.
Encryption Key
Plaintext
P
A
Encryption
Algorithm
Decryption Key
Ciphertext C
Decryption
Algorithm
Plaintext
P
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
system adds to the loopholes.
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. Lets 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 a situation that the next
day the network doesnt work. Securing the components of the
system against these kinds of problems is known as Protection.
file1
CD Writer
user1
Write
Read
execute
Read
user2
read
Read
Write
Happy Studying!!!!