0% found this document useful (0 votes)
19 views

OS Unit - 1

The document discusses the overview of computer systems and operating systems. It defines what an operating system is, its goals and functions. It describes the operating system components like kernel and shell. It also discusses the various design goals that modern operating systems need to fulfill like handling concurrent systems, security, resource sharing and being portable.

Uploaded by

ZINKAL PATEL
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)
19 views

OS Unit - 1

The document discusses the overview of computer systems and operating systems. It defines what an operating system is, its goals and functions. It describes the operating system components like kernel and shell. It also discusses the various design goals that modern operating systems need to fulfill like handling concurrent systems, security, resource sharing and being portable.

Uploaded by

ZINKAL PATEL
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/ 19

Unit - 1

Computer Systems Overview

Computer systems engineers use digital and computing technologies to solve


problems in industrial systems. As part of a Bachelor of Computer Systems
Engineering you will study courses in areas such as information processing,
data transfer, communications, commerce and travel.

What is an Operating System?


Operating system goals: –
Use the computer hardware in an efficient manner.
• An OS itself is a software program that manages the hardware and software
resources of a computer.
• An OS performs basic tasks, such as managing execution of other programs,
controlling and allocating memory, controlling input and output devices,
managing files and facilitating networking.
– Make solving user problems easier.
– Make the computer system convenient to use.

Operating System Definition:

 resource manager
– Manages all resources.
– Decides between conflicting requests for efficient and fair
resource use.
• control program
– Controls execution of programs to prevent errors and improper
use of the computer.

pg. 1
• extended machine
– Turns complicated hardware into nice abstractions.

Architecture

The purpose of an operating system is to provide an environment in which a


user may execute programs. The hardware consists of the memory, CPU,
arithmetic-logic unit, various bulk storage devices, I/O, peripheral devices
and other physical devices.

 An operating system is a program that acts as an


interface between a user of a computer and the
computer resources. The purpose of an operating
system is to provide an environment in which a user
may execute programs.

Hardware:

pg. 2
 The hardware consists of the memory, CPU, arithmetic-
logic unit, various bulk storage devices, I/O, peripheral
devices and other physical devices.

Kernel:
 In computing, the kernel is the central component of most
computer operating systems; it is a bridge between applications
and the actual data processing done at the hardware level. The
kernel's responsibilities include managing the system's
resources (the communication between hardware and software
components). Usually as a basic component of an operating
system, a kernel can provide the lowest-level abstraction layer
for the resources (especially processors and I/O devices) that
application software must control to perform its function. It
typically makes these facilities available to application processes
through inter-process communication mechanisms and system
calls.

Shell:
 A shell is a piece of software that provides an interface for users
to an operating system which provides access to the services of
a kernel. The name shell originates from shells being an outer
layer of interface between the user and the innards of the
operating system.
 Operating system shells generally fall into one of two categories:
command-line and graphical. Command-line shells provide a
command-line interface (CLI) to the operating system, while
graphical shells provide a graphical user interface (GUI). In either
category the primary purpose of the shell is to invoke or
"launch" another program; however, shells frequently have
additional capabilities such as viewing the contents of
directories.

pg. 3
Design Goals in Operating Systems.

 Concurrent Systems. Modern operating systems should be able to


handle multiple users as well as multiple devices at the same time.
 Security and Privacy.
 Resource Sharing.
 Future Hardware and Software Changes.
 Portable Operating Systems.
 Backward Compatibility.
 No Specific Type of Users.

The design requirements are quite hard to specify in an operating system. They
are basically divided into two parts: User design requirements and System
design requirements.

 User Design Requirements


The operating system should be convenient, easy to use, reliable, safe and
fast according to the users. However, these specifications are not very
useful as there is no set method to achieve these goals.

 System Design Requirements


The operating system should be easy to design, implement and maintain.
These are specifications required by those who create, maintain and
operate the operating system. But there is no specific method to achieve
these goals as well.

Design Goals in Operating Systems

pg. 4
There are many design goals that modern operating systems have to fulfil to be
considered successful.

 Concurrent Systems:
Modern operating systems should be able to handle multiple users
as well as multiple devices at the same time. This is necessary for
the modern multi-core architectures. Because of these
specifications, the operating system design can be quite complex
and difficult to create.

 Security and Privacy:


Operating systems should be able to provide security and privacy
for a system. This is very important as there are many malicious
users who may want to hack into the computer system and steal
user programs.

pg. 5
 Resource Sharing:
The operating system should make sure that resources are shared
in a correct manner between multiple user processes. This can get
quite complex when multiple users share the same device as well.

 Future Hardware and Software Changes:


A major design consideration is that the operating system should
be able to weather future hardware and software changes and not
become obsolete. This is necessary as the operating system being
changed again and again is quite a costly process.

 Portable Operating Systems:


The operating systems should be portable i.e. they should work
with different hardware and machines. There may be some
speciality operating system that only work on one kind of machine,
however, most of them are portable.

 Backward Compatibility:
The new operating systems created should be compatible with the
previous models i.e. they should contain backward compatibility.

 No Specific Type of Users:


Operating systems should be developed keeping in mind a general
user base so that many users can use them. Even specially
developed operating systems that target a single user base contain
generality.

Basic functions:

 Security –
The operating system uses password protection to protect user data
and similar other techniques. it also prevents unauthorized access to

pg. 6
programs and user data.

 Control over system performance –

Monitors overall system health to help improve performance. records


the response time between service requests and system response to
having a complete view of the system health. This can help improve
performance by providing important information needed to
troubleshoot problems.

 Job accounting –

Operating system Keeps track of time and resources used by various


tasks and users, this information can be used to track resource usage
for a particular user or group of users.

 Error detecting aids –

The operating system constantly monitors the system to detect errors


and avoid the malfunctioning of a computer system.

 Coordination between other software and users –

Operating systems also coordinate and assign interpreters, compilers,


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

 Memory Management –

The operating system manages the Primary Memory or Main Memory.


Main memory is made up of a large array of bytes or words where each
byte or word is assigned a certain address. Main memory is fast storage
and it can be accessed directly by the CPU. For a program to be
executed, it should be first loaded in the main memory. An Operating
System performs the following activities for memory management:
o It keeps track of primary memory, i.e., which bytes of memory
are used by which user program. The memory addresses that
have already been allocated and the memory addresses of the
memory that has not yet been used. In multiprogramming, the
OS decides the order in which processes are granted access to

pg. 7
memory, and for how long. It Allocates the memory to a process
when the process requests it and deallocates the memory when
the process has terminated or is performing an I/O operation.

 Processor Management –

In a multi-programming environment, the OS decides the order in


which processes have access to the processor, and how much
processing time each process has. This function of OS is called process
scheduling. An Operating System performs the following activities for
processor management.
o Keeps track of the status of processes. The program which
performs this task is known as a traffic controller. Allocates the
CPU that is a processor to a process. De-allocates processor
when a process is no more required.

 Device Management –

An OS manages device communication via their respective drivers. It


performs the following activities for device management. Keeps track
of all devices connected to the system. designates a program
responsible for every device known as the Input/Output controller.
Decides which process gets access to a certain device and for how long.
Allocates devices in an effective and efficient way. Deallocates devices
when they are no longer required.

 File Management –

A file system is organized into directories for efficient or easy


navigation and usage. These directories may contain other directories
and other files. An Operating System carries out the following file
management activities. It keeps track of where information is stored,
user access settings and status of every file, and more… These facilities
are collectively known as the file system.

pg. 8
System calls:

A system call is a method for a computer program to request a service from the
kernel of the operating system on which it is running. A system call is a method
of interacting with the operating system via programs. A system call is a request
from computer software to an operating system's kernel.

The Application Program Interface (API) connects the operating system's


functions to user programs. It acts as a link between the operating system and
a process, allowing user-level programs to request operating system services.
The kernel system can only be accessed using system calls. System calls are
required for any programs that use resources.

1. Process Control
2. File Management
3. Device Management
4. Information Maintenance
5. Communication

