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

os

The document provides an overview of Operating Systems, detailing their functions, objectives, and various types such as batch, time-sharing, distributed, and real-time systems. It explains the role of an operating system as an intermediary between users and hardware, managing resources, processes, and providing security and user interfaces. Additionally, it discusses the criteria for selecting an operating system and examples of popular operating systems like Windows, Linux, and macOS.

Uploaded by

0006devibala
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)
14 views

os

The document provides an overview of Operating Systems, detailing their functions, objectives, and various types such as batch, time-sharing, distributed, and real-time systems. It explains the role of an operating system as an intermediary between users and hardware, managing resources, processes, and providing security and user interfaces. Additionally, it discusses the criteria for selecting an operating system and examples of popular operating systems like Windows, Linux, and macOS.

Uploaded by

0006devibala
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/ 21

Operating System

UNIT-1
UNIT - I (JNTUH-R22 SYLLABUS)
Operating System - Introduction, Structures - Simple Batch, Multiprogrammed, Time-
shared, Personal Computer, Parallel, Distributed Systems, Real-Time Systems, System
components, Operating System services, System Calls
Process - Process concepts and scheduling, Operations on processes, Cooperating
Processes, Threads

UNIT-1,CHAPTER-1
OPERATING SYSTEM - INTRODUCTION

What is an Operating System?




Operating System lies in the category of system software. It basically manages all
the resources of the computer. An operating system acts as an interface between
the software and different parts of the computer or the computer hardware. The
operating system is designed in such a way that it can manage the overall
resources and operations of the computer.
Operating System is a fully integrated set of specialized programs that handle all
the operations of the computer. It 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, Mac OS, etc.
An Operating System (OS) is a collection of software that manages computer
hardware resources and provides common services for computer programs. The
operating system is the most important type of system software in a computer
system.

What is an Operating System Used for?


The operating system helps in improving the computer software as well as
hardware. Without OS, it became very difficult for any application to be user-
friendly. The Operating System provides a user with an interface that makes any
application attractive and user-friendly. The operating System comes with a large
number of device drivers that make OS services reachable to the hardware
environment. Each and every application present in the system requires the
Operating System. The operating system works as a communication channel
between system hardware and system software. The operating system helps an
application with the hardware part without knowing about the actual hardware
configuration. It is one of the most important parts of the system and hence it is
present in every device, whether large or small device.

OVER VIEW OF OPERATING SYSTEM (IN SIMPLE WORDS)

What is an Operating System?


A program that acts as an intermediary between a user of a computer and the
computer hardware
Operating system goals:
 Execute user programs and make solving user problems easier
 Make the computer system convenient to use
 Use the computer hardware in an efficient manner

Computer System Structure

Computer system can be divided into four components


Hardware – provides basic computing resources
CPU, memory, I/O devices
Operating system
Controls and coordinates use of hardware among various applications and users
Application programs – define the ways in which the system resources are used to
solve the computing problems of the users
Word processors, compilers, web browsers, database systems, video games Users
People, machines, other computers

Operating System

.
Functions of the Operating System
 Resource Management: The operating system manages and allocates
memory, CPU time, and other hardware resources among the various
programs and processes running on the computer.
 Process Management: The operating system is responsible for
starting, stopping, and managing processes and programs. It also
controls the scheduling of processes and allocates resources to them.
 Memory Management: The operating system manages the computer’s
primary memory and provides mechanisms for optimizing memory
usage.
 Security: The operating system provides a secure environment for the
user, applications, and data by implementing security policies and
mechanisms such as access controls and encryption.
 Job Accounting: It keeps track of time and resources used by various
jobs or users.
 File Management: The operating system is responsible for organizing
and managing the file system, including the creation, deletion, and
manipulation of files and directories.
 Device Management: The operating system manages input/output
devices such as printers, keyboards, mice, and displays. It provides the
necessary drivers and interfaces to enable communication between the
devices and the computer.
 Networking: The operating system provides networking capabilities
