0% found this document useful (0 votes)
224 views13 pages

Pos Notes Unit 1

The document provides information about an operating systems course, including: - An overview of operating system functions such as memory management, processor management, device management, and file management. - Explanations of what operating systems do like acting as an interface between hardware and software, handling input/output devices, and including system services. - Descriptions of operating system structures including simple, layered, and monolithic/kernel-based approaches. The layered approach builds each layer on the bottom layer to hide structures and operations.

Uploaded by

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

Pos Notes Unit 1

The document provides information about an operating systems course, including: - An overview of operating system functions such as memory management, processor management, device management, and file management. - Explanations of what operating systems do like acting as an interface between hardware and software, handling input/output devices, and including system services. - Descriptions of operating system structures including simple, layered, and monolithic/kernel-based approaches. The layered approach builds each layer on the bottom layer to hide structures and operations.

Uploaded by

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

GOKARAJU RANGARAJU INSTITUTE OF ENGINEERING AND TECHNOLOGY

PRINCIPLES OF OPERATING SYSTEMS

Course Code:GR18A2061 L/T/P/C: 3/0/0/3


II Year II Semester

UNIT-I:
Computer System and Operating System Overview: Overview of computer operating
systems, operating system functions, operating system structure and system calls,
Evaluation of Operating Systems.

1.1 Overview Of Computer Operating Systems:

The advantage of using Operating System


 Allows you to hide details of hardware by creating an abstraction
 Easy to use with a GUI
 Offers an environment in which a user may execute programs/applications
 The operating system must make sure that the computer system convenient to use
 Operating System acts as an intermediary among applications and the hardware
components
 It provides the computer system resources with easy to use format
 Acts as an inter-mediator between all hardware's and software's of the system

Disadvantages of using Operating System


 If any issue occurs in OS, you may lose all the contents which have been stored in your
system
 Operating system's software is quite expensive for small size organization which adds
burden on them. Example Windows
 It is never entirely secure as a threat can occur at any time

Goal/Need of an Operating System:


The fundamental goal of a Computer System is to execute user programs and to make tasks
easier. Various application programs along with hardware system are used to perform this
work. Operating System is a software which manages and control the entire set of resources
and effectively utilize every part of a computer.
The figure shows how OS acts as a medium between hardware unit and application program
OS as a platform for Application programs: Operating system provides a platform, on top of
which, other programs, called application programs can run. These application programs help
the users to perform a specific task easily. It acts as an interface between the computer and the
user. It is designed in such a manner that it operates, controls and executes various applications
on the computer.

Managing Input-Output unit: Operating System also allows the computer to manage its own
resources such as memory, monitor, keyboard, printer etc. Management of these resources is
required for an effective utilization.The operating system controls the various system input-
output resources and allocates them to the users or programs as per their requirement.

Consistent user interface: Operating System provides the user an easy-to-work user interface,
so the user doesn’t have to learn a different UI every time and can focus on the content and be
productive as quickly as possible. Operating System provides templates, UI components to
make the working of a computer, really easy for the user.

Multitasking: Operating System manages memory and allow multiple programs to run in their
own space and even communicate with each other through shared memory. Multitasking gives
users a good experience as they can perform several tasks on a computer at a time.

What Does an Operating System Do?


 An operating system is the core set of software on a device that keeps everything together.
Operating systems communicate with the device’s hardware. They handle everything from
your keyboard and mice to the Wi-Fi radio, storage devices, and display. In other words,
an operating system handles input and output devices. Operating systems use device
drivers written by hardware creators to communicate with their devices.
 Operating systems also include a lot of software—things like common system services,
libraries, and application programming interfaces (APIs) that developers can use to write
programs that run on the operating system.
 The operating system sits in between the applications you run and the hardware, using the
hardware drivers as the interface between the two. For example, when an application wants
to print something, it hands that task off to the operating system. The operating system
sends the instructions to the printer, using the printer’s drivers to send the correct signals.
The application that’s printing doesn’t have to care about what printer you have or
understand how it works. The OS handles the details.

What is an Operating System?

An Operating system (OS) is a software which acts as an interface between the end user
and computer hardware. Every computer must have at least one OS to run other programs. An
application like Chrome, MS Word, Games, etc needs some environment in which it will run
and perform its task. The OS helps you to communicate with the computer without knowing
how to speak the computer's language. It is not possible for the user to use any computer or
mobile device without having an operating system.
1.2 Operating System Functions

Following are some of important functions of an operating System.


 Memory Management
 Processor Management
 Device Management
 File Management
 Security
 Control over system performance
 Job accounting
 Error detecting aids
 Coordination between other software and users

