You are on page 1of 42

Faculty of Computer science

Operating System

Lecturer: Mr. Lutfullah


Haqnesar
Chapter Two
Operating System OS Structure

Chapter Two
Operating System Structure
Agenda Chapter Two
OS Structure

• Operating System Structure

• Types of Operating System

• Single User OS

• Multi User OS

• Buffering
Chapter Two
Operating-System Structure OS Structure

• A system as large and complex as a modern OS must be engineered


carefully if it is to function properly and be modified easily.

• A common approach is to partition the task into small components,


rather than have one monolithic system.

• Each of these modules should be a well-defined portion of the


system, with carefully defined inputs, outputs, and functions.
Chapter Two
1. Simple Structure OS Structure

• Such operating systems do not have well defined structure and are
monolithic, small and simple systems.

• The interfaces and levels of functionality are not well separated.

• Simple structure systems started as small, simple, and limited systems


and then grew beyond their original scope.

• MS-DOS is an example of such a system.

• It was not carefully divided into modules.


Chapter Two
MS-DOS Structure
OS Structure
Chapter Two
2. Layered Approach OS Structure

• A system can be made modular in many ways and one method is the
layered approach.
• In Layered Approach the operating system is broken into a number of
layers (levels).
• The bottom layer (layer 0) is the hardware; the highest (layer N) is the
user interface.
• Operating systems can be broken into pieces that are smaller and more
appropriate.
Chapter Two
2. Layered Approach (Con..) OS Structure

• The operating system can then retain much greater control over the
computer and over the applications.
• The main advantage of the layered approach is simplicity of
construction and debugging.
• The major difficulty with the layered approach involves appropriately
defining the various layers.
Chapter Two
2. Layered Approach (Con..)
OS Structure
Chapter Two
View of OS Services OS Structure
Chapter Two
3. Hybrid Systems OS Structure

• In practice, very few operating systems adopt a single, strictly defined


structure.
• Instead, they combine different structures, resulting in hybrid systems that
address performance and security issues.
• For example, Linux is monolithic (provides efficient performance) and also
modular, so that new functionality can be dynamically added.
• Windows is largely monolithic, but it retains some behavior other OS
structure.
• Apple Mac OS, iOS and Android all are hybrid systems.
Chapter Two
Types of Operating Systems OS Structure

There are many types of operating systems:

1. Single-User

2. Multi-User
Chapter Two
Single User OS OS Structure

• Single-user operating system is a type of OS developed and intended


for use on a computer that will only have a single user at any given
time.

• The operating system is responsible for handling many different tasks.

• It manages memory usage, hardware connectivity and the proper


execution of other applications.
Chapter Two
Single User OS OS Structure

• These systems are also known are single application OS as one


application is concentrated at a time.
• These systems require fewer resources and can do processing in a
queue.
• This type of OS is typically used on devices like Windows,
Linux, ,wireless phones and two-way messaging devices.
Single User Operating System Chapter Two
OS Structure
Chapter Two
OS Structure
Chapter Two
Types of Single-User OS OS Structure

Single user OS can be classified into two parts, such as:

1. Single-User Single-Tasking operating system

2. Single-User Multi-Tasking operating system


Types of Single-User OS Chapter Two
OS Structure

1. Single-User Single-Tasking OS

• Single-User Single-Tasking operating system is a type of OS where,


only one user is permitted for performing a single task at a time.

• This operating system is designed especially for wireless phones as


well as two-way messaging devices.

• For example, MS-DOS, etc.


Types of Single-User OS Chapter Two
OS Structure

It has the following advantages:

• This operating system occupies less space in memory.

• It is cost-effective.
Types of Single-User OS Chapter Two
OS Structure

2. Single-User Multi-Tasking OS

• Single-User Multi-Tasking operating system is a type of OS developed


especially for one user, but this single user can perform multiple tasks
simultaneously.

• For example, you can write any text while surfing the internet,
downloading images, watching movies, etc., on Windows, Linux, Mac
OS.
Types of Single-User OS Chapter Two
OS Structure

It has the following advantages:

• Time-saving.

• High productivity in less time frame.

• Less memory is used for performing multiple tasks


Chapter Two
Advantages of Single User OS
OS Structure
Single-user operating systems requires fewer resources.
Supports one user at a time: No other user interfering with the
applications.
Easy to maintain: These systems use fewer resources, and their
complexity is less, making them easy to maintain.
Less chance to damage: These systems include fewer requests to
hardware and software at a time, so they have less chance to damage.
Concentrate on one task: In single-user OS, only one task runs at a
time.
Disadvantages of Single User OS Chapter Two
OS Structure

Tasks take longer to complete: As you know, many tasks are waiting
for the CPU if no multiple tasks run at a time.

This will make the system slow, and response time is higher.

Idle time is higher: If only one task is running and this task doesn't
require memory or I/O use, these devices remain idle. But other tasks
need those devices.
Chapter Two
Multi-User Operating System
OS Structure

• Multi-user operating system is an operating system that permits


several users to access a single system running to a single operating
system.

• These systems are quite complex, and they must manage the tasks
that the various users connected to them require.

• A multi-user operating system varies from a connected single-user


operating system in that each user accesses the same operating
system from different machines.
Chapter Two
Multi-User Operating System OS Structure
Chapter Two
Multi-User Operating System OS Structure

• The main goal of developing a multi-user operating system is to use it for


time-sharing and batch processing on mainframe systems.

• This multi-user operating system is now often used in large organizations,


the government sector, educational institutions like large universities, and
on servers' side such as Windows Server and Ubuntu Server.

• These servers allow several users to access the operating system, kernel,
and hardware at the same time.
Chapter Two
Characteristics of Multi-User OS OS Structure

Resource Sharing: Several devices, like printers, fax machines and hard
drives, can be shared in a multi-user operating system.

Multi-Tasking: Multi-user operating systems may execute several tasks


simultaneously, and several programs may also execute at the same
time.
Chapter Two
Characteristics of Multi-User OS OS Structure

Time-Sharing: A strategy used by multi-user operating systems to


operate on several user requests at the same time by switching
between jobs at very short periods of time.

System: The operating system must handle a computer's combination


of hardware and software resources.
Chapter Two
Single User and Multi-User OS OS Structure

Terms Single User Operating System Multi-User Operating System


Definition A Single-User OS is a system in which only one A Multi-User OS is a system that allows more than
user can access the computer system at a time. one user to access a computer system at one time.

Bootloader The bootloader loads all the resources of the The bootloader distributes the resources of the CPU
CPU in the profile of a single superuser. based on the priority of the users.
Complexity Single-User Operating System is simple and The Multi-User OS are complicated as they have to
easy to design. apply complex techniques to share the resources
among various users.

Performance Only one task at one time gets performed. Schedules different tasks for performance at any
rate.
Example MS-DOS, Windows 95, Windows NT, Windows Mainframes, Linux & Unix Distributed OS, etc.
2000, etc.
Chapter Two
Buffering in Operating System OS Structure

• The buffer is an area in the main memory used to store the


data temporarily.

• The act of storing data temporarily in the buffer is called buffering.


• A buffer may be used when moving data between processes within a
computer.

• Buffers can be implemented in a fixed memory location in hardware


or by using a virtual data buffer in software.
Buffering in OS (Con..) Chapter Two
OS Structure

• Buffers are typically used when there is a difference between the rate
of received data and the rate of processed data, for example, in a
printer spooler or online video streaming.

• A buffer often adjusts timing by implementing a queue or FIFO


algorithm in memory, simultaneously writing data into the queue at
one rate and reading it at another rate.
Chapter Two
How Buffering Works OS Structure
Chapter Two
Purpose of Buffering OS Structure

There are three reasons behind buffering of data:


1. It helps in matching speed between two devices in which the data is
transmitted.
2. It helps the devices with different sizes of data transfer to get adapted
to each other.
3. It also supports copy semantics. With copy semantics, the version of
data in the buffer is guaranteed to be the version of data at the time of
system call.
Chapter Two
OS Structure
Types of Buffering Chapter Two
OS Structure

There are three main types of buffering in the OS, such as:

1. Single Buffer

2. Double Buffer

3. Circular Buffer
Chapter Two
1. Single Buffer OS Structure

• In Single Buffering, only one buffer is used to transfer the data


between two devices.

• The producer produces one block of data into the buffer.

• After that, the consumer consumes the buffer.

• Only when the buffer is empty, the processor again produces the
data.
Chapter Two
1. Single Buffer (con…) OS Structure
Chapter Two
2. Double Buffer OS Structure

• In Double Buffering, two schemes or two buffers are used in the place
of one.
• In this buffering, the producer produces one buffer while the
consumer consumes another buffer simultaneously.
• So, the producer not needs to wait for filling the buffer.

• A major disadvantage of double buffering is that the complexity of the


process gets increased.
2. Double Buffer Chapter Two
OS Structure
Chapter Two
3. Circular Buffer
OS Structure

• When more than two buffers are used, the buffers' collection is called
a circular buffer.

• Each buffer is being one unit in the circular buffer.

• The data transfer rate will increase using the circular buffer rather
than the double buffering.
• The producer can only fill up to buffer x-1 while data in buffer x is
waiting to be consumed
3. Circular Buffer Chapter Two
OS Structure
Chapter Two
OS Structure

You might also like