such as establishing and managing network connections, handling
network protocols, and sharing resources such as printers and files
over a network.
 User Interface: The operating system provides a user interface that
enables users to interact with the computer system. This can be
a Graphical User Interface (GUI), a Command-Line Interface (CLI), or a
combination of both.
 Backup and Recovery: The operating system provides mechanisms
for backing up data and recovering it in case of system failures, errors,
or disasters.
 Virtualization: The operating system provides virtualization
capabilities that allow multiple operating systems or applications to
run on a single physical machine. This can enable efficient use of
resources and flexibility in managing workloads.
 Performance Monitoring: The operating system provides tools for
monitoring and optimizing system performance, including identifying
bottlenecks, optimizing resource usage, and analyzing system logs and
metrics.
 Time-Sharing: The operating system enables multiple users to share a
computer system and its resources simultaneously by providing time-
sharing mechanisms that allocate resources fairly and efficiently.
 System Calls: The operating system provides a set of system calls that
enable applications to interact with the operating system and access its
resources. System calls provide a standardized interface between
applications and the operating system, enabling portability and
compatibility across different hardware and software platforms.
 Error-detecting Aids: These contain methods that include the
production of dumps, traces, error messages, and other debugging and
error-detecting methods.

Objectives of Operating Systems


Let us now see some of the objectives of the operating system, which are
mentioned below.
 Convenient to use: One of the objectives is to make the computer
system more convenient to use in an efficient manner.
 User Friendly: To make the computer system more interactive with a
more convenient interface for the users.
 Easy Access: To provide easy access to users for using resources by
acting as an intermediary between the hardware and its users.
 Management of Resources: For managing the resources of a
computer in a better and faster way.
 Controls and Monitoring: By keeping track of who is using which
resource, granting resource requests, and mediating conflicting
requests from different programs and users.
 Fair Sharing of Resources: Providing efficient and fair sharing of
resources between the users and programs.

Types of Operating Systems (IN SHORT)


 Batch Operating System: A Batch Operating System is a type of
operating system that does not interact with the computer directly.
There is an operator who takes similar jobs having the same
requirements and groups them into batches.
 Time-sharing Operating System: Time-sharing Operating System is a
type of operating system that allows many users to share computer
resources (maximum utilization of the resources).
 Distributed Operating System: Distributed Operating System is a
type of operating system that manages a group of different computers
and makes appear to be a single computer. These operating systems
are designed to operate on a network of computers. They allow
multiple users to access shared resources and communicate with each
other over the network. Examples include Microsoft Windows Server
and various distributions of Linux designed for servers.
 Network Operating System: Network Operating System is a type of
operating system that runs on a server and provides the capability to
manage data, users, groups, security, applications, and other
networking functions.
 Real-time Operating System: Real-time Operating System is a type of
operating system that serves a real-time system and the time interval
required to process and respond to inputs is very small. These
operating systems are designed to respond to events in real time. They
are used in applications that require quick and deterministic responses,
such as embedded systems, industrial control systems, and robotics.
 Multiprocessing Operating System: Multiprocessor Operating
Systems are used in operating systems to boost the performance of
multiple CPUs within a single computer system. Multiple CPUs are
linked together so that a job can be divided and executed more quickly.
 Single-User Operating Systems: Single-User Operating Systems are
designed to support a single user at a time. Examples include Microsoft
Windows for personal computers and Apple macOS.
 Multi-User Operating Systems: Multi-User Operating Systems are
designed to support multiple users simultaneously. Examples include
Linux and Unix.
 Embedded Operating Systems: Embedded Operating Systems are
designed to run on devices with limited resources, such as
smartphones, wearable devices, and household appliances. Examples
include Google’s Android and Apple’s iOS.
 Cluster Operating Systems: Cluster Operating Systems are designed
