UNIT-1 Notes OS
UNIT-1 Notes OS
Operating System
An Operating System is a System software that manages all the resources of the
computing device.
• Acts as an interface between the software and different parts of the
computer or the computer hardware.
• Manages the overall resources and operations of the computer.
• Controls and monitors the execution of all other programs that reside in
the computer, which also includes application programs and other
system software of the computer.
• Examples of Operating Systems are Windows, Linux, macOS, Android,
iOS, etc.
Advantages
Disadvantages
1. Reliability problem.
2. One must have to take of the security and integrity of user programs and
data.
3. Data communication problem.
Disadvantages
The disadvantages of real-time operating systems are as follows:
• Limited Tasks: Very few tasks run simultaneously, and their concentration
is very less on few applications to avoid errors.
• Use Heavy System Resources: Sometimes the system resources are not so
good and they are expensive as well.
• Complex Algorithms : The algorithms are very complex and difficult for
the designer to write on.
• Device Driver And Interrupt Signals: It needs specific device drivers and
interrupts signals to respond earliest to interrupts.
Types of Multiprocessors
Symmetric Multiprocessors
In these types of systems, each processor contains a similar copy of the
operating system and they all communicate with each other. All the
processors are in a peer-to-peer relationship i.e. no master - slave
relationship exists between them.
An example of the symmetric multiprocessing system is the Encore
version of Unix for the Multimax Computer.
Asymmetric Multiprocessors
In asymmetric systems, each processor is given a predefined task. There
is a master processor that gives instruction to all the other processors.
Asymmetric multiprocessor system contains a master slave relationship.
Asymmetric multiprocessor was the only type of multiprocessor
available before symmetric multiprocessors were created. Now also, this
is the cheaper option.
Advantages
1. More reliable Systems
In a multiprocessor system, even if one processor fails, the system will
not halt. This ability to continue working despite hardware failure is
known as graceful degradation. For example: If there are 5 processors in
a multiprocessor system and one of them fails, then also 4 processors
are still working. So the system only becomes slower and does not
ground to a halt.
2. Enhanced Throughput
If multiple processors are working in tandem, then the throughput of the
system increases i.e. number of processes getting executed per unit of
time increase. If there are N processors then the throughput increases by
an amount just under N.
3. More Economic Systems
Multiprocessor systems are cheaper than single processor systems in the
long run because they share the data storage, peripheral devices, power
supplies etc. If there are multiple processes that share data, it is better to
schedule them on multiprocessor systems with shared data than have
different computer systems with multiple copies of the data.
Disadvantages
1. Increased Expense
Even though multiprocessor systems are cheaper in the long run than
using multiple computer systems, still they are quite expensive. It is
much cheaper to buy a simple single processor system than a
multiprocessor system.
2. Complicated Operating System Required
There are multiple processors in a multiprocessor system that share
peripherals, memory etc. So, it is much more complicated to schedule
processes and impart resources to processes than in single processor
systems. Hence, a more complex and complicated operating system is
required in multiprocessor systems.
3. Large Main Memory Required
All the processors in the multiprocessor system share the memory. So a
much larger pool of memory is required as compared to single processor
systems.
Advantages
• Need Single CPU for implementation.
• Context switch between process.
• Switching happens when current process undergoes waiting state.
• CPU idle time is reduced.
• High resource utilization.
• High Performance.
Disadvantages
• Prior knowledge of scheduling algorithms (An algorithm that decides
which next process will get hold of the CPU) is required.
• If it has a large number of jobs, then long-term jobs will have to require a
long wait.
• Memory management is needed in the operating system because all
types of tasks are stored in the main memory.
• Using multiprogramming up to a larger extent can cause a heat-up issue.
Threading is used widely in almost every field. Most widely it is seen over the
internet nowadays where we are using transaction processing of every type like
recharges, online transfer, banking etc. Threading is a segment which divide the
code into small parts that are of very light weight and has less burden on CPU
memory so that it can be easily worked out and can achieve goal in desired
field. The concept of threading is designed due to the problem of fast and
regular changes in technology and less the work in different areas due to less
application.
Spooling
Spooling is an acronym for simultaneous peripheral operation online. Spooling
is the process of temporary storage of data for use and execution by a device,
program, or system. Data is sent to and stored in main memory or other
volatile storage until it is requested for execution by a program or computer.
Spooling makes use of the disc as a large buffer to send data to printers and
other devices. It can also be used as an input, but it is more commonly used as
an output. Its primary function is to prevent two users from printing on the
same page at the same time, resulting in their output being completely mixed
together. It prevents this because it uses the FIFO (First In First Out) strategy to
retrieve the stored jobs in the spool, and that creates a synchronization
preventing the output to be completely mixed together.
It also aids in the reduction of idle time, as well as overlapped I/O and CPU.
Simple forms of file management are frequently provided by batch systems.
The access to the file is sequential. Batch systems do not necessitate the
management of time-critical devices.
Shell Kernel
Shell allows the users to Kernel controls all the tasks of the
communicate with the kernel. system.
Its types are – Bourne Shell, C shell, Its types are – Monolithic Kernel, Micro
Korn Shell, etc. kernel, Hybrid kernel, etc.
1. Simple Structure
2. Monolithic Structure
3. Layered Approach Structure
4. Micro-Kernel Structure
What is an operating System Structure?
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. The clear structure lets the OS be built
from manageable segments; each segment contributes to the overall
system functionality.
The OS structure provides an idea of how different components are
connected and integrated within the kernel, which is the central part of
the OS. The kernel carries out sensitive tasks such as memory
management, process scheduling, and interaction with hardware. A look
into different OS structures and their relative advantages and
disadvantages is presented next.
1. Simple Structure
It is the most straightforward operating system structure, but it lacks
definition and is only appropriate for usage with tiny and restricted
systems. Since the interfaces and degrees of functionality in this structure
are clearly defined, programs are able to access I/O routines, which may
result in unauthorized access to I/O procedures.
This organizational structure is used by the MS-DOS operating system:
o There are four layers that make up the MS-DOS operating system, and
each has its own set of features.
o These layers include ROM BIOS device drivers, MS-DOS device drivers,
application programs, and system programs.
o The MS-DOS operating system benefits from layering because each level
can be defined independently and, when necessary, can interact with one
another.
o 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.
o When a user program fails, the operating system as whole crashes.
o 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.
Advantages of Simple Structure:
o It is easy to develop as it contains only a few interfaces and levels.
o It executes faster because there are fewer layers between the hardware
and applications.
o Direct access to hardware provides faster operations.
o Minimal consumption of system resources as the structure is very simple.
o Light in weight hence suitable for small or even embedded systems.
Disadvantages of Simple Structure:
o As these components are not distinctly separated, making any change or
upgrade in the system is considerably harder to achieve.
o All things are connected, and therefore, debugging is quite hectic; finding
the error is very hard.
o Due to the lack of data abstraction, a security vulnerability is a strong
possibility.
o It does not scale well to larger, more complex systems. Adding new
features is particularly challenging in this architecture.
o One failure in one part might bring down the whole system.
2. MONOLITHIC STRUCTURE
The monolithic operating system controls all aspects of the operating
system's operation, including file management, memory management,
device management, and operational operations.
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.
The monolithic operating system is often referred to as the monolithic
kernel. Multiple programming techniques such as batch processing and
time-sharing increase a processor's usability. Working on top of the
operating system and under complete command of all hardware, the
monolithic kernel performs the role of a virtual computer.
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.
The following diagram represents the monolithic structure: