Notes unit 1& 2 OS
Notes unit 1& 2 OS
An operating system (OS) is the software which helps in operating both hardware and
software of the computer and it also manages all other application programs in a computer.
An operating system (OS) is system software that manages computer hardware, software
resources, and provides common services for computer programs. The communication between a
user and a system takes place with the help of operating systems.
Windows, Linux, and Android are examples of operating systems that enable the user to use
programs like MS Office, Notepad, and games on the computer or mobile phone.
There are several different types of operating systems present. In this section, we will discuss the
advantages and disadvantages of these types of OS.
Batch OS
Distributed OS
Time Sharing OS/Multitasking OS
Network OS
Real-time OS
Batch OS is the first operating system for second-generation computers. These systems execute
batches of jobs without user interaction. Jobs are collected, processed in groups, and then the results
are produced.
Advantages of Batch OS
Failure of one system will not affect the other systems because all the computers are
independent of each other.
The load on the host system is reduced.
The size of the network is easily scalable as many computers can be added to the
network.
As the workload and resources are shared therefore the calculations are
performed at a higher speed.
Data exchange speed is increased with the help of electronic mail.
Disadvantages of Distributed OS
The multitasking OS is also known as the time-sharing operating system as each task is
given some time so that all the tasks work efficiently. This system provides access to a large
number of users, and each user gets the time of CPU as they get in a single system. The tasks
performed are given by a single user or by different users. The time allotted to execute one task
is called a quantum, and as soon as the time to execute one task is completed, the system
switches over to another task.
Advantages of Multitasking OS
Disadvantages of Multitasking OS
Processes with higher priority cannot be executed first as equal priority is given to
eachprocess or task.
Various user data is needed to be taken care of from unauthorized access.
Sometimes there is a data communication problem.
Examples of Multitasking OS: UNIX, etc.
Network operating systems are the systems that run on a server and manage all the networking
functions. They allow sharing of various files, applications, printers, security, and other networking
functions over a small network of computers like LAN or any other private network. In the
network OS, all the users are aware of the configurations of every other user within the network,
which is why network operating systems are also known as tightly coupled systems.
Advantages of Network OS
Real-Time operating systems serve real-time systems. These operating systems are useful when
many events occur in a short time or within certain deadlines, such as real-time simulations.
Hard real-time OS
The hard real-time OS is the operating system for mainly the applications in which the slightest
delay is also unacceptable. The time constraints of such applications are very strict. Such
systems are built for life-saving equipment like parachutes and airbags, which immediately need to
be in action if an accident happens.
Soft real-time OS
The soft real-time OS is the operating system for applications where time constraint is not very
strict.
In a soft real-time system, an important task is prioritized over less important tasks, and this
priority remains active until the completion of the task. Furthermore, a time limit is always set
for a specific job, enabling short time delays for future tasks, which is acceptable.
For Example, virtual reality,reservation systems, etc.
Advantages of Real-Time OS
It provides more output from all the resources as there is maximum utilization of
systems.
It provides the best management of memory allocation.
These systems are always error-free.
These operating systems focus more on running applications than those in the queue.
Shifting from one task to another takes very little time.
Disadvantages of Real-Time OS
o Program execution
o Control Input/output devices
o Program creation
o Error Detection and Response
o Accounting
o Security and Protection
o File Management
o Communication
Program execution
To execute a program, several tasks need to be performed. Both the instructions and data must be
loaded into the main memory. In addition, input-output devices and files should be initialized, and
other resources must be prepared. The Operating structures handle these kinds of tasks. The user
now no longer should fear the reminiscence allocation or multitasking or anything.
Control Input/output devices
As there are numerous types of I/O devices within the computer system, and each I/O device calls
for its own precise set of instructions for the operation. The Operating System hides that info with
the aid of presenting a uniform interface. Thus, it is convenient for programmers to access such
devices easily.
Program Creation
The Operating system offers the structures and tools, including editors and debuggers, to help the
programmer create, modify, and debugging programs.
An Error in a device may also cause malfunctioning of the entire device. These include hardware
and software errors such as device failure, memory error, division by zero, attempts to access
forbidden memory locations, etc. To avoid error, the operating system monitors the system for
detecting errors and takes suitable action with at least impact on running applications.
o Input/ Output devices: For example, connection failure in the network, lack of paper
in theprinter, etc.
o User program: For example: attempt to access illegal memory locations, divide by zero,
use toomuch CPU time, etc.
o Memory hardware: For example, Memory error, the memory becomes full, etc.
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.
Accounting
An Operating device collects utilization records for numerous assets and tracks the overall
performance parameters and responsive time to enhance overall performance. These personal
records are beneficial for additional upgrades and tuning the device to enhance overall
performance.
Operating device affords safety to the statistics and packages of a person and protects any
interference from unauthorized users. The safety feature counters threats, which are published via
way of individuals out of doors the manager of the running device.
File management
Computers keep data and information on secondary storage devices like magnetic tape, magnetic
disk, optical disk, etc. Each storage media has its capabilities like speed, capacity, data transfer rate,
and data access methods.
For file management, the operating system must know the types of different files and the
characteristics of different storage devices. It has to offer the proportion and safety mechanism of
documents additionally.
Communication
The operating system manages the exchange of data and programs among different computers
connectedover a network. This communication is accomplished using message passing and shared
memory.
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. A system call can be written in assembly language or a high-level language like C
or Pascal. System calls are predefined functions that the operating system may directly invoke if a
high-level language is used.
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.
System calls are the mechanisms through which user applications interact with the operating system's
kernel. They provide a way for programs to request services from the OS, such as file manipulation,
process control, and communication. System calls act as an interface between user-level applications
and the hardware or low-level system functionalities.
1) Process control
2) File management
3) Device Management
4) Information maintenance
5) Communication
End, abort
Load ,execute
Create process, terminate process
Get process attribute, Set process attribute
Wait for time
Wait event, signal event
Allocate and for memory
What is Kernel?
A kernel is the core part of an operating system. It acts as a bridge between software
applications and the hardware of a computer. The kernel manages system resources, such as
the CPU, memory, and devices, ensuring everything works together smoothly and efficiently.
It handles tasks like running programs, accessing files, and connecting to devices like
printers and keyboards.
Types of Kernel
1) Monolithic kernel
2) Microkernel
OS Structure
1) Monolithic kernel
2) Microkernel
3) Layered OS Structure
1) Monolithic kernel
In a Monolithic kernel, the entire operating system runs as a single program in kernel mode.
The user services and kernel services are implemented in the same address space.
A monolithic kernel is a type of operating system architecture where the entire operating
system, including core functions like memory management, process management, device
drivers, and file systems, is integrated into a single large block of code running in a single
address space.
This design can make the system faster because all components can interact directly, but it
can also make the system more complex and harder to maintain, as a bug in one part of the
kernel can potentially affect the entire system.
2) Micro- kernel
The kernel manages the operations of the computer, In microkernel, the user services and
kernel services are implemented in different address spaces.
The user services are kept in the user address space, and kernel services are kept under the
kernel address space.
A microkernel is a minimalistic approach to designing an operating system.
In microkernel architecture, only the most essential functions are included in the kernel,
such as basic communication between hardware and software, and simple process
management.
Other services like device drivers, file systems, and network protocols are run in user space
as separate processes.
3) Layered OS Structure
The layered structure of an operating system is a design approach that organizes the system
into distinct levels or layers, each responsible for different functions. This structure
enhances modularity, making the OS easier to manage, understand, and maintain. Here’s a
breakdown of the typical layers:
1. Hardware Layer: This is the lowest layer, consisting of the physical hardware of the
computer, such as the CPU, memory, and storage devices.
2. Kernel Layer: The kernel is the core component of the OS, directly interacting with the
hardware. It manages system resources, provides essential services like process
management, memory management, device management, and system calls.
3. System Call Interface: This layer provides an interface for user programs to interact with
the kernel. It defines the set of system calls available to user applications for performing
operations like file manipulation, process control, and communication.
4. Device Drivers: These are specialized modules within the kernel that manage
communication between the operating system and hardware devices. Device drivers handle
the specifics of how data is transmitted to and from hardware devices.
5. User Interface: This layer provides the means for users to interact with the operating
system. It includes graphical user interfaces (GUIs) or command-line interfaces (CLIs),
depending on the OS design.
6. Application Layer: The topmost layer includes all the application programs that users run,
such as word processors, web browsers, and games. This layer interacts with the OS through
system calls and libraries.