to run on a group of computers, or a cluster, to work together as a
single system. They are used for high-performance computing and for
applications that require high availability and reliability. Examples
include Rocks Cluster Distribution and OpenMPI.
.
How to Check the Operating System?
There are so many factors to be considered while choosing the best Operating
System for our use. These factors are mentioned below.
 Price Factor: Price is one of the factors to choose the correct Operating
System as there are some OS that is free, like Linux, but there is some
more OS that is paid like Windows and macOS.
 Accessibility Factor: Some Operating Systems are easy to use like
macOS and iOS, but some OS are a little bit complex to understand like
Linux. So, you must choose the Operating System in which you are
more accessible.
 Compatibility factor: Some Operating Systems support very less
applications whereas some Operating Systems supports more
application. You must choose the OS, which supports the applications
which are required by you.
 Security Factor: The security Factor is also a factor in choosing the
correct OS, as macOS provide some additional security while Windows
has little fewer security features.
Examples of Operating Systems
 Windows (GUI-based, PC)
 GNU/Linux (Personal, Workstations, ISP, File, and print server, Three-
tier client/Server)
 macOS (Macintosh), used for Apple’s personal computers and
workstations (MacBook, iMac).
 Android (Google’s Operating System for
smartphones/tablets/smartwatches)
 iOS (Apple’s OS for iPhone, iPad, and iPod Touch)

Types of Operating Systems (IN DETAIL)




An Operating System performs all the basic tasks like managing files, processes,
and memory. Thus operating system acts as the manager of all the resources,
i.e. resource manager. Thus, the operating system becomes an interface between
the user and the machine. It is one of the most required software that is present in
the device.
Operating System is a type of software that works as an interface between the
system program and the hardware. There are several types of Operating Systems
in which many of which are mentioned below. Let’s have a look at them.
Types of Operating Systems
There are several types of Operating Systems which are mentioned below.
 Batch Operating System
 Multi-Programming System
 Multi-Processing System
 Multi-Tasking Operating System
 Time-Sharing Operating System
 Distributed Operating System
 Network Operating System
 Real-Time Operating System
1. Batch Operating System
This type of operating system does not interact with the computer directly. There
is an operator which takes similar jobs having the same requirement and groups
them into batches. It is the responsibility of the operator to sort jobs with similar
needs.

Batch Operating System

Advantages of Batch Operating System


 It is very difficult to guess or know the time required for any job to
complete. Processors of the batch systems know how long the job
would be when it is in the queue.
 Multiple users can share the batch systems.
 The idle time for the batch system is very less.
 It is easy to manage large work repeatedly in batch systems.
Disadvantages of Batch Operating System
 The computer operators should be well known with batch systems.
 Batch systems are hard to debug.
 It is sometimes costly.
 The other jobs will have to wait for an unknown time if any job fails.
Examples of Batch Operating Systems: Payroll Systems, Bank Statements, etc.

2. Multi-Programming Operating System


Multiprogramming Operating Systems can be simply illustrated as more than one
program is present in the main memory and any one of them can be kept in
execution. This is basically used for better execution of resources.

Multiprogramming

Advantages of Multi-Programming Operating System


 Multi Programming increases the Throughput of the System.
 It helps in reducing the response time.
Disadvantages of Multi-Programming Operating System
 There is not any facility for user interaction of system resources with
the system.

3. Multi-Processing Operating System


Multi-Processing Operating System is a type of Operating System in which more
than one CPU is used for the execution of resources. It betters the throughput of
the System.
Multiprocessing

Advantages of Multi-Processing Operating System


 It increases the throughput of the system.
 As it has several processors, so, if one processor fails, we can proceed
with another processor.
Disadvantages of Multi-Processing Operating System
 Due to the multiple CPU, it can be more complex and somehow difficult
to understand.
4. Multi-Tasking Operating System
Multitasking Operating System is simply a multiprogramming Operating System
with having facility of a Round-Robin Scheduling Algorithm. It can run multiple
programs simultaneously.
There are two types of Multi-Tasking Systems which are listed below.
 Preemptive Multi-Tasking
 Cooperative Multi-Tasking

Multitasking

Advantages of Multi-Tasking Operating System


 Multiple Programs can be executed simultaneously in Multi-Tasking
Operating System.
 It comes with proper memory management.
Disadvantages of Multi-Tasking Operating System
 The system gets heated in case of heavy programs multiple times.
5. Time-Sharing Operating Systems
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.

Time-Sharing OS

Advantages of Time-Sharing OS
 Each task gets an equal opportunity.
 Fewer chances of duplication of software.
 CPU idle time can be reduced.
 Resource Sharing: Time-sharing systems allow multiple users to share
hardware resources such as the CPU, memory, and peripherals,
reducing the cost of hardware and increasing efficiency.
 Improved Productivity: Time-sharing allows users to work
concurrently, thereby reducing the waiting time for their turn to use
the computer. This increased productivity translates to more work
getting done in less time.
 Improved User Experience: Time-sharing provides an interactive
environment that allows users to communicate with the computer in
real time, providing a better user experience than batch processing.
Disadvantages of Time-Sharing OS
 Reliability problem.
 One must have to take care of the security and integrity of user
programs and data.
 Data communication problem.
 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.
Complexity: Time-sharing systems are complex and require advanced
software to manage multiple users simultaneously. This complexity
increases the chance of bugs and errors.
 Security Risks: With multiple users sharing resources, the risk of
security breaches increases. Time-sharing systems require careful
management of user access, authentication, and authorization to
ensure the security of data and software.
Examples of Time-Sharing OS with explanation
 IBM VM/CMS: IBM VM/CMS is a time-sharing operating system that
was first introduced in 1972. It is still in use today, providing a virtual
machine environment that allows multiple users to run their own
instances of operating systems and applications.
 TSO (Time Sharing Option): TSO is a time-sharing operating system
that was first introduced in the 1960s by IBM for the IBM System/360
mainframe computer. It allowed multiple users to access the same
computer simultaneously, running their own applications.
 Windows Terminal Services: Windows Terminal Services is a time-
sharing operating system that allows multiple users to access a
Windows server remotely. Users can run their own applications and
access shared resources, such as printers and network storage, in real-
time.

6. Distributed Operating System


These types of operating system is a recent advancement in the world of computer
technology and are being widely accepted all over the world and, that too, at a
great pace. Various autonomous interconnected computers communicate with
each other using a shared communication network. Independent systems possess
their own memory unit and CPU. These are referred to as loosely coupled systems
or distributed systems. These systems’ processors differ in size and function. The
major benefit of working with these types of the operating system is that it is
always possible that one user can access the files or software which are not
actually present on his system but some other system connected within this
network i.e., remote access is enabled within the devices connected in that
network.

Distributed OS
Advantages of Distributed Operating System
 Failure of one will not affect the other network communication, as all
systems are independent of each other.
 Electronic mail increases the data exchange speed.
 Since resources are being shared, computation is highly fast and
durable.
 Load on host computer reduces.
 These systems are easily scalable as many systems can be easily added
to the network.
 Delay in data processing reduces.
Disadvantages of Distributed Operating System
 Failure of the main network will stop the entire communication.
 To establish distributed systems the language is used not well-defined
yet.
 These types of systems are not readily available as they are very
expensive. Not only that the underlying software is highly complex and
not understood well yet.
Examples of Distributed Operating Systems are LOCUS, etc.
The distributed os must tackle the following issues:
 Networking causes delays in the transfer of data between nodes of a
distributed system. Such delays may lead to an inconsistent view of
data located in different nodes, and make it difficult to know the
chronological order in which events occurred in the system.
 Control functions like scheduling, resource allocation, and deadlock
detection have to be performed in several nodes to achieve
computation speedup and provide reliable operation when computers
or networking components fail.
 Messages exchanged by processes present in different nodes may
travel over public networks and pass through computer systems that
are not controlled by the distributed operating system. An intruder
may exploit this feature to tamper with messages, or create fake
messages to fool the authentication procedure and masquerade as a
user of the system.

7. Network Operating System


These systems run on a server and provide the capability to manage data, users,
groups, security, applications, and other networking functions. These types of
operating systems allow shared access to files, printers, security, applications, and
other networking functions over a small private network. One more important
aspect of Network Operating Systems is that all the users are well aware of the
underlying configuration, of all other users within the network, their individual
connections, etc. and that’s why these computers are popularly known as tightly
coupled systems.
Network Operating System

Advantages of Network Operating System


 Highly stable centralized servers.
 Security concerns are handled through servers.
 New technologies and hardware up-gradation are easily integrated into
the system.
 Server access is possible remotely from different locations and types of
systems.
Disadvantages of Network Operating System
 Servers are costly.
 User has to depend on a central location for most operations.
 Maintenance and updates are required regularly.
Examples of Network Operating Systems are Microsoft Windows Server 2003,
Microsoft Windows Server 2008, UNIX, Linux, Mac OS X, Novell NetWare, BSD, etc.
8. Real-Time Operating System
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.
Types of Real-Time Operating Systems
 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.
Real-Time Operating System

Advantages of RTOS
 Maximum Consumption: Maximum utilization of devices and systems,
thus more output from all the resources.
 Task Shifting: The time assigned for shifting tasks in these systems is
very less. For example, in older systems, it takes about 10
microseconds in shifting from one task to another, and in the latest
systems, it takes 3 microseconds.
 Focus on Application: Focus on running applications and less
importance on applications that are in the queue.
 Real-time operating system in the embedded system: Since the size
of programs is small, RTOS can also be used in embedded systems like
in transport and others.
 Error Free: These types of systems are error-free.
 Memory Allocation: Memory allocation is best managed in these types
of systems.
Disadvantages of RTOS
 Limited Tasks: Very few tasks run at the same time and their
concentration is very less on a 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 signal to respond earliest to interrupts.
 Thread Priority: It is not good to set thread priority as these systems
are very less prone to switching tasks.
Examples of Real-Time Operating Systems are Scientific experiments, medical
imaging systems, industrial control systems, weapon systems, robots, air traffic
control systems, etc.
Operating System Services

Operating system is a software that acts as an intermediary between the user and
computer hardware. It is a program with the help of which we are able to run
various applications. It is the one program that is running all the time. Every
computer must have an operating system to smoothly execute other programs.
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. Communication between Process
4. File Management
5. Memory Management
6. Process Management
7. Security and Privacy
8. Resource Management
9. User Interface
10. Networking
11. Error handling
12. Time Management
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. The
Operating System utilizes various resources available for the efficient running of
all types of functionalities.
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. It also provides access to input-output
devices to a program when needed.
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.
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. The
Operating System decides how the data should be manipulated and stored.
Memory Management
Let’s understand memory management by OS in simple way. Imagine a cricket
team with limited number of player . The team manager (OS) decide whether the
upcoming player will be in playing 11 ,playing 15 or will not be included in team ,
based on his performance . In the same way, OS first check whether the upcoming
program fulfil all requirement to get memory space or not ,if all things good, it
checks how much memory space will be sufficient for program and then load the
program into memory at certain location. And thus , it prevents program from
using unnecessary memory.
Process Management
Let’s understand the process management in unique way. Imagine, our kitchen
stove as the (CPU) where all cooking(execution) is really happen and chef as the
(OS) who uses kitchen-stove(CPU) to cook different dishes(program). The
chef(OS) has to cook different dishes(programs) so he ensure that any particular
dish(program) does not take long time(unnecessary time) and all
dishes(programs) gets a chance to cooked(execution) .The chef(OS) basically
scheduled time for all dishes(programs) to run kitchen(all the system) smoothly
and thus cooked(execute) all the different dishes(programs) efficiently.
Security and Privacy
 Security : OS keep our computer safe from an unauthorized user by
adding security layer to it. Basically, Security is nothing but just a layer
of protection which protect computer from bad guys like viruses and
hackers. OS provide us defences like firewalls and anti-virus software
and ensure good safety of computer and personal information.
 Privacy : OS give us facility to keep our essential information hidden
like having a lock on our door, where only you can enter and other are
not allowed . Basically , it respect our secrets and provide us facility to
keep it safe.
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. The OS also
ensures the proper use of all the resources available by deciding which resource
to be used by whom.
User Interface
User interface is essential and all operating systems provide it. Users either
interface with the operating system through the command-line interface or
graphical user interface or GUI. The command interpreter executes the next user-
specified command.
A GUI offers the user a mouse-based window and menu system as an interface.
Networking
This service enables communication between devices on a network, such as
connecting to the internet, sending and receiving data packets, and managing
network connections.
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. It also
looks for any type of error or bugs that can occur while any task. The well-
secured OS sometimes also acts as a countermeasure for preventing any sort of
breach of the Computer System from any external source and probably handling
them.
Time Management
Imagine traffic light as (OS), which indicates all the cars(programs) whether it
should be stop(red)=>(simple queue) , start(yellow)=>(ready
queue),move(green)=>(under execution) and this light (control) changes after a
certain interval of time at each side of the road(computer system) so that the
cars(program) from all side of road move smoothly without traffic.
Unlock the Power of Placement Preparation!

SYSTEM CALLS IN OPERATING SYSTEM


What are system calls in Operating System?
The interface between a process and an operating system is provided by system
calls. In general, system calls are available as assembly language instructions.
They are also included in the manuals used by the assembly level programmers.
System calls are usually made when a process in user mode requires access to a
resource. Then it requests the kernel to provide the resource via a system call.
A figure representing the execution of the system call is given as follows −
As can be seen from this diagram, the processes execute normally in the user
mode until a system call interrupts this. Then the system call is executed on a
priority basis in the kernel mode. After the execution of the system call, the control
returns to the user mode and execution of user processes can be resumed.
In general, system calls are required in the following situations −
 If a file system requires the creation or deletion of files. Reading and
writing from files also require a system call.
 Creation and management of new processes.
 Network connections also require system calls. This includes
sending and receiving packets.
 Access to a hardware-devices such as a printer, scanner etc. requires
a system call.

Types of System Calls

There are mainly five types of system calls. These are explained in detail as
follows

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

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.

Examples of Windows and Unix system calls


Some of the examples of all the above types of system calls in Windows and Unix
are given as follows –
(PLEASE REFER LAST TABLE AT THE END)

Here, you will learn about some methods briefly:

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. Many processes can
open a file at once or by a single process only. It's all based on the file system and
structure.

read()
It 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.

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.

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.

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.

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

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.

Process WINDOWS UNIX

Process Control CreateProcess() Fork()


ExitProcess() Exit()
WaitForSingleObject() Wait()

File Manipulation CreateFile() Open()


ReadFile() Read()
WriteFile() Write()
CloseHandle() Close()

Device Management SetConsoleMode() Ioctl()


ReadConsole() Read()
WriteConsole() Write()

Information GetCurrentProcessID() Getpid()


Maintenance SetTimer() Alarm()
Sleep() Sleep()

Communication CreatePipe() Pipe()


CreateFileMapping() Shmget()
MapViewOfFile() Mmap()

Protection SetFileSecurity() Chmod()


InitializeSecurityDescriptor() Umask()
SetSecurityDescriptorgroup() Chown()

UNIT-1, CHAPTER-1 COMPLETED

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy