You are on page 1of 39

Computer Fundamentals

(CS-101 & CS-101L)

Lecture 2
Lecture Overview

• Operating Systems
• Functions of Operating System
• Types of Operating System
• Difference Between DOS and WINDOWS
Operating System
 Operating system (OS) is a set of programs that manages all
computer components and operations.
 It acts as an intermediary between users and system
hardware.
 Goals:
 Execute user programs and make solving user problems easier
 Make the computer system convenient to use
 Use the computer hardware in an efficient manner
Functions of OS
 Following are the functions of OS:
1. Booting
2. Memory management
3. Loading and execution
4. Data Security
5. Disk Management
6. Process Management
7. Device Controlling
8. Provide Interface
4
Functions of OS (Cont)
1. Booting: OS starts the computer to work.
It checks the computer and makes it ready
to work.
2. Memory Management: OS manages the
memory. Different programs and data
execute in memory at one time. Without
OS, programs may mix with each other.

5
Functions of OS (Cont)
3. Loading and Execution: A program is loaded in
the memory before execution. OS provides the
facility to load programs in memory easily and
then execute it.
4. Data Security: OS protects the data stored on
system from illegal use, modification and deletion.
5. Disk Management: OS manages the disk space. It
manages the stored files and folders in proper way.

6
Functions of OS (Cont)
6. Process Management: CPU performs one task at a time. In
case of many tasks, OS decides which task should get CPU.
7. Device Controlling: OS controls all the devices attached to
the system. The hardware components are controlled by
small softwares called device drivers.
8. Provide interface: user interface is used to interact with
computer. It controls how you enter data and instruction and
how information is displayed. OS provide two types of
interface
 Command line interface
 Graphical user interface

7
Process Management Activities
The operating system is responsible for the following
activities in connection with process management:

Creatingand deleting both user and system processes


Suspending and resuming processes
Providing mechanisms for process synchronization
Providing mechanisms for process communication
Providing mechanisms for deadlock handling
Memory Management
 All data in memory before and after processing
 All instructions required in memory in order to
execute
 Memory management activities
 Keeping track of which parts of memory are currently
being used and by whom
 Deciding which processes (or parts thereof) and data to
move into and out of memory
 Allocating and deallocating memory space as needed
Storage Management
 OS provides uniform, logical view of information
storage
 File-System management
 Files usually organized into directories
 Access control on most systems to determine who can
access what
 OS activities include
 Creating and deleting files and directories
 Primitives to manipulate files and directories
 Mapping files onto secondary storage
 Backup files onto stable (non-volatile) storage media
Information Protection and Security
 Availability
 Protecting the system against interruption
 Confidentiality (access control)
 Assuring that users cannot read data for which access is
unauthorized
 Data integrity (access control)
 Protection of data from unauthorized modification
 Authenticity (login)
 Proper verification of the identity of users and the validity of
messages or data
Protection and Security
Most OS maintain UIDs to generally first distinguish
among users, to determine who can do what:
 User identities (user IDs, security IDs) include name and
associated number, one per user
 User ID then associated with all files, processes of that user to
determine access control
 Group identifier (group ID) allows set of users to be defined
and controls managed, then also associated with each process,
file. E.g. in UNIX a file owner may perform all operations on
a file while the group members may only be allowed to read a
file.
 Privilege escalation allows user to change to effective ID
with more rights
I/O Protection
 The I/O system must protect against either
accidental or deliberate incorrect I/O.
 All I/O instructions are privileged instructions.
 User applications are not allowed to perform I/O in
user mode - All I/O requests are handled through
system calls that must be performed in kernel
mode.
Memory Protection
There are two registers: base and limit.
Base register is the smallest legal physical memory.
Limit register is the size of the range.
Memory Protection
Every CPU address generated in user mode is
compared with the base and limit registers.
Note: Base and limit registers can only be loaded by
OS which uses a privileged instruction to do so.
CPU Protection
CPU protection is needed to prevent a user program
from getting stuck in an infinite loop and never
returning control to the OS.

A timer is used to prevent this. The timer is set to


interrupt, say every N msecs. The OS then switches
the CPU to another process in a multitasking OS.
The Three Elements of an OS

 User Interface – The part of the OS that you interface with.


 Kernel – The core of the OS. Interacts with the BIOS (at one
end), and the UI (at the other end).
 File Management System – Organizes and manages files.
Types of Operating Systems
1. Batch OS
2. Single program OS
3. Multi program OS
4. Time sharing OS
5. Real time OS

18
Batch Operating systems
 Users do not interact directly with the computer.
 Each user prepares his job on an off-line device like punch
cards and submits it to the computer operator.
 To speed up processing, jobs with similar needs are
batched together and run as a group.
Punch Card:
It is apiece of stiff paper that continued either commands for
controlling automated machinery or data for data processing
applications. Both commands and data were represented by
presence or absence of holes in predefined positions.
Problems with batch OS
 Lack of interaction between user and job
 Difficult to provide desired priority.
 CPU is often idle, because the speed of the I/O devices are
slower than CPU
Single Program OS

 Processor must wait for I/O instruction to complete before


preceding
Multi program OS

 Processor has more than one program to execute


 The sequence in which the programs are executed depends
on their relative priority and whether they are waiting for
I/O
 After an interrupt handler completes, control may not
return to the program that was executing at the time of the
interrupt
Multi program OS
Time Sharing OS
 Time sharing is a technique which enables many people,
located at various terminals, to use a particular computer
system at same time.
 Time sharing or multitasking is logical extension in
which CPU switches jobs so frequently that users can
interact with each job while it is running . Processor’s
time which is shared among multiple users simultaneously
is termed as time sharing.
Time Sharing OS (Cont)
Advantages:
 Provide quick response
 Avoids duplication of software
 Reduces CPU idle time

Disadvantages:
 Problem of reliability
 Problem of data communication
 Question of security of user programs and data
Distributed OS
 Use multiple central processors to serve multiple real time
application and multiple users. Data processing jobs are
distributed among the processors accordingly to which
one can perform each job most efficiently.
 It is also known as Multiprocessing OS.
Distributed OS
Advantages:
 Speedup the exchange of data with one another via
electronic email
 With resource sharing facility user at one site may be able
to use the resources available at another
 Better service to customers
 Reduction of load on host computer
 Reduction of delays in data processing
 If one site fails, the remaining sites can continue operating
Network OS
 It runs on a server and provides server the capability to
manage data, users, groups, security, applications and
other networking functions.
 Primary purpose is to allow shared file and printer access
among multiple computers in a network, typically a local
area network (LAN).
NETWORK OPERATING SYSTEMS

 A network operating system is an operating system that is


designed specifically to support a network.
 An network operating system typically resides on a server.
 The client computers on the network rely on the server(s)
for resources.
 Examples of network operating systems include Windows
Server 2003, UNIX, Linux, Solaris, and NetWare.
Network OS
Advantages:
 Centralized servers are highly stable
 Security is server managed
 Upgrades to new technologies and hardware can be easily
integrated into the system
Disadvantages:
 High cost of buying and running a server
 Dependency on a central location for most operations
 Require regular maintenance
Real Time OS (RTOS)
 Real time system is defined as a data processing system in
which the time interval required to process and respond to
inputs is so small that it controls the environment.
 Real time processing is always on line whereas on line
system need not be real time.
 Types of real time OS:

1. Hard RTOS
2. Soft RTOS
Hard real time OS
 It guarantee that critical tasks complete on time.
 Secondary storage is limited or missing with data stored in
ROM.
 In these systems virtual memory is almost never found.
Soft Real Time OS
 These systems are less restrictive.
 Critical real time task gets priority over the other tasks and
retains the priority until it completes.
 These systems have limited utility than Hard RTOS
Stand Alone OS
 A stand-alone OS is a complete operating system that
works on a desktop computer, notebook computer, or
mobile computing device.
 Some stand-alone operating systems are called client
operating systems because they also work in conjunction
with a net- work operating system.
 Examples of currently used stand-alone operating systems
are Windows XP, Windows Vista, Mac OS X, UNIX, and
Linux.
EMBEDDED OPERATING SYSTEMS

 The operating system on most PDAs (personal digital


assistant) and small devices, called an embedded
operating system, resides on a ROM chip. Popular
embedded operating systems include Windows CE,
Windows Mobile, Palm OS, BlackBerry, embedded
Linux, and Symbian OS
Difference between windows and DOS
DOS WINDOWS
Definition Disk Operating system Windows is a range of
(DOS) are simple text graphical interface
command operating operating systems that
systems that were are developed by
popular from 1981 to Microsoft.
1995.
User Interface DOS used a text based Windows uses graphics,
interface that required images and text.
text and codes to
operate.
Input System Text is used as basic Use a mouse for all
input system commands. operating system input.
Multitasking DOS is unable to run Windows is a
multiple processes at the multitasking OS
same time. allowing more than one
process to work
simultaneously.
Difference between windows and DOS
DOS WINDOWS
Storage Size The highest amount of Window systems offer
storage size available is storage space up to 2
2GB. terabyte.
Demands on system Booting up system is Booting up windows is
Resources DOS less demanding on more demanding on
CPU. CPU.

Current uses More ideally used for Used worldwide as the


prototyping, testing and most popular OS.
making automated
systems.

Memory Space DOS requires less Windows requires more


memory space to be memory space to be
installed. installed.
Difference between windows and DOS
DOS WINDOWS
Registry and swap files DOS uses a directory Windows uses a
system, where all the different registry
files are contained compared to DOS,
within a particular making it difficult to
directory or mutually delete
subdirectory. programs. An excessive
number of temporary
files and file fragments
can cause the system to
slow down or crash
File System DOS only supports 16- Windows support 16 and
bit file system. 32 bit file system.
Price DOS is free or cheaply Windows is costly.
available.
Book Reference
 Discovering Computer fundaments by shelly Vermaat
chapter 7 (page 251-267)
 Computer science and Overview by j. Glenn Brook Shear
chapter 3
 Computer Application by Tasleem Mustafa chapter 3
(page 61-65, 73)

You might also like