pg. 9
 Process Control
Process control is the system call that is used to direct the
processes. Some process control examples include creating, load,
abort, end, execute, process, terminate the process, etc.

 File Management
File management is a system call that is used to handle the files.
Some file management examples include creating files, delete files,
open, close, read, write, etc.

 Device Management
Device management is a system call that is used to deal with
devices. Some examples of device management include read,
device, write, get device attributes, release device, etc.

 Information Maintenance
Information maintenance is a system call that is used to maintain
information. There are some examples of information
maintenance, including getting system data, set time or date, get
time or date, set system data, etc.

 Communication
Communication is a system call that is used for communication.
There are some examples of communication, including create,
delete communication connections, send, receive messages, etc.

pg. 10
Interaction of O.S. & Hardware Architecture:

o We write code in a text editor using any language like C++, JAVA,
Python, etc.
o This code is given to the compiler and it actually converts it to
assembly code that is very close to machine hardware as it
depends on an instruction set which is then converted to the
binary that is 0s and 1s which actually represent digital voltage
fed to transistors inside the chip.

o Now we have voltages that are actually required to run the


hardware. These voltages actually connect the correct circuitry
inside the chip and perform that specific task for example
addition, subtraction, etc. All these operations are done by the
combination of little transistors if we go into low level or flip-
flops which are the combination of gates and gates are a
combination of transistors. So, it all started with the invention of
transistors.
o The chip or microprocessor has a lot of circuits inside it to
perform various tasks like arithmetic and logical task. The
computer hardware also contains RAM which is another chip that

pg. 11
can store data temporarily and a Hard disk that can permanently
store data.
o The operating system is also responsible for feeding the software
to the right hardware like the keyboard, mouse, screen, etc.

Batch:
Batch processing was very popular in the 1970s. The
jobs were executed in batches. People used to have a
single computer known as a mainframe. Users using
batch operating systems do not interact directly with
the computer. Each user prepares their job using an
offline device like a punch card and submitting it to
the computer operator. Jobs with similar
requirements are grouped and executed as a group to
speed up processing. Once the programmers have
left their programs with the operator, they sort the
programs with similar needs into batches.

pg. 12
The batch operating system grouped jobs that perform similar functions. These
job groups are treated as a batch and executed simultaneously. A computer
system with this operating system performs the following batch processing
activities:

1. A job is a single unit that consists of a preset sequence of commands, data,


and programs.
2. Processing takes place in the order in which they are received, i.e., first
come, first serve.
3. These jobs are stored in memory and executed without the need for
manual information.
4. When a job is successfully run, the operating system releases its memory.

Advantages:
 Batch processing takes much of the work of the operator to the
computer.
 Increased performance as a new job get started as soon as the previous
job is finished, without any manual intervention.

Disadvantages

 Difficult to debug program.


 A job could enter an infinite loop.
 Due to lack of protection scheme, one batch job can affect pending jobs.

Multiprogramming:

Sharing the processor, when two or more programs reside in memory at the
same time, is referred as multiprogramming. Multiprogramming assumes a
single shared processor. Multiprogramming increases CPU utilization by
organizing jobs so that the CPU always has one to execute.

pg. 13
The following figure shows the memory layout for a multiprogramming system.

An OS does the following activities related to multiprogramming.


 The operating system keeps several jobs in memory at a time.
 This set of jobs is a subset of the jobs kept in the job pool.
 The operating system picks and begins to execute one of the jobs in the
memory.
 Multiprogramming operating systems monitor the state of all active
programs and system resources using memory management programs
to ensures that the CPU is never idle, unless there are no jobs to process.

pg. 14
Advantages

 High and efficient CPU utilization.


 User feels that many programs are allotted CPU almost simultaneously.

Disadvantages

 CPU scheduling is required.


 To accommodate many jobs in memory, memory management is
required.

Multitasking:
Multitasking is when multiple jobs are executed by the CPU simultaneously by
switching between them. Switches occur so frequently that the users may
interact with each program while it is running. An OS does the following
activities related to multitasking −
 The user gives instructions to the operating system or to a program
directly, and receives an immediate response.
 The OS handles multitasking in the way that it can handle multiple
operations/executes multiple programs at a time.
 Multitasking Operating Systems are also known as Time-sharing systems.
 These Operating Systems were developed to provide interactive use of a
computer system at a reasonable cost.
 A time-shared operating system uses the concept of CPU scheduling and
multiprogramming to provide each user with a small portion of a time-
shared CPU.
 Each user has at least one separate program in memory.

pg. 15
 A program that is loaded into memory and is executing is commonly
referred to as a process.
 When a process executes, it typically executes for only a very short time
before it either finishes or needs to perform I/O.
 Since interactive I/O typically runs at slower speeds, it may take a long
time to complete. During this time, a CPU can be utilized by another
process.
 The operating system allows the users to share the computer
simultaneously. Since each action or command in a time-shared system
tends to be short, only a little CPU time is needed for each user.
 As the system switches CPU rapidly from one user/program to the next,
each user is given the impression that he/she has his/her own CPU,
whereas actually one CPU is being shared among many users.

Time Sharing:

The operating system performs time sharing through CPU scheduling and
multiprogramming. Let us study closely the process in a time sharing system. It is
as follows:

 It is the division of CPU time for each process when more than one
task are given by the user.

pg. 16
 A short duration of time is chosen for each process. Moreover, this
time duration is very small in the order of 10-100 milliseconds. This
time duration is known as time slot, time slice, or quantum.
 Suppose three processes namely, P1, P2, and P3 are running on the
system. Now, suppose that the quantum is 4 nanoseconds (ns). Now,
they will execute in the following manner.
 Process P1 will execute for 4 ns, as soon a sit gets over, process p2
starts executing for a duration of 4 ns. Further, when p2 gets
complete process P3 executes for 4ns. This process continues till all
the processes gets complete.
 In this way, only one process runs at a time but, the switching
between the processes is very fast. Hence, the user feels that all the
processes are running at the same time.

The above diagram shows the working of a time sharing OS. In this diagram,
process 4 is in the active state. Process 5 is in a ready state while, processes 1, 2,
3, and 6 are in a waiting state.

 Active State: This is the state of the process which is currently


processing on the CPU. Only, one process is in the active state at a
time.

pg. 17
 Ready State: In this state, the process is ready for execution but, it is
waiting for its turn to use the CPU. More than one process can be in
the ready state at a time.
 Waiting State: In this state, the process is not ready for execution. It
is waiting for some input/output process to get complete.

Advantages of Timesharing operating systems are −

 It provides the advantage of quick response.


 This type of operating system avoids duplication of software.
 It reduces CPU idle time.
Disadvantages of Time-sharing operating systems are −
 Time sharing has problem of reliability.
 Question of security and integrity of user programs and data can be
raised.
 Problem of data communication occurs.

Parallel Systems:
Parallel System are designed to speed up the execution of programs by
diving the programs into multiple fragments and processing these fragments
at the same time. Flynn has classified computer systems into four types based
on parallelism in the instructions and in the data streams.

Distributed & real- time OS:

 Distributed systems use multiple central processors to serve multiple


real-time applications and multiple users. Data processing jobs are
distributed among the processors accordingly. The processors
communicate with one another through various communication lines
(such as high-speed buses or telephone lines).

pg. 18
 A distributed operating system is system software over a collection of
independent, networked, communicating, and physically separate
computational nodes. They handle jobs which are serviced by multiple
CPUs. Each individual node holds a specific software subset of the global
aggregate operating system.

 These are referred as loosely coupled systems or distributed systems.


Processors in a distributed system may vary in size and function. These
processors are referred as sites, nodes, computers, and so on.

The advantages of distributed systems are as follows −

 With resource sharing facility, a user at one site may be able to use the
resources available at another.
 Speedup the exchange of data with one another via electronic mail.
 If one site fails in a distributed system, the remaining sites can
potentially continue operating.
 Better service to the customers.
 Reduction of the load on the host computer.
 Reduction of delays in data processing.

pg. 19

You might also like