0% found this document useful (0 votes)
79 views11 pages

Unit II OSY Handout Revised 01.08.2023

Uploaded by

dhanashree
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)
79 views11 pages

Unit II OSY Handout Revised 01.08.2023

Uploaded by

dhanashree
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/ 11

Unit II – Services and Components of Operating System

COURSE INFORMATION SHEET


Program- Computer Engineering
Semester- Fifth Scheme-I
Course- Operating System(OSY) Course Code-22516
Name of faculty: Mr.Vijay N. Kukre
Theory- 3 Hrs/ Week Practical:- Hrs/Week- 2

Course Outcomes:-
CO Course Outcome (CO) Statements PO addressed
C22516.b Use operating system tools to perform various function
1,2,3,4,5,6,7

List of Reference Books


Sr.No. Title Author Publications
1. Operating System Concepts Silberschatz Galvin John Wiley and Sones
9th Edition - 2015
2. Operating System Godbole Achyut S Tata McGraw Hill
Education 2015
3. Operating System: Internals William Stalling Pearson 8th Edition
and Design Principles 2015
4. Unix Concepts and Sumitabh Das McGraw Hill
Programming Education 2015
5. Operating System Dhananjay Dhamdhere McGraw Hill
Education 2015
6. Operating System Dr. Rajendra Kawale Devraj Publications
Mumbai
7. Linux Command Line and Richard Blum Wiley Publishing
Shell Scripting-Bible
List of Web Sites
1. https://www.geeksforgeeks.org/ipc-shared-memory/
2. https://www.javatpoint.com/what-is-inter-process-communication
3. https://www.javatpoint.com/system-calls-in-operating-system
4. https://www.linux.org/
5. https://www.tutorialspoint.com/operating_system/os_linux.htm
6. https://opensource.com/resources/linux
List of PPTs
1 Ppts on all chapters

Mr. V.N.Kukre Page 1 of 11


Unit II – Services and Components of Operating System

2.1 Different Services of Operating System


An Operating System provides different kinds of services to both the users and to the programs
as well. It also provides application programs (that run within an Operating system) an
environment to execute freely. It provides users the services to run various programs in a
convenient manner.
Following are a few common services provided by an operating system
1. User Interface
2. Program Execution
3. File system manipulation
4. Input / Output Operations
5. Communication
6. Resource Allocation
7. Error Detection
8. Accounting
9. Security and protection
1. User Interface:
Usually Operating system comes in three forms or types. Depending on the interface their types
have been further subdivided. These are:
 Command line interface
 Batch based interface
 Graphical User Interface
Let's get to know in brief about each of them.
The Command Line Interface (CLI) usually deals with using text commands and a technique
for entering those commands.
The Batch interface (BI): commands and directives are used to manage those commands that
are entered into files and those files get executed.
Graphical user interface (GUI): which is a window system with a pointing device (like mouse
or trackball) to point to the I/O, choose from menus driven interface and to make choices
viewing from a number of lists and a keyboard to entry the texts.
2. Program Execution:
The operating system must have the capability to load a program into memory and execute that
program. Furthermore, the program must be able to end its execution, either normally or
abnormally / forcefully.
To run a program, the program is required to be loaded into the RAM first and then to assign
CPU time for its execution. Operating system performs this function for the convenience of the
user. It also performs other important tasks like allocation and de-allocation of memory, CPU
scheduling etc.
Following are the major activities of an operating system with respect to program
management −
 Loads a program into memory.
 Executes the program.
 Handles program's execution.
 Provides a mechanism for process synchronization.

Mr. V.N.Kukre Page 2 of 11


Unit II – Services and Components of Operating System

 Provides a mechanism for process communication.


 Provides a mechanism for deadlock handling.
3. File system manipulation:
A file represents a collection of related information. Computers can store files on the disk
(secondary storage), for long-term storage purpose. Examples of storage media include
magnetic tape, magnetic disk and optical disk drives like CD, DVD. Each of these media has
its own properties like speed, capacity, data transfer rate and data access methods.
A file system is normally organized into directories for easy navigation and usage. These
directories may contain files and other directions. Following are the major activities of an
operating system with respect to file management −
 Program needs to read a file or write a file.
 The operating system gives the permission to the program for operation on file.
 Permission varies from read-only, read-write, denied and so on.
 Operating System provides an interface to the user to create/delete files.
 Operating System provides an interface to the user to create/delete directories.
 Operating System provides an interface to create the backup of file system.