Memory Management
Memory management refers to management of Primary Memory or Main Memory. Main
memory is a large array of words or bytes where each word or byte has its own address.
Main memory provides a fast storage that can be accessed directly by the CPU. For a program
to be executed, it must in the main memory.
An Operating System does the following activities for memory management −

 Keeps tracks of primary memory, i.e., what part of it are in use by whom, what part are not
in use.
 In multi-programming, the OS decides which process will get memory when and how
much.
 Allocates the memory when a process requests it to do so.
 De-allocates the memory when a process no longer needs it or has been terminated.

Processor Management
In multi-programming environment, the OS decides which process gets the processor when and
for how much time. This function is called process scheduling.
An Operating System does the following activities for processor management −
 Keeps tracks of processor and status of process. The program responsible for this task is
known as traffic controller.
 Allocates the processor (CPU) to a process.
 De-allocates processor when a process is no longer required.

Device Management
An Operating System manages device communication via their respective drivers.
It does the following activities for device management −

 Keeps tracks of all devices. Program responsible for this task is known as the I/O
controller.
 Decides which process gets the device when and for how much time.
 Allocates the device in the efficient way.
 De-allocates devices.

File Management
A file system is normally organized into directories for easy navigation and usage. These
directories may contain files and other directions.
An Operating System does the following activities for file management −
 Keeps track of information, location, uses, status etc. The collective facilities are often
known as file system.
 Decides who gets the resources.
 Allocates the resources.
 De-allocates the resources.

Other Important Activities


Following are some of the important activities that an Operating System performs −

Security − By means of password and similar other techniques, it prevents unauthorized access
to programs and data.

Control over system performance − Recording delays between request for a service and
response from the system.

Job accounting − Keeping track of time and resources used by various jobs and users.

Error detecting aids − Production of dumps, traces, error messages, and other debugging and
error detecting aids.

Coordination between other softwares and users − Coordination and assignment of


compilers, interpreters, assemblers and other software to the various users of the computer
systems.

1.3 Operating Systems Structure:

An operating system is a construct that allows the user application programs to interact
with the system hardware. Since the operating system is such a complex structure, it should be
created with utmost care so it can be used and modified easily. An easy way to do this is to
create the operating system in parts. Each of these parts should be well defined with clear
inputs, outputs and functions.
Simple Structure
There are many operating systems that have a rather simple structure. These started as small
systems and rapidly expanded much further than their scope. A common example of this is
MS-DOS. It was designed simply for a niche amount for people. There was no indication that it
would become so popular.
An image to illustrate the structure of MS-DOS is as follows:
It is better that operating systems have a modular structure, unlike MS-DOS. That would lead
to greater control over the computer system and its various applications. The modular structure
would also allow the programmers to hide information as required and implement internal
routines as they see fit without changing the outer specifications.
Layered Structure
One way to achieve modularity in the operating system is the layered approach. In this, the
bottom layer is the hardware and the topmost layer is the user interface.
An image demonstrating the layered approach is as follows:
As seen from the image, each upper layer is built on the bottom layer. All the layers hide some
structures, operations etc from their upper layers.
One problem with the layered structure is that each layer needs to be carefully defined. This is
necessary because the upper layers can only use the functionalities of the layers below them.
Monolithic/Kernel-Based Approach
Functionality of the OS is invoked with simple function calls within the kernel, which is one
large program. Device drivers are loaded into the running kernel and become part of the kernel.
Figure below is an abstract view of a kernel-based OS. The kernel is the core of the OS; it provides
a set of functions and services to support various OS functionalities. The rest of the OS is
organized as a set of non-kernel routines, which implement operations on processes and
resources that are of interest to users, and a user interface.

Portability of the OS is achieved by putting architecture-dependent parts of OS code—which


typically consist of mechanisms—in the kernel and keeping architecture-independent parts of
code outside it, so that the porting effort is limited only to porting of the kernel. The kernel is
typically monolithic to ensure efficiency; the nonkernel part of an OS may be monolithic, or it
may be further structured into layers.
Kernel-based operating systems have poor extensibility because addition of a new functionality
to the OS may require changes in the functions and services offered by the kernel.
Examples:VMS, Linux, OS/360, OpenVMS, Multics, AIX, BS
 
Micro-kernels

The micro-kernel was developed in the early 1990s to overcome the problems concerning
portability, extensibility, and reliability of kernels. A micro-kernel is an essential core of OS
code, thus it contains only a subset of the mechanisms typically included in a kernel and
supports only a small number of system calls, which are heavily tested and used.
This structures the operating system by removing all nonessential portions of the kernel and
implementing them as system and user level programs.Generally they provide minimal process
and memory management, and a communications facility.Communication between components
of the OS is provided by message passing.
The benefits of the micro-kernel are as follows:
 Extending the operating system becomes much easier.
 Any changes to the kernel tend to be fewer, since the kernel is smaller.
 The micro-kernel also provides more security and reliability.

