You are on page 1of 20

Operating Systems

Lecture 1
Computer System Structure
• Computer system can be divided into four
components:
– Hardware – provides basic computing resources
• CPU, memory, I/O devices
– Operating system
• Controls and coordinates use of hardware among various
applications and users
– Application programs – define the ways in which the
system resources are used to solve the computing
problems of the users
• Word processors, compilers, web browsers, database systems,
video games
– Users
• People, machines, other computers
Four Components of a Computer System
What is an Operating System?

• A program that acts as an intermediary


between a user of a computer and the
computer hardware
• Operating system 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
Operating System Definition

• OS is a resource allocator
– Manages all resources
– Decides between conflicting requests for efficient and fair
resource use
• OS is a control program
– Controls execution of programs to prevent errors and improper
use of the computer
• “The one program running at all times on the computer” is
the kernel.
• Everything else is either
– a system program (ships with the operating system) , or
– an application program.
Different views of OS
• User view OS can be defined in terms of ease of
use with some performance parameters

• From the computer’s or system’s point of view,


the operating system is the program most
intimately involved with the hardware. In this
context, we can view an operating system as a
resource allocator or utilizer.
Operating System Serves Two Basic Purposes

• Controls the allocation and use of


computing system resources among various
user and tasks.
• Provides interface between the computer
hardware and the programmer
Examples of OS
• Personal computer (PC) operating systems support
complex games, business applications, and
everything in between. Ex windows, linux, Ubuntu
etc.
• Operating systems for mobile devices provide an
environment in which a user can easily interface
with the computer/processor to execute application
programs
eg. Andriod, Symbian etc
• Mainframe operating systems are designed primarily
to optimize utilization of hardware. Ex  z/OS, z/VM
Functions of Operating Systems:

• Convenience: An operating system makes a


computer more convenient to use.

• Efficiency: An operating system allows the computer


system resources to be used in an efficient manner.
Operating system controls and coordinates the
use of the hardware among the various system
programs and application program for various users.
• Ability to evolve: An operating system is constructed
in such a way that it permits the effective
development, testing and introducing of new system
functions without any interference with its existing
services.
Tasks supported by operating system

• Provides the facilities to create, modify program and


data files using an editor.
• Access to the compiler for translating the user
program from high level language to machine
language.
• Provide a coder program to move compiled program
code to the computer’s memory for execution.
• Provides routine that handle the details of I/O
programming.
• Manages resources.
Operating System Functionalities

• Process Management
• Main-Memory Management
• File Management
• I/O System Management
• Secondary-Storage Management
• Networking
• Protection System
• Command Interpreter System
• Program execution
• Error detection
Process Management

A process is only ONE instant of a program in execution.


There are many processes can be running the same program.

The five major activities of an operating system in regard to


process management are:

• Creation and deletion of user and system processes.


• Suspension and resumption of processes.
• A mechanism for process synchronization.
• A mechanism for process communication.
• A mechanism for deadlock handling.
Main-Memory Management
Main-Memory is a large array of words or bytes. Each
word or byte has its own address.

The major activities of an operating system in regard


to memory-management are:

• Keep track of which part of memory are currently


being used and by whom.
• Decide which processes are loaded into memory
when memory space becomes available.
• Allocate and de allocate memory space as needed.
File Management
A file is a collection of related information
defined by its creator. Computer can store
files on the disk (secondary storage), which
provide long term storage.
• The creation and deletion of files.
• The creation and deletion of directories.
• The manipulating files and directories.
• The mapping of files onto secondary
storage.
• The backup of files on stable storage media.
I/O System Management
One of the purposes of an operating
system is to hide the peculiarities of
specific hardware devices from the
user.
Secondary-Storage Management

Generally speaking, systems have


several levels of storage, including
primary storage, secondary storage and
cache storage.

Instructions and data must be placed in


primary storage or cache to be referenced
by a running program.
Networking

The processors communicate with one


another through communication lines
called network.
Protection System
Protection refers to mechanism for controlling
the access of programs, processes, or users to
the resources defined by a computer system.

Command Interpreter System


A command interpreter is an interface of the
operating system with the user. The user gives
commands which are executed by operating
system (usually by turning them into system
calls).
Operating Systems operations

Program Execution

The system must be able to load a program into


memory and to run it.
The program must be able to end its execution, either
normally or abnormally (indicating error).

I/O Operations

A running program may require I/O.


This I/O may involve a file or an I/O device.

You might also like