Professional Documents
Culture Documents
Operating System Pre Course Work Material
Operating System Pre Course Work Material
Material
Operating Systems
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
Registers
Cache
GROWING SPEED AND COST
Main Memory
Magnetic tape
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 required by
all the upper levels.
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 slots. Small equal
sized time slots are defined and allocated to the
processes.
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
Director Content
y
/bin Common programs, shared by the system, the
system administrator and the users.
/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 Contains references to all the CPU peripheral
hardware, which are represented as files with special
properties.
/etc Most important system configuration files are in /etc,
this directory contains data similar to those in the
Control Panel in Windows
/home Home directories of the common users.
Directory Content
…
/ Every partition has a lost+found in its upper directory. Files
lost+foun that were saved during failures are here.
d
/misc For miscellaneous purposes.
/mnt Standard mount point for external file systems, e.g. a CD-ROM
or a digital camera.
/net Standard mount point for entire remote file systems
/opt Typically contains extra and third party software.
/proc A virtual file system containing information about system
resources. More information about the meaning of the files in
proc is obtained by entering the command man proc in a
terminal window.
/root The administrative user's home directory. Mind the difference
between /, the root directory and /root, the home directory of
the root user.
/sbin Programs for use by the system and the system administrator.
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 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. 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 a situation that the next day
the network doesn’t work. Securing the components of the system
against these kinds of problems is known as Protection.
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!!!!