4. Input / Output Operations
Each program requires an input and after processing the input submitted by user it produces
output. This involves the use of I/O devices. The operating system hides the user from all these
details of underlying hardware for the I/O. So the operating system makes the users convenient
to run programs by providing I/O functions. The I/O service cannot be provided by user-level
programs and it must be provided by the operating system.
An Operating System manages the communication between user and device drivers.
 I/O operation means read or write operation with any file or any specific I/O device.
 Operating system provides the access to the required I/O device when required.
5. Communication
Operating system performs the communication among various types of processes in the form
of shared memory. In multitasking environment, the processes need to communicate with each
other and to exchange their information.
Following are the major activities of an operating system with respect to communication −
 Two processes often require data to be transferred between them
 Both the processes can be on one computer or on different computers, but are
connected through a computer network.
 Communication may be implemented by two methods, either by Shared Memory or
by Message Passing.
6. Resource Allocation:
In the multitasking environment, when multiple jobs are running at a time, it is the
responsibility of an operating system to allocate the required resources (like as CPU, main
memory, tape drive or secondary storage etc.) to each process for its better utilization. For this
purpose, various types of algorithms are implemented such as process scheduling, CPU
scheduling, disk scheduling etc.
Following are the major activities of an operating system with respect to resource
management −

Mr. V.N.Kukre Page 3 of 11


Unit II – Services and Components of Operating System

 The OS manages all kinds of resources using schedulers.


 CPU scheduling algorithms are used for better utilization of CPU.
7. Error Detection:
Errors may occur within CPU, memory hardware, I/O devices and in the user program. For
each type of error, the OS takes adequate action for ensuring correct and consistent computing.
Operating system also deals with hardware problems. To avoid hardware problems, the
operating system constantly monitors the system for detecting the errors and fixing these errors
(if found). The main function of operating system is to detect the errors like bad sectors on hard
disk, memory overflow and errors related to I/O devices. After detecting the errors, operating
system takes an appropriate action for consistent computing.
8. Accounting:
Operating system keeps an account of all the resources accessed by each process or user. In
multitasking, accounting enhances the system performance with the allocation of resources to
each process ensuring the satisfaction to each process.
9. Security and protection
If a computer system has multiple users and allows the concurrent execution of multiple
processes, then the various processes must be protected from one another's activities.
Protection includes in ensuring all access to system resources in a controlled manner. For
making a system secure, the user needs to authenticate him or her to the system before using
Section 2.2 System calls
Concepts:
The system call provides an interface to the operating system services. The interface between
a process and an operating system is provided by system calls. In general, system calls are
available as assembly language instructions. 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.
When a program in user mode requires access to RAM or a hardware resource, it must ask the
kernel to provide access to that resource. This is done via something called a system call.
When a program makes a system call, the mode is switched from user mode to kernel mode.
This is called a context switch.
Then the kernel provides the resource which the program requested. After that, another context
switch happens which results in change of mode from kernel mode back to user mode.
Generally, system calls are made by the user level programs in the following situations:
 Creating, opening, closing and deleting files in the file system.
 Creating and managing new processes.
 Creating a connection in the network, sending and receiving packets.
 Requesting access to a hardware device, like a mouse or a printer.
A figure representing the execution of the system call is given as follows:

Mr. V.N.Kukre Page 4 of 11


Unit II – Services and Components of Operating System

Services Provided by System Calls :


1. Process creation and management
2. Main memory management
3. File Access, Directory and File system management
4. Device handling(I/O)
5. Protection
6. Networking, etc.
Types of System Calls: There are 5 different categories of system calls –
a. Process control
The process control system call is used to create and manage the processes in the operating
system. Following are the function of the process control system call:
 It creates and terminates the process whenever required.
 It also controls the termination of a running program normally (end) or abnormally
(abort).
 While executing a program the process control system call controls the loading and
execution of another program.
 It determines and resets the attributes of a process as the process switches between the
execution.
 It helps in allocating memory to the process and even frees the memory when the
process terminates.
 It controls the waiting time that is required to finish a process execution.
 The process control calls wait events that will signal the execution completion of a
process.
b. File management
The file management system calls control the file and directory system of the computer.
 This call creates and deletes the files of the system.
 It creates a new file and even controls its deletion.
 This call is required to open and close the file.
 It is also used to perform read and write operations on the file.
 This call is even required to determine and reset the attribute of the file.
c. Device management
The device management system call is required to control and manage the devices attached to
the computer system.

Mr. V.N.Kukre Page 5 of 11


Unit II – Services and Components of Operating System

 This call controls the requests from the process for the several resources (devices) of
the system.
 It controls the read, writes operations on the devices.
 It provides the resources to process for execution and even releases the devices after
completion of the process.
d. Information maintenance
The information maintenance system call maintains the information of the computer such as
system time, date, etc.
 These calls are used to get the system information such as the version of the operation
system, configuration of the system.
 To get the information about all the processes of the operating system.
 To get information about all the files on the system.
 To get information about all the devices attached to the system.
e. Communications
A communication call is required to connect your computer over the network.
 It creates and deletes the communication connection over the network.
 This call is even required to send and receive messages over the network.
 Transfer status information of the connected devices over the network.
 This call is even required to attach or detach the remote devices connected to your
computer over the network.
Examples of Windows and Unix System Calls –
Windows Unix
CreateProcess() fork()
Process Control ExitProcess() exit()
WaitForSingleObject() wait()
CreateFile() open()
ReadFile() read()
File Manipulation
WriteFile() write()
CloseHandle() close()
SetConsoleMode() ioctl()
Device Manipulation ReadConsole() read()
WriteConsole() write()
GetCurrentProcessID() getpid()
Information Maintenance SetTimer() alarm()
Sleep() sleep()
CreatePipe() pipe()
Communication CreateFileMapping() shmget()
MapViewOfFile() mmap()
SetFileSecurity() chmod()
Protection InitlializeSecurityDescriptor() umask()
SetSecurityDescriptorGroup() chown()

Mr. V.N.Kukre Page 6 of 11


Unit II – Services and Components of Operating System

2.3 Operating System Components


From the virtual machine point of view (also resource management)
These components reflect the services made available by the O.S.
1. Process Management
o Process is a program in execution --- numerous processes to choose from in a
multiprogrammed system,
o Process creation/deletion (bookkeeping)
o Process suspension/resumption (scheduling, system vs. user)
o Process synchronization
o Process communication
o Deadlock handling
2. Memory Management
1. Maintain bookkeeping information
2. Map processes to memory locations
3. Allocate/deallocate memory space as requested/required
3. I/O Device Management
0. Disk management functions such as free space management, storage
allocation, fragmentation removal, head scheduling
1. Consistent, convenient software to I/O device interface through
buffering/caching, custom drivers for each device.
4. File System
Built on top of disk management
0. File creation/deletion.
1. Support for hierarchical file systems
2. Update/retrieval operations: read, write, append, seek
3. Mapping of files to secondary storage
5. Protection
Controlling access to the system
0. Resources --- CPU cycles, memory, files, devices
1. Users --- authentication, communication
2. Mechanisms, not policies
6. Network Management
Often built on top of file system
0. TCP/IP, IPX, IPng
1. Connection/Routing strategies
2. ``Circuit'' management --- circuit, message, packet switching
3. Communication mechanism
4. Data/Process migration
7. Network Services (Distributed Computing)
Built on top of networking
0. Email, messaging (GroupWise)
1. FTP
2. gopher, www
3. Distributed file systems --- NFS, AFS, LAN Manager
4. Name service --- DNS, YP, NIS
5. Replication --- gossip, ISIS
6. Security --- kerberos
8. User Interface
0. Character-Oriented shell --- sh, csh, command.com (User replaceable)
1. GUI --- X, Windows 95

Mr. V.N.Kukre Page 7 of 11


Unit II – Services and Components of Operating System

2.4 Use of Operating system tools


1. Users and groups management:
 User management is a system to handle activities related to individuals’ access to
devices, software, and services.
 It focuses on managing permissions for access and actions as well as monitoring usage.
 Functions of user management include:
a. Providing users with authenticated access
b. Supporting set up, reissuing, and decommissioning of users’ access credentials
c. Establishing access privileges based on permissions
d. Creation, deletion of users and group
2. Security policy:
 The operating system is responsible for implementing a security system that ensures
the authenticity of a user who is executing a specific program.
 In general, an OS security policy is a document that specifies the procedures for
ensuring that the operating system maintains a specific level of integrity,
confidentiality, and availability.
 Security policies handle all preventative activities and procedures to ensure an
operating system's protection, including steal, edited, and deleted data.
 In general, operating systems identify and authenticate users in following ways.
a. Permission to group and users,
b. Permission types,
c. Viewing the permission,
d. Modify the permissions,
e. User authentication
3. Device Management:
 Device Management in Operating system manages all the hardware or virtual devices
of a computer or PC.
 The device management system allocates input/output devices to the process on the
basis of priority and deallocated as well either temporarily or permanently depending
upon the conditions.
 The function of device management is to load of Device driver depending on its types
such as block, character or network device, partition of HDD, Checking the disk space
 Also the functions of the device management are given below
a. It keeps track of data, status, location, uses, etc. The file system is a term used to
define a group of facilities.
b. It enforces the pre-determined policies and decides which process receives the
device when and for how long.
c. It improves the performance of specific devices.
d. It monitors the status of every device, including printers, storage drivers, and other
devices.

Mr. V.N.Kukre Page 8 of 11


Unit II – Services and Components of Operating System

e. It allocates and effectively deallocates the device. De-allocating differentiates the


devices at two levels: first, when an I/O command is issued and temporarily freed.
Second, when the job is completed, and the device is permanently release.
4. Performance Monitor:
 It monitors various activities on a computer such as CPU, memory usage or network
performance.
 This type of application may be used to determine the cause of problems on a local or
remote computer by measuring the performance of hardware, software services, and
applications.
 Performance of CPU usage, Memory usage, Swap memory, Cache size, buffer size,
process ID, Users, Command etc. as shown in Fig.2
5. Task Scheduler:
 The Task Scheduler enables you to automatically perform routine tasks on a chosen
computer.
 The Task Scheduler does so by monitoring whatever criteria you choose (referred to as
triggers) and then executing the tasks when those criteria are met.
 For example, you can schedule a task to run a backup script every night, or send you an
e-mail whenever a certain system event occurs.

Example of Windows OS Tools:


 Task Manager: Task Manager is probably the most well-known tool for monitoring
processes on the Windows operating system.

Mr. V.N.Kukre Page 9 of 11


Unit II – Services and Components of Operating System

E-learning material (Video lectures)


1. https://www.youtube.com/watch?v=qt8KfuNTzWs – Concepts of OS
2. https://www.youtube.com/watch?v=qt8KfuNTzWs – Concepts of OS
3. https://www.youtube.com/watch?v=mXUqMtJ0oBw – Components of OS
4. https://www.youtube.com/watch?v=s-tk8el8JoU – Types of Operating System
5. https://www.youtube.com/watch?v=7M0e1ohU1vE – Types of Operating System
Questions Bank:
Q.1. State any four services provide by an operating system.
Q.2. Describe system calls with suitable example.
Q.3. Describe I/O system management in operating system.
Q.4. State any four components of Operating system.
Q.5. Describe process management in operating system.
Q.6. Describe Memory Management in operating system.
Q.7. Describe file management in operating system.
Q.8. List any four types of system calls.
Q.9. State the any four use of operating system tools.
Questions in MSBTE Question Paper
MSBTE Examination Winter 2019
1. Explain any four services provided by OS. (R/2)
2. List components of OS. Explain process management in detail. (U/4)
3. Write unix command for following: (A/4)
(i) Create a folder OSY
(ii) Create a file FIRST in OSY folder
(iii) List / display all files and directories.
(iv) Write command to clear the screen
4. What is purpose of system call? State any two system calls with their functions.
(U/4)
5. Enlist the operating system tools. Explain any two in detail. (U/4)
MSBTE Examination Summer 2022
1. State any four types of system calls. (R/2)
2. List and describe any four services of operating system. (U/4)
3. Describe various activities performed by following operating system components.
(U/4)
i) Main memory management
ii) File management
4. Describe with example, use of following tools: (U/6)
(i) Device Management
(ii) Performance monitor
(iii) Task scheduler

Mr. V.N.Kukre Page 10 of 11


Unit II – Services and Components of Operating System

MSBTE Examination Winter 2022


1. List any four services provided by O.S. (R/2)
2. Describe any two components of O.S. (U/4)
3. Write any four system call related to file management. (U/4)
4. Write two uses of following O.S. tools –(R/6)
(i) Device Management
(ii) Performance monitor
(iii) Task Scheduler
MSBTE Examination Summer 2023
1. State any four services of operating system. (R/2)
2. Explain different types of system calls. (U/4)
3. Explain different components of operating system. (U/4)
4. Write two uses of following O.S. tools –(R/4)
(i) Security Policy
(ii) User Management
(iii) Task Scheduler

Mr. V.N.Kukre Page 11 of 11

You might also like