Main disadvantage is poor performance due to increased system overhead from message


passing.
Examples:GNU Hurd, MINIX

Hybrid Operating System

 In a hybrid operating system, two operating system may execute on a single device. This
can be done by dividing the memory and the processor between the operating systems. All
the system resources would be shared between them.
 The two operating systems on a computer system may include a full-fledged operating
system and a lightweight operating system. Both of these operating systems would fulfill
different sets of tasks depending on their capabilities.
 One of the ways to install the two operating systems is to bootstrap the first operating
system with all the system resources. Then half of the system resources are allocated to the
first operating system and the second operating system is bootstrapped with the remaining
system resources.
 Another method to handle two operating systems on the same device is to use hypervisors.
This is a software layer between the hardware and the guest operating system which
provides a virtualized hardware to the guest operating system.
 Both the operating systems in the hybrid environment may be aware of the other operating
system and share resources with each other. For example, both the operating systems may
have direct access to the hardware components such as memory, processor, BIOS etc and
the operating systems may execute concurrently on the system.
Hybrid Kernel
The kernel is the core part of the operating system as it manages the operations of the computer
as well as the hardware. The hybrid kernel attempts to combine the features and aspects of the
microkernel and the monolithic kernel. This means that the kernel structure should be similar to
a microkernel but the structure should be implemented like a monolithic kernel.
A well-known example of the hybrid kernel is the Microsoft Windows NT kernel. This kernel
handles all the operating systems in the Windows NT family. It is called a hybrid kernel instead
of a monolithic kernel as the emulation subsystems run on the user mode rather than the kernel
mode, unlike in monolithic kernel.
The NT kernel cannot be called a microkernel as well. This is because almost all the system
components run on the same address space as the kernel, which is a feature of the monolithic
kernel.
A figure that illustrates the structure of the Microsoft Windows NT kernel is as follows:

There are mainly two layers in the Windows NT operating system architecture i.e user mode
and kernel mode. The user mode contains the Integral Subsystems and Environmental
Subsystems with various modules in each of them.
The executive part of the kernel mode contains the executive services and object manager. The
executive services include I/O manager, IPC manager, process manager etc.
Apart from the executive mode, the kernel mode contains the kernel mode drivers, the
microkernel and the hardware abstraction layer. The hardware abstraction layer is connected to
the hardware.
System Calls in Operating Systems:
The interface between a process and an operating system is provided by system calls. In
general, system calls are available as assembly language instructions. They are also included in
the manuals used by the assembly level programmers. System calls are usually made when a
process in user mode requires access to a resource. Then it requests the kernel to provide the
resource via a system call.
A figure representing the execution of the system call is given as follows:

As can be seen from this diagram, the processes execute normally in the user mode until a
system call interrupts this. Then the system call is executed on a priority basis in the kernel
mode. After the execution of the system call, the control returns to the user mode and execution
of user processes can be resumed.
In general, system calls are required in the following situations:

 If a file system requires the creation or deletion of files. Reading and writing from files
also require a system call.
 Creation and management of new processes.
 Network connections also require system calls. This includes sending and receiving
packets.
 Access to a hardware devices such as a printer, scanner etc. requires a system call.

Types of System Calls


There are mainly five types of system calls. These are explained in detail as follows:
Process Control
These system calls deal with processes such as process creation, process termination etc.
File Management
These system calls are responsible for file manipulation such as creating a file, reading a file,
writing into a file etc.
Device Management
These system calls are responsible for device manipulation such as reading from device
buffers, writing into device buffers etc.
Information Maintenance
These system calls handle information and its transfer between the operating system and the
user program.
Communication
These system calls are useful for inter-process communication. They also deal with creating
and deleting a communication connection.
Evolution of Operating System:
Evolution of Operating Systems: User driven, operator driven, simple batch system, off – line
batch
system, directly coupled off – line system, multi- programmed spooling system, online
timesharing
system, multiprocessor systems, multi-computer/ distributed systems, Real time Operating
Systems.
1. Serial processing
2. Batch processing
3. Multiprogramming
4. Multitasking or time sharing System

Multitasking or Time Sharing System:

● Multiprogramming didn't provide the user interaction with the computer system.
● Time sharing or Multitasking is a logical extension of Multiprogramming that provides user
interaction.
● There are more than one user interacting the system at the same time
● The switching of CPU between two users is so fast that it gives the impression to user that he
is
only working on the system but actually it is shared among different users.
● CPU bound is divided into different time slots depending upon the number of users using the
system.
● just as multiprogramming allows the processor to handle multiple batch jobs at a time,
multiprogramming can also be used to handle multiple interactive jobs. In this latter case, the
technique is referred to as time sharing, because processor time is shared among multiple users
● A multitasking system uses CPU scheduling and multiprogramming to provide each user
with a
small portion of a time shared computer. Each user has at least one separate program in
memory.
● Multitasking are more complex than multiprogramming and must provide a mechanism for
jobs
synchronization and communication and it may ensure that system does not go in deadlock.
Although batch processing is still in use but most of the system today available uses the
concept of Serial Processing:
● Early computer from late 1940 to the mid 1950.
● The programmer interacted directly with the computer hardware.
● These machine are called bare machine as they don't have OS.
● Every computer system is programmed in its machine language.
● Uses Punch Card, paper tapes and language translator
These system presented two major problems.
1. Scheduling
2. Set up time:
Scheduling:
Used sign up sheet to reserve machine time. A user may sign up for an hour but finishes his job
in 45
minutes. This would result in wasted computer idle time, also the user might run into the
problem not finish his job in allotted time.
Set up time:
A single program involves:
● Loading compiler and source program in memory
● Saving the compiled program (object code)
● Loading and linking together object program and common function
Each of these steps involves the mounting or dismounting tapes on setting up punch cards. If an
error occur user had to go the beginning of the set up sequence. Thus, a considerable amount of
time is spent
in setting up the program to run.
This mode of operation is turned as serial processing ,reflecting the fact that users access the
computer
in series.
Simple Batch Processing:
● Early computers were very expensive, and therefore it was important to maximize processor
utilization.
● The wasted time due to scheduling and setup time in Serial Processing was unacceptable.
● To improve utilization, the concept of a batch operating system was developed.
● Batch is defined as a group of jobs with similar needs. The operating system allows users to
form batches. Computer executes each batch sequentially, processing all jobs of a batch
considering them as a single process called batch as the monitor. With this type of OS, the user
no longer has direct access to the processor. Instead, the
user submits the job on cards or tape to a computer operator, who batches the jobs together
sequentially
and places the entire batch on an input device, for use by the monitor. Each program is
constructed to
branch back to the monitor when it completes processing, at which point the monitor
automatically
begins loading the next program.
With a batch operating system, processor time alternates between execution of user programs
and
execution of the monitor. There have been two sacrifices: Some main memory is now given
over to the
monitor and some processor time is consumed by the monitor. Both of these are forms of
overhead.
Multiprogrammed Batch System:
A single program cannot keep either CPU or I/O devices busy at all times. Multiprogramming
increases
CPU utilization by organizing jobs in such a manner that CPU has always one job to execute. If
computer is required to run several programs at the same time, the processor could be kept
busy for the
most of the time by switching its attention from one program to the next. Additionally I/O
transfer
could overlap the processor activity i.e, while one program is awaiting for an I/O transfer,
another
program can use the processor. So CPU never sits idle or if comes in idle state then after a very
small
time it is again busy. This is illustrated in fig below.
 Distributed Operating Systems
In a distributed system, the different machines are connected to a network and each machine
has its own processor and owns local memory.
In this system, the operating systems on all the machines work together to manage the
collective network resource.
It can be classified into two categories:
Client-Server systems
Peer-to-Peer systems
Advantages of distributed systems:-
Resources Sharing
Computation speed up – load sharing
Reliability
Communications
Requires networking infrastructure.
Local area networks (LAN) or Wide area networks (WAN)
Desktop Systems/Personal Computer Systems
The PC operating system is designed for maximizing user convenience and responsiveness.
This system is neither multi-user nor multitasking.
These systems include PCs running Microsoft Windows and the Apple Macintosh. The MS-
DOS operating system from Microsoft has been superseded by multiple flavors of Microsoft
Windows and IBM has upgraded MS-DOS to the OS/2 multitasking system.
Real-Time Operating Systems (RTOS)
A real-time operating system (RTOS) is a multitasking operating system intended for
applications with fixed deadlines (real-time computing). Such applications include some small
embedded systems, automobile engine controllers, industrial robots, spacecraft, industrial
control, and some large-scale computing systems.
The real-time operating system can be classified into two categories:-
A  hard real-time  system guarantees that critical tasks be completed on time. This goal requires
that all delays in the system be bounded, from the retrieval of stored data to the time that it
takes the operating system to finish any request made of it. Such time constraints dictate the
facilities that are available in hard real-time systems.
A  soft real-time  system is a less restrictive type of real-time system. Here, a critical real-time
task gets priority over other tasks and retains that priority until it completes. The soft real-time
system can be mixed with other types of systems. Due to less restriction, they are risky to use
for industrial control and robotics.

You might also like