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

OPS-unit-01

The document outlines the essential components and services of an operating system, including process management, I/O device management, file management, network management, main memory management, secondary storage management, and security management. It also discusses system calls, kernel architecture, and the distinction between user mode and kernel mode. Additionally, it highlights the advantages and disadvantages of the kernel, as well as the types of kernels.

Uploaded by

patilyashita22
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)
7 views

OPS-unit-01

The document outlines the essential components and services of an operating system, including process management, I/O device management, file management, network management, main memory management, secondary storage management, and security management. It also discusses system calls, kernel architecture, and the distinction between user mode and kernel mode. Additionally, it highlights the advantages and disadvantages of the kernel, as well as the types of kernels.

Uploaded by

patilyashita22
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/ 12

❖ Important Components of the Operating System:

• Process management
• I/O device management
• Files management
• Network management
• Main memory management
• Secondary storage management
• Security management

1. Process management:
⎯ A process is program that is loaded in main memory. A process needs
certain resources including CPU time, Memory, Files, and I/O devices to
accomplish its task. The process management component manages the
multiple processes running simultaneously on the Operating System.
⎯ A program in running state is called a process.
⎯ The operating system is responsible for the following activities in
connection with process management:
⎯ Create, load, execute, suspend, resume, and terminate processes.
⎯ Switch system among multiple processes in main memory.
⎯ Provides communication mechanisms so that processes can communicate
with each other’s
⎯ Provides synchronization mechanisms to control concurrent access to
shared data to keep shared data consistent.
⎯ Allocate/de-allocate resources properly to prevent or avoid deadlock
situation.

2. I/O device management:


⎯ One of the purposes of an operating system is to hide the peculiarities of specific
hardware devices from the user.
⎯ I/O Device Management provides an abstract level of H/W devices and keep the
details from applications to ensure proper use of devices, to prevent errors, and
to provide users with convenient and efficient programming environment.
⎯ Following are the tasks of I/O Device Management component:
• Hide the details of H/W devices
• Manage main memory for the devices using cache, buffer, and spooling
• Maintain and provide custom drivers for each device.

3. File management:
⎯ File management is one of the most visible services of an operating system.
⎯ Computers can store information in several different physical forms;
magnetic tape, disk, and drum are the most common forms.
⎯ A file is defined as a set of correlated information and it is defined by the
creator of the file.
⎯ Mostly files represent data, source and object forms, and programs. Data
files can be of any type like alphabetic, numeric
⎯ A files is a sequence of bits, bytes, lines or records whose meaning is
defined by its creator and user.
⎯ Also files are normally organized into directories to ease their use. These
directories may contain files and other directories and so on.
⎯ The operating system is responsible for the following activities in
connection with file management:
⎯ File creation and deletion
⎯ Directory creation and deletion
⎯ The support of primitives for manipulating files and directories
⎯ Mapping files onto secondary storage
⎯ File backup on stable (non-volatile) storage media

4. Network Management:
⎯ Network management is the process of managing and administering a
computer network. A computer network is a collection of various types of
computers connected with each other.
⎯ Network management comprises fault analysis, maintaining the quality of
service, provisioning of networks, and performance management.
⎯ Network management is the process of keeping your network healthy for an
efficient communication between different computers.
⎯ Following are the features of network management:

• Network administration
• Network maintenance
• Network operation
• Network provisioning
• Network security

5. Main Memory 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.
⎯ It should be mapped to absolute addresses and loaded inside the memory
to execute a program. The selection of a memory management method
depends on several factors.
⎯ Main memory offers fast storage that can be accessed directly by the CPU.
It is costly and hence has a lower storage capacity. However, for a
program to be executed, it must be in the main memory.

⎯ Functions of Memory management:
⎯ An Operating System performs the following functions for Memory
Management in the operating system:
⎯ It helps you to keep track of primary memory.
⎯ Determine what part of it are in use by whom, what part is not in use.
⎯ Allocates the memory when a process requests.
⎯ It also de-allocates the memory when a process no longer requires or has
been terminated.

6. Secondary Storage Management:

⎯ The main purpose of a computer system is to execute programs. These


programs, together with the data they access, must be in main memory
during execution.
⎯ Since the main memory is too small to permanently accommodate all data
and program, the computer system must provide secondary storage to
backup main memory.
⎯ Assemblers and compilers are stored on the disk until they are loaded into
the memory and use the disk for processing.
⎯ Following are the features of secondary-storage management:

• Allocates storage
• Manages free space
• Disk scheduling

7. Security Management:

⎯ It is necessary to protect the processes from each other’s activities. Security


management ensures that the operating files, memory, CPU, and other
hardware resources have proper authorization from the OS.
⎯ No process can do its own I/O, this maintains the integrity of peripheral
devices.

❖ Operating System Services:


⎯ The OS coordinates the use of the hardware and application programs for
various users. It provides a platform for other application programs to work.
⎯ The operating system is a set of special programs that run on a computer
system that allows it to work properly.
⎯ It controls input-output devices, execution of programs, managing files, etc.
⎯ Services of Operating System:
1. Program Execution
2. Input Output Operations
3. File Management
4. Error Handling
5. Resource Management
6. Communication between Processes
1. Program Execution:

⎯ It is the Operating System that manages how a program is going to be executed.


It loads the program into the memory after which it is executed. The order in
which they are executed depends on the CPU Scheduling Algorithms.
⎯ A few are FCFS, SJF, etc. When the program is in execution, the Operating
System also handles deadlock i.e. no two processes come for execution at the
same time.
⎯ The Operating System is responsible for the smooth execution of both user
and system programs.

2. Input Output Operations:

⎯ Operating System manages the input-output operations and establishes


communication between the user and device drivers.
⎯ Device drivers are software that is associated with hardware that is being
managed by the OS so that the sync between the devices works properly.

3. File Management:
⎯ The operating system helps in managing files also. If a program needs
access to a file, it is the operating system that grants access. These
permissions include read-only, read-write, etc.
⎯ It also provides a platform for the user to create, and delete files. The
Operating System is responsible for making decisions regarding the
storage of all types of data or files, i.e, floppy disk/hard disk/pen drive,
etc.
4. Error Handling:
⎯ The Operating System also handles the error occurring in the CPU, in
Input-Output devices, etc.
⎯ It also ensures that an error does not occur frequently and fixes the
errors. It also prevents the process from coming to a deadlock.
5. Resource Management:
⎯ System resources are shared between various processes. It is the
Operating system that manages resource sharing.
⎯ It also manages the CPU time among processes using CPU Scheduling
Algorithms.
⎯ It also helps in the memory management of the system.
⎯ It also controls input-output devices.

6. Communication between processes:


⎯ The Operating system manages the communication between processes.
Communication between processes includes data transfer among them.
⎯ If the processes are not on the same computer but connected through a
computer network, then also their communication is managed by the
Operating System itself.
7. Security and protection:
⎯ In an operating system, protection is a mechanism that controls the
access of the process, programs, or users over any resources of the
computer system.
⎯ The operating system ensures that all access to system resources must
be monitored and controlled.
⎯ It also ensures that the external resources or peripherals must be
protected from invalid access.
⎯ It provides authentication by using usernames and passwords.

❖ Virtual Machines in Operating System:


⎯ virtual machine (VM) is a virtual environment which functions as a
virtual computer system with its own CPU, memory, network interface,
and storage, created on a physical hardware system.
⎯ It has its own operating system and software that will facilitate the
resources to virtual computers.

⎯ The characteristics of the virtual machines are as follows −

• Multiple OS systems use the same hardware and partition resources


between virtual computers.
• Separate Security and configuration identity.
• Ability to move the virtual computers between the physical host computers
as holistically integrated files.
• The below diagram shows you the difference between the single OS with
no VM and Multiple OS with VM −

❖ System 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.
⎯ A system call can be written in assembly language or a high-level
language like C or Pascal.
⎯ 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.
⎯ When a computer software needs to access the operating system's kernel,
it makes a system call.
⎯ The system call uses an API to expose the operating system's services to
user programs. It is the only method to access the kernel system.
⎯ All programs or processes that require resources for execution must use
system calls, as they serve as an interface between the operating system
and user programs.

➢ Types of System Calls

There are commonly five types of system calls. These are as follows:

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

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.
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.

4.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.

5.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.

Examples of system calls

1.open()
⎯ The open() system call allows you to access a file on a file system. It allocates
resources to the file and provides a handle that the process may refer to.

t is used to obtain data from a file on the file system. It accepts three arguments in
general:

o A file descriptor.
o A buffer to store read data.
o The number of bytes to read from the file.

The file descriptor of the file to be read could be used to identify it and open it
using open() before reading.

2.wait()

In some systems, a process may have to wait for another process to complete its
execution before proceeding. When a parent process makes a child process, the parent
process execution is suspended until the child process is finished. The wait() system
call is used to suspend the parent process. Once the child process has completed its
execution, control is returned to the parent process.

3.write()

It is used to write data from a user buffer to a device like a file. This system call is one
way for a program to generate data. It takes three arguments in general:

o A file descriptor.
o A pointer to the buffer in which data is saved.
o The number of bytes to be written from the buffer.

4.fork()

Processes generate clones of themselves using the fork() system call. It is one of the
most common ways to create processes in operating systems. When a parent process
spawns a child process, execution of the parent process is interrupted until the child
process completes. Once the child process has completed its execution, control is
returned to the parent process.

5.close()

It is used to end file system access. When this system call is invoked, it signifies that
the program no longer requires the file, and the buffers are flushed, the file information
is altered, and the file resources are de-allocated as a result.

6.exec()

When an executable file replaces an earlier executable file in an already executing


process, this system function is invoked. As a new process is not built, the old process
identification stays, but the new process replaces data, stack, data, head, etc.

7.exit()

The exit() is a system call that is used to end program execution. This call indicates that
the thread execution is complete, which is especially useful in multi-threaded
environments. The operating system reclaims resources spent by the process following
the use of the exit() system function.

❖ Kernel Architecture
⎯ Kernel is central component of an operating system that manages operations
of computer and hardware.
⎯ Kernel loads first into memory when an operating system is loaded and
remains into memory until operating system is shut down again. It is
responsible for various tasks such as disk management, task management, and
memory management.
⎯ A kernel must be fast and responsive. It needs to handle all the requests and
responses quickly and efficiently. To do this, the Kernel uses a lot of kernel-
level memory.
⎯ This memory is isolated from the main memory of your computer. This means
that the Kernel can use it to store data and code without affecting other
applications.
⎯ The Kernel controls everything that goes on in your computer, from launching
applications to managing your files. The Kernel is also responsible for security,
ensuring unauthorized users can’t access your system.

Advantages of the Kernel

⎯ It is responsible for managing the system’s resources, including memory,


processors, and devices.

Disadvantages of the Kernel

⎯ The Kernel can be vulnerable to attacks. If an attacker can exploit a


vulnerability in the Kernel, they could gain access to your system and damage
or steal your data.

User-mode and kernel mode

User Mode

When an application like MS word handling a text editor runs on the operating
system, the system is in user mode. The mode bit is 0 in that case. The mode bit will
change from 1 to 0 if it switches to kernel mode. The user mode to kernel mode is
switched when there is a need to access any device or any interrupt/system call
occurs.

Kernel-mode

When the system boots, the system starts with kernel mode. And the applications are
executed in user mode. The switch can happen from user mode to kernel mode when
• Interrupt
occurs
• The mode bit is changed from 0 to 1 in case of the system switch back to user
mode.

Types of the Kernel

1. Simple structure:

⎯ Such operating systems do not have well defined structure and are small,
simple and limited systems. The interfaces and levels of functionality are
not well separated. MS-DOS is an example of such operating system.
⎯ In MS-DOS application programs are able to access the basic I/O
routines.
⎯ These types of operating system cause the entire system to crash if one of
the user programs fails.

Advantages of Simple structure:


• It delivers better application performance because of the few interfaces
between the application program and the hardware.
• Easy for kernel developers to develop such an operating system.
Disadvantages of Simple structure:
• The structure is very complicated as no clear boundaries exists between
modules.
• It does not enforce data hiding in the operating system.

2. Layered Struture:

⎯ An OS can be broken into pieces and retain much more control on


system. In this structure the OS is broken into number of layers
(levels).
⎯ The bottom layer (layer 0) is the hardware and the topmost layer
(layer N) is the user interface.
⎯ These layers are so designed that each layer uses the functions of the
lower level layers only.
⎯ This simplifies the debugging process as if lower level layers are
debugged and an error occurs during debugging then the error must
be on that layer only as the lower level layers have already been
debugged.
⎯ The main disadvantage of this structure is that at each layer, the data
needs to be modified and passed on which adds overhead to the
system.
⎯ Advantages of Layered structure:
• Layering makes it easier to enhance the operating system as
implementation of a layer can be changed easily without affecting the
other layers.
• It is very easy to perform debugging and system verification.
Disadvantages of Layered structure:
• In this structure the application performance is degraded as compared to
simple structure.
• It requires careful planning for designing the layers as higher layers use
the functionalities of only the lower layers.

3. Micro-kernel:
This structure designs the operating system by removing all non-
essential components from the kernel and implementing them as
system and user programs. This result in a smaller kernel called the
micro-kernel.
Advantages of this structure are that all new services need to be added
to user space and does not require the kernel to be modified.
Thus it is more secure and reliable as if a service fails then rest of the
operating system remains untouched. Mac OS is an example of this
type of OS.
Advantages of Micro-kernel structure:
• It makes the operating system portable to various platforms.
• As microkernels are small so these can be tested effectively.
Disadvantages of Micro-kernel structure:
• Increased level of inter module communication degrades system
performance.

4. Monolithic Kernel:
⎯ In Monolithic kernel mode, operating system runs in a single
address space.
⎯ Monolithic kernel has all the operating system functions or
services within a single kernel. This single kernel will run as
a single process in a single address space in memory.
⎯ Monolithic architecture enables higher performance however
less flexible for modifications to add new features or enhance
existing features.

Examples:
Windows 1, Windows 2, Windows 3, Windows 95, Windows 98,

• All Linux distribtions - CentOS, Ubuntu, Red Hat's Fedora, Red Hat

Enterprise, Open SUSE and all other linux distributions

• Android uses a modified Linux Kernel

You might also like