0% found this document useful (0 votes)
30 views12 pages

CH - 1

Operating system

Uploaded by

vishal123msp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views12 pages

CH - 1

Operating system

Uploaded by

vishal123msp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

LECTURE NOTES

Design of Operating System


(CSE 4049)

Prepared by
Shreeya Swagatika Sahoo
Assistant Professor

Faculty of Engineering and Technology (ITER)


SIKSHA ‘O’ ANUSANDHAN (DEEMED TO BE) UNIVERSITY
Bhubaneswar, ODISHA
Declaration
This lecture note is prepared not to replace the prescribed text book(s). It is prepared to
provide a quick reference to the study material and make the students flexible to go around
the course in a systematic and elegant way. Students may use this lecture note for a brief
and complete coverage about the basic stuffs of the course.

Shreeya Swagatika Sahoo


Assistant Professor, CSE
Chapter 1

Introduction to Operating Systems,


Computer system organization

Lecture-1 PO 1

1.1 Introduction to operating System


What is an Operating System?
A program that acts as an intermediary between a user and the computer hardware.
Some examples of operating systems are Linux, Unix, MS-DOS, MS-Windows, Win-
dows/NT,MacOS, Android etc.

Operating system goals:


• Execute user programs and make solving user problems easier

• Provides the basis/environment for application programs to run

• Manages the computer hardware in an efficient manner

• Make the computer system convenient to use

1.1.1 Components of a Computer System


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 appli-
cations 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

1
Figure 1.1: The components of a computer system

1.1.2 What Operating Systems Do


There are two point of view that is user view and system view.
User View:

• Users want convenience, ease of use and good performance. Don’t care about
resource utilization

• Shared computer such as mainframe or minicomputer must keep all users happy

• Users of dedicate systems such as workstations have dedicated resources but fre-
quently use shared resources from servers

• Handheld computers are resource poor, optimized for usability and battery life

• Some computers have little or no user interface, such as embedded computers in


devices and automobiles

System View:

• From the computer’s point of view, operating system acts as a resource allocator.

• A computer system solve several problems such as CPU time, memory space, file-
storage space, I/O devices etc. It acts as the manager of these resources.

• It must decide how to allocate them to specific programs and users so that it can
operate the computer system efficiently and fairly

2
1.1.3 Computer-System Operation
• A modern general-purpose computer system consists of one or more CPUs and a
number of device controllers connected through a common bus that provides access
to shared memory.

• Each device controller is in charge of a specific type of device (for example, disk
drives, audio devices, or video displays).

• The CPU and the device controllers can execute in parallel, competing for mem-
ory cycles. To ensure orderly access to the shared memory, a memory controller
synchronizes access to the memory.

1.1.4 Computer-System Start up


• The process of loading the operating system into main memory is called boot-
ing (originally this was bootstrapping which refers to the process of pulling yourself
up ”by your bootstraps”).

• When it is powered up or rebooted, it needs to have an initial program (bootstrap


program) to run. This program must locate the operating-system kernel and load
it into memory.

• It stored in ROM or EPROM, generally known as firmware. It initializes all aspects


of the system, from CPU registers to device controllers to memory contents.

• When the system is fully booted, the system waits for some event to occur.

1.2 Computer system organization


• A modern general-purpose computer system consists of one or more CPUs and a
number of device controllers connected through a common bus that provides access
to shared memory.

• Each device controller is in charge of a specific type of device (for example, disk
drives, audio devices, or video displays).

3
• The CPU and the device controllers can execute in parallel, competing for mem-
ory cycles. To ensure orderly access to the shared memory, a memory controller
synchronizes access to the memory.

Interrupt

• The occurrence of an event is usually signaled by an interrupt from either the


hardware or the software.

• Hardware may trigger an interrupt at any time by sending a signal to the CPU
through the system bus.

• Software may trigger an interrupt by executing a special operation called a system


call (also called a monitor call).

• When the CPU is interrupted, it stops current execution and immediately transfers
execution to a fixed location.

• The fixed location usually contains the starting address where the service routine
for the interrupt is located.

• On completion, the CPU resumes the interrupted computation

Storage Structure
The CPU can load instructions only from memory. Basic unit of computer storage
is the bit. A bit can contain one of two values, 0 and 1.A byte is 8 bits, and on most
computers it is the smallest convenient chunk of storage. Computer storage measured
in collection of bytes. A kilobyte, or KB, is 1,024 bytes (210 ), a megabyte, or MB, is
1, 0242 bytes(220 ), a gigabyte, or GB, is 1, 0243 bytes (230 ), a terabyte, or TB, is 1, 0244
bytes(240 ), a petabyte, or PB, is 1, 0245 bytes(250 ).

• Main Memory

– Main memory is usually too small to store all needed programs and data
permanently.
– Main memory is a volatile storage device.

4
• Secondary Memory

– The main requirement for secondary memory is that it be able to hold large
quantities of data permanently.
– The most common secondary-storage device is hard disk, solid state disk,
magnetic disk, which provides storage for both programs and data

Figure 1.3: Storage-Device Hierarchy

• Information in use copied from slower to faster storage temporarily

• Faster storage (cache) checked first to determine if information is there

– If it is, information used directly from the cache (fast)


– If not, data copied to cache and used there

I/O Structure

• Each device controller is in charge of a specific device and is responsible for moving
the data between the peripheral device and the local buffer.

• OS have a device driver for each device controller. To start an I/O, device driver
loads the appropriate register within the device controller.

• The controller starts transfer from device to the local buffer.

• Once complete, it informs the device driver via an interrupt and the driver then
returns the control to the OS. It is called interrupt driven data transfer

I/O Structure DMA

• The interrupt driven data transfer produce high overhead when used for bulk data
transfer as the processor is blocked.

5
• To avoid this problem Direct Memory Access (DMA) is used

– Used for high-speed I/O devices able to transmit information at close to mem-
ory speeds
– Device controller transfers entire blocks of data from buffer storage directly to
main memory without CPU intervention
– Only one interrupt is generated per block, rather than the one interrupt per
byte

1.3 Computer system architecture


A computer system can be categorize roughly according to the number of general-purpose
processors used.

1. Single-Processor Systems: On a single processor system, there is one main CPU


capable of executing a general-purpose instruction set, including instructions from
user processes

6
2. Multiprocessor Systems: The system have two or more processors in close communi-
cation, sharing the computer bus and sometimes the clock, memory, and peripheral
devices.

Multiprocessor systems have three main advantages:

– Increased throughput: By increasing the number of processors,we expect to


get more work done in less time
– Economy of scale: Multiprocessor systems can cost less than equivalent multi-
ple single-processor systems, because they can share peripherals, mass storage,
and power supplies
– Increased reliability: If functions can be distributed properly among several
processors, then the failure of one processor will not halt the system, only slow
it down

3. Clustered Systems: Clustering systems are similar to parallel systems as they both
have multiple CPUs. However a major difference is that clustered systems are
created by two or more individual computer systems merged together. There are
two types of Clustering systems i.e. asymmetric and symmetric clustering systems.

Asymmetric Clustering: There is a master node in asymmetric clustering that


directs all the slaves nodes to perform the tasks required. The requests are delegated

7
by the master node. A distributed cache is used in asymmetric clustering to improve
the performance of the system. Resources such as memory, peripheral devices etc. are
divided between the nodes of the asymmetric clustering system at boot time.

Advantages of Asymmetric Clustering: The different advantages of asymmetric


clustering are −

• Since many computer systems are connected together and the processors work in
parallel, this reduces the cost of having separate peripheral devices and memory.

• The asymmetric clustering system has increased reliability as even if one nodes fails,
the others can pick up the slack.

• All the nodes in the asymmetric clustering system have their own kernels and can
operate on different operating systems.

• All the processors in the asymmetric clustering system are independent and only
share memory for inter process communications.

Symmetric Clustering System: In symmetric clustering system two or more nodes


all run applications as well as monitor each other. This is more efficient than asymmetric
system as it uses all the hardware and doesn’t keep a node merely as a hot standby.

Advantages of Symmetric Clustering System The different advantages of sym-


metric clustering are −

8
• The symmetric clustering system is quite reliable. This is because if one nodes fails,
the others can pick up the slack.This will not not result in the failure of the system
but will lead to graceful degradation.

• Many computer systems are connected together and work in parallel in the sym-
metric clustering system. This reduces the overall cost as there is shared peripheral
devices and memory.

• Symmetric clustering systems are quite scalable as it is easy to add a new node to
the system. There is no need to take the entire cluster down to add a new node.

1.4 Operating System Structure


Multiprogramming (Batch system) needed for efficiency. Single user cannot keep CPU
and I/O devices busy at all times. It organizes jobs (code and data) so CPU always has
one to execute. A subset of total jobs in system is kept in memory. One job selected and
run via job scheduling.

Timesharing (multitasking) is logical extension in which CPU switches jobs so fre-


quently that users can interact with each job while it is running. Response time should
be less. Each user has at least one program executing in memory- process If several jobs
ready to run at the same time-CPU scheduling. A more common method for ensuring
reasonable response time is virtual memory, a technique that allows the execution of a
process that is not completely in memory. The main advantage of the virtual-memory
scheme is that it enables users to run programs that are larger than actual physical
memory.

9
Faculty of Engineering and Technology (ITER)
SIKSHA ‘O’ ANUSANDHAN (DEEMED TO BE) UNIVERSITY
Bhubaneswar, ODISHA

You might also like