Unit1 Introduction and Operating System Structures
Unit1 Introduction and Operating System Structures
Definition:
There are several types of Operating Systems which are mentioned below.
This type of operating system does not interact with the computer directly.
There is an operator which takes similar jobs having the same requirements
and groups them into batches. It is the responsibility of the operator to sort
jobs with similar needs. Batch Operating System is designed to manage and
execute a large number of jobs efficiently by processing them in groups.
In batch operating system the processing time for jobs is commonly difficult
to accurately predict while they are in the queue.
MultiProgramming
1. There is not any facility for user interaction of system resources with
the system.
1. Due to the multiple CPU, it can be more complex and somehow difficult
to understand.
1. Preemptive Multi-Tasking
2. Cooperative Multi-Tasking
Each task is given some time to execute so that all the tasks work smoothly.
Each user gets the time of the CPU as they use a single system. These
systems are also known as Multitasking Systems. The task can be from a
single user or different users also. The time that each task gets to execute is
called quantum. After this time interval is over OS switches over to the next
task.
Advantages of Time-Sharing OS
Disadvantages of Time-Sharing OS
1. Reliability problem.
2. One must have to take care of the security and integrity of user
programs and data.
3. Data communication problem.
4. High Overhead: Time-sharing systems have a higher overhead than
other operating systems due to the need for scheduling, context
switching, and other overheads that come with supporting multiple
users.
These types of OSs serve real-time systems. The time interval required to
process and respond to inputs is very small. This time interval is
called response time.Real-time systems are used when there are time
requirements that are very strict like missile systems, air traffic control
systems, robots, etc.
Hard Real-Time Systems: Hard Real-Time OSs are meant for applications
where time constraints are very strict and even the shortest possible delay is
not acceptable. These systems are built for saving life like automatic
parachutes or airbags which are required to be readily available in case of an
accident. Virtual memory is rarely found in these systems.
Soft Real-Time Systems: These OSs are for applications where time-
constraint is less strict.
Difference Between Hard Real Time and Soft Real Time System
Hard Real Time System Soft Real Time System
In hard real time system, the size In soft real time system, the size of data
of data file is small or medium. file is large.
Peak load performance should be In soft real time system, peak load can
predictable. be tolerated.
A hard real time system is very A Soft real time system is less
restrictive. restrictive.
Catastrophic or severe
Minor consequences (e.g., degraded
consequences (e.g., loss of life or
performance or reduced quality).
property damage).
Disadvantages of RTOS
1. Limited Tasks: Very few tasks run at the same time and their
concentration is very less on a few applications to avoid errors.
2. Use heavy system resources: Sometimes the system resources are
not so good and they are expensive as well.
3. Complex Algorithms: The algorithms are very complex and difficult
for the designer to write on.
4. Device driver and interrupt signals: It needs specific device drivers
and interrupts signal to respond earliest to interrupts.
5. Thread Priority: It is not good to set thread priority as these systems
are very less prone to switching tasks.
6. Examples of Real-Time Operating Systems are Scientific
experiments, medical imaging systems, industrial control systems,
weapon systems, robots, air traffic control systems, etc.
1. Process Management
2. File Management
3. Network Management
4. Main Memory Management
5. Secondary Storage Management
6. I/O Device Management
7. Security Management
8. Command Interpreter System
1.Process Management
For example, when you use a search engine like Chrome, there is a process
running for that browser program.
2.File Management
3.Network Management
Main memory is a large array of storage or bytes, which has an address. The
memory management process is conducted by using a sequence of reads or
writes of specific memory addresses.
5.Secondary-Storage Management
1. Storage allocation
2. Free space management
3. Disk scheduling
One of the important use of an operating system that helps to hide the
variations of specific hardware devices from the user.
Functions of I/O management
7.Security Management
Its function is quite simple, get the next command statement, and
execute it. The command statements deal with process management,
I/O handling, secondary storage management, main memory
management, file system access, protection, and networking.
System Services:
1. Program execution
2. Control Input/output devices
3. Program creation
4. Error Detection and Response
5. Accounting
6. Security and Protection
7. File Management
8. Communication
1.Program execution
3. Program Creation
The Operating system offers the structures and tools, including editors and
debuggers, to help the programmer create, modify, and debugging programs.
While working with computers, errors may occur quite often. Errors may
occur in the:
To handle these errors and other types of possible errors, the operating
system takes appropriate action and generates messages to ensure correct
and consistent computing.
5. Accounting
7. File management
8. Communication
The operating system manages the exchange of data and programs among
different computers connected over a network. This communication is
accomplished using message passing and shared memory.
Systems Calls
A system call is a way for a user program to interface with the operating
system. The program requests several services, and the OS responds by
invoking a series of system calls to satisfy the request.
1. Process Control
2. File Management
3. Device Management
4. Information Maintenance
5. Communication
1. 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.
2. File Management
1. Creating Files: Each time you save a new document or program, your
computer creates a file. It gives it a location on the hard drive or other
storage - much the way you might put a paper file into a folder.
2. Opening Files: To look at or edit a file, you open it. The operating
system will retrieve it so that you can view it or work on it.
3. Reading Files: Once the file is opened, one can read what is inside.
Be it a text file, an image, or anything else, the OS will call from
storage to be viewed and worked with.
4. Writing to Files: Every time you make a change—either by typing
into a document or touching up a picture—the operating system writes
those changes to the file.
5. Closing Files: When you are finished with it, closing the file saves
everything and marks it as not in use. It is like putting the document
back in its folder when you are finished reading or modifying it.
6. File Deletion: You just delete files whenever you think they should not
be in your system again. The operating system would then delete them
from your storage, creating more space for other things.
7. Controlling Permissions: You might sometimes need to control who
can access and edit some of the files. The OS allows you to set
permissions for each file so that you may choose whether someone
else can run, alter, or open it.
3. 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.What device management does;
4. Information Maintenance
5. Communication
System programs
In an operating system a user is able to use different types of system programs and the system
program is responsible for all the application software performance of the computer.
The system programs are responsible for the development and execution of a program and they
can be used by the help of system calls because system calls define different types of system
programs for different tasks.
File management − These programs create, delete, copy, rename, print, exit and generally
manipulate the files and directory.
Status information − It is the information regarding input, output process, storage and the CPU
utilization time how the process will be calculated in how much memory required to perform a task
is known by status information.
Programming language supports − compiler, assembler, interrupt are programming language
support used in the operating system for a particular purpose in the computer.
Programming Loading and execution − The needs to enter the program and after the loading
of a program it needs to execute the output of the programs and this task is also performed by
system calls by the help of system programs.
Communication − These services are provided by the user because by using this number of
devices communicates with each other by the help of device or wireless and communication is
necessary for the operating system.
Background services − There are different types of services available on the operating system
for communication and background service is used to change the background of your window and
it also works for scanning and detecting viruses in the computer.
System programs communicate and coordinate the activities and functions of hardware and
software of a system and also controls the operations of the hardware. An operating system is one
of the examples of system software. Operating system controls the computer hardware and acts
like an interface between the application software’s.
Utility program
It manages, maintains and controls various computer resources. Utility programs are
comparatively technical and are targeted for the users with solid technical knowledge.
Few examples of utility programs are: antivirus software, backup software and disk tools.
Device drivers
It controls the particular device connected to a computer system. Device drivers basically act as a
translator between the operating system and device connected to the system.
These tools are required in an operation system to have some software to facilitate the navigation
through the computer system.
1. Simple Structure
2. Monolithic Structure
3. Layered Approach Structure
4. Micro-Kernel Structure
5. Exo-Kernel Structure
6. Virtual Machines
Operating systems consist of many interacting parts, and the definition of the
structural relationships among these parts is called OS structure. Such a
structure ensures that it will be easy to develop, maintain, and customize the
OS for particular applications.
1. Simple Structure
There are four layers that make up the MS-DOS operating system, and each
has its own set of features.
These layers include ROM BIOS device drivers, MS-DOS device drivers,
application programs, and system programs.
The MS-DOS operating system benefits from layering because each level can
be defined independently and, when necessary, can interact with one
another.
If the system is built in layers, it will be simpler to design, manage, and
update. Because of this, simple structures can be used to build constrained
systems that are less complex.
Because MS-DOS systems have a low level of abstraction, programs and I/O
procedures are visible to end users, giving them the potential for unwanted
access.
2. MONOLITHIC STRUCTURE
The core of an operating system for computers is called the kernel (OS). All
other System components are provided with fundamental services by the
kernel.
The operating system and the hardware use it as their main interface. When
an operating system is built into a single piece of hardware, such as a
keyboard or mouse, the kernel can directly access all of its resources.
This is an old operating system that was used in banks to carry out simple
tasks like batch processing and time-sharing, which allows numerous users at
different terminals to access the Operating System.
1. Advantages of Monolithic Structure:
2. Because everything is packed into one big kernel, there is no need for
multi-layer complexities. Hence, the design and bringing into practice
of such a system is relatively easy.
3. As long as all the components run in the same memory space, there is
no need to have inter-process communication or to perform context
switching between layers; thus, execution is faster.
4. Direct access to hardware and little additional-abstraction overhead
result in high performance.
5. Development can thus be easier as developers have to deal with one
codebase only, and no interactions among various layers or modules
need to be considered.
1. Fault in any single component has the potential to bring down the
whole system since there is no isolation between different parts.
2. This can be a hard and unsafe task, as changes in one part of the
system may accidentally filter out into another part.
3. Since the components are more interdependent, debugging is also
more complex and always requires heavy testing and testing-related
activities.
4. This is an issue where scaling up or adjusting to the latest trends in a
system involves significant changes in the kernel.
5. Consequently, it will be cumbersome to update or upgrade the system
because it involves a large codebase in a monolithic form where
changes may have widespread effects.
3. LAYERED STRUCTURE
The model, in this respect, uses the functions' availability through the layer
below it. For example, memory management may have to rely on process
scheduling, while higher layers use it here with respect to user interaction.
MICRO-KERNEL STRUCTURE
By stripping away unnecessary services from the kernel, the system becomes
more secure and reliable. If a service crashes, it doesn’t affect the entire
system.
1. The just necessary services running in the kernel ensure that user
service failures don't crash the whole system.
2. It isolates the services from the kernel, thus minimizing the possibility
of compromising the system since every service operates
independently of the other.
3. Smaller kernels are easier to operate and alter. Hence, updating and
bug fixes are less challenging.
4. Services can be added or removed without affecting the kernel. So, this
gives more flexibility while designing the system.
5. Due to the small size of the micro-kernel, it can be ported on different
hardware platforms with minimal modification.
4. EXOKERNEL
An operating system called Exokernel was created at MIT with the goal of
offering application-level management of hardware resources. The exokernel
architecture's goal is to enable application-specific customization by
separating resource management from protection. Exokernel size tends to be
minimal due to its limited operability.
We can develop a virtual machine for a variety of reasons, all of which are
fundamentally connected to the capacity to share the same underlying
hardware while concurrently supporting various execution environments, i.e.,
various operating systems.
Disk systems are the fundamental problem with the virtual machine
technique. If the actual machine only has three-disc drives but needs to host
seven virtual machines, let's imagine that. It is obvious that it is impossible to
assign a disc drive to every virtual machine because the program that
creates virtual machines would require a sizable amount of disc space in
order to offer virtual memory and spooling. The provision of virtual discs is
the solution.
The result is that users get their own virtual machines. They can then use any
of the operating systems or software programs that are installed on the
machine below. Virtual machine software is concerned with programming
numerous virtual machines simultaneously into a physical machine; it is not
required to take into account any user-support software. With this
configuration, it may be possible to break the challenge of building an
interactive system for several users into two manageable chunks.
1. Running more than one virtual machine on the same host may decrease
its performance due to the sharing of the resources.
2. VMs are CPU, memory-intensive, and storage-intensive applications;
this will put a high load on host systems.
3. Managing many virtual machines requires further advanced tools and
knowledge.
4. It cannot utilize the hardware as effectively, as would a physical
machine, and hence it affects performance-related applications.
Design goals
Mechanism
Implementation
1.Design goals
Concurrent Systems
Resource Sharing
Operating system ensures that the resources of the system must be shared
in a correct fashion in between multiple user processes. It becomes more
complex when multiple users use the same device.
Operating system that is able to work with different hardware and systems is
called a portable operating system and it is a very important design goal.
Backward Compatibility
Any upgrade to the current operating system could not hinder it's
compatibility with the machine i.e. if the previous version of the operating
system is compatible with the system then the newer or upgraded version
should also be compatible with the system this is called backward
compatibility.
2. Mechanism
In an operating system there is a particular mechanism to be followed and
this mechanism is responsible for the entire task performed by the operating
system.
An Operating system provides the services to users and programs. Like I/O
operations, program execution, file system manipulation, Resource
allocation, Protection.
Program Execution
Implementation
Once the operating system is designed it must be implemented because it is
a collection of many programs written by many people over a long period of
time.
System Generations.
The First Generation ( 1945 - 1955 ):
Vacuum Tubes and Plugboards
Digital computers were not constructed until the second world war.
Calculating engines with mechanical relays were built at that time. However,
the mechanical relays were very slow and were later replaced with vacuum
tubes. These machines were enormous but were still very slow.
These early computers were designed, built and maintained by a single group
of people. Programming languages were unknown and there were no
operating systems so all the programming was done in machine language. All
the problems were simple numerical calculations.
By the 1950’s punch cards were introduced and this improved the computer
system. Instead of using plugboards, programs were written on cards and
read into the system.
The Second Generation ( 1955 - 1965 ):
Transistors and Batch Systems
Transistors led to the development of the computer systems that could be
manufactured and sold to paying customers. These machines were known as
mainframes and were locked in air-conditioned computer rooms with staff to
operate them.
The Batch System was introduced to reduce the wasted time in the
computer. A tray full of jobs was collected in the input room and read into
the magnetic tape. After that, the tape was rewound and mounted on a tape
drive. Then the batch operating system was loaded in which read the first job
from the tape and ran it. The output was written on the second tape. After
the whole batch was done, the input and output tapes were removed and the
output tape was printed.