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

Unit-2 Notes

Uploaded by

info.swiftgroww
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Unit-2 Notes

Uploaded by

info.swiftgroww
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 44

CO_22516_Operating System

Mrs. P.S.Gaidhani, Lecturer, Guru Gobind Singh Polytechnic, Nashik.


Unit No: 02
Services & Components of Operating System
CO: Use Operating system tools to perform various functions
Total Marks:10
➢.
Q1. Define Services provided by OS

➢Service ??.

Environment for the


execution of the program
Different Services of Operating System:
Operating System Services:
1. Program Execution:
➢ OS provide facility to user to create program then it loads in memory and
finally get executed.
➢ After successful execution, program get terminated successfully (Normal
Execution)
➢ After unsuccessful execution , program terminated abnormally by indicating
errors (Abnormal Execution)

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.
➢ Provides a mechanism for process communication.
➢ Provides a mechanism for deadlock handling.
2. I/O operation:

➢ It provide facility to perform input/output operation with hardware or


different process.

➢ OS manages the communication between user and device drivers


➢ e. g read or write data on I/O device.
3. File Manipulation:
➢ 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/directories.

➢ Operating System provides an interface to create the backup of file system


4. Error Detection:
➢ OS needs to detect and correct the errors constantly

➢ Errors may occur in


➢ CPU
➢ Memory
➢ I/O devices &
➢ In user programs.

➢ For each type of error, OS must take corrective step to recover from that.
5. Communication:
➢ One process needs to exchange information with another process

➢ Exchange of information can be placed on the same computer or on


different systems tried together by a network.

➢ Communication Implemented via


• Shared memory : in which two or more processes read and write to a shared
section of memory
• Message passing: which packets of information in predefined formats are moved
between processes by the operating system.
6. Protection:
➢ Protection refers to mechanism or a way to control the access of programs,
processes, or users to the resources defined by a computer systems.

➢ OS ensures that external I/O devices are protected from invalid access attempts.

➢ OS provides authentication feature for each user by means of a password.


7. Resource Allocation:
➢ Allocating resources to multiple users or multiple jobs running at the same
time.

➢ Resource may be hardware – CPU, Memory, I/O Device or software-


Programs.

➢ It must handle situation in such manner that all user get resources
whenever they demand
8. Accounting:
➢ Keep track of which users use how much and what kinds of
computer resources
➢ This record keeping used for accounting
➢ It can be use to detect error or to add some resources or for
protection purpose.
Q2. Define User Interface of OS
CLI: Command
Line Interface

Batch Interface

GUI: Graphical
User Interface

CLI: which uses text commands and a method for entering them
Batch Interface: commands are entered into files, and those files are
executed.
graphical user interface (GUI) is used. Here, the interface is a window system with a
pointing device to direct I/O, choose from menus, and make selections and a
keyboard to enter text.
Q.3 Define System Call and Explain with diagram
➢ A system call is a way for a user program to interface with the operating
system.
➢ mechanism that provides the interface between a process and the operating
system.
➢ A system call can be written in assembly language or a high-level language like
C or Pascal.
➢ The Application Program Interface (API) connects the operating system's
functions to user programs.
1.Process Execute normally in the user mode until the system call interrupt
2.Gets System Call :->User Process will wait and Change the mode from user to
kernel for execution
3.Executes System call and
4.Control returns to the user mode
5.Execution of user process will be resumed
System calls are required in the following situations −
•If a file system requires:- the creation or deletion of files, reading and
writing from files
•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.
Q4.List & Explain types of System Calls:
1. Process Control: Used to direct processes
➢ End
➢ Load
Types of
➢ Execute Windows Linux
System Calls
➢ Create
CreateProcess() fork()
➢ Terminate ExitProcess() exit()
Process Control
➢ Suspend WaitForSingleObject() wait()

➢ Resume
➢ Get and Set process attributes: id, state, priority
➢ Wait for time, Event
➢ Change the priority of process
2. File Management: used to handle the files
➢ Create File
➢ Delete File Types of System
Windows Linux
Calls
➢ Open File CreateFile()
open()
ReadFile()
➢ Close read()
File Management WriteFile()
write()
➢ Read CloseHandle()
close()

➢ Write
➢ Get File Attributes
➢ Set File Attributes
3. Device Management: use to deal with the devices
➢ Request device Types of System
Windows Linux
➢ Release device Calls
SetConsoleMode()
➢ Read ioctl()
Device ReadConsole()
read()
➢ Write Management WriteConsole()
write()
➢ Reposition
➢ Get and Set device attributes: id, name, type, speed
4. Information Management: To maintain the information

Types of System
Windows Linux
➢ Get Time Calls
GetCurrentProcessID()
➢ Set Time getpid()
Information SetTimer()
alarm()
➢ Get system data Maintenance Sleep()
sleep()
➢ Set system data
➢ Get and Set Process, File or Device attributes
5. Communication:
Types of System
➢ Create connection Windows Linux
Calls
➢ Delete connection CreatePipe()
pipe()
➢ Send message CreateFileMapping()
Communication shmget()
MapViewOfFile()
➢ Receive message mmap()

➢ Transfer status information


➢ Logically attach and detach remote device
Q.5 List & Explain OS Components:
1. Process Management:
➢ Process: A program is in execution is a process
➢ Ex. A word-processing program being run by an individual user on a PC is a
process or
A system task, such as sending output to a printer, can also be a process
➢ Single Threaded & Multi Threaded

➢ Process Mgt Purpose: manages many processes running simultaneously on


the operating system.
➢ Every running software application program has one or more processes
associated with them. Here are the following functions of process
management in the operating system, such as:
➢ Process creation and deletion.
➢ Suspension and resumption.
➢ Synchronization process
➢ Communication process
Reference Book Used: Abraham Silberschatz-Operating System Concepts -9th Edition-Page No:24 & 25
1. Process Management:

Here are the following functions of process management in the operating


system, such as:

➢ Process creation and deletion.


➢ Scheduling Processes
➢ Thread Management(Single/Multithreaded)
➢ Suspension and resumption.
➢ Synchronization process
➢ Communication process
2. File Management:

➢ A file is a set of related information defined by its creator.


➢ It commonly represents programs (both source and object forms) and data.
➢ Data files can be alphabetic, numeric, or alphanumeric.
➢ Files are normally organized into directories to make them easier to use.
➢ When multiple users have access to files, it may be desirable to control which
user may access a file and how that user may access it (for example, read,
write, execute,append).

The operating system has the following important activities in connection


with file management:
➢ Creating & deleting files
➢ Creating and deleting directories to organize files
➢ Mapping files onto secondary storage
➢ Backing up files on stable (nonvolatile) storage media.
Reference Book Used: Abraham Silberschatz-Operating System Concepts -9th Edition-Page No:26 & 27
3. Network Management:

➢ Network management is the process of managing computer networks.


➢ Organizing and managing the Active and Passive Network Elements
➢ Network management is the process of keeping your network healthy for
an efficient communication between different computers.
➢ Services provided like
➢ Network Fault analysis
➢ Network Configuration
➢ Network Troubleshooting
➢ Network Performance Management
➢ Maintain Quality of Service
4. Maim Memory Management:
➢ Memory is a large array of words or bytes, each with its own address.
➢ The CPU reads instructions from main memory (MM) during the instruction-
fetch cycle and both reads and writes data from MM during the data-fetch cycle

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.
➢ In a multiprogramming system, the OS decides which process will get
memory and how much.
➢ Allocates the memory when a process requests.
➢ It also de-allocates the memory when a process no longer requires or has been
terminated.
Reference Book Used: Abraham Silberschatz-Operating System Concepts -9th Edition-Page No:25 & 26
5. Secondary Storage Management:
➢ The most important task of a computer system is to execute programs.
➢ These programs help you to access the data from the main memory during
execution.
➢ This memory of the computer is very small to store all data and programs
permanently.
➢ The computer system offers secondary storage to back up the main memory.

Here are some major functions of secondary storage management in the


operating system:
➢ Storage allocation
➢ Free space management
➢ Disk scheduling
6. I/O Device Management:
➢ The role of the operating system in computer I/O is to manage and control
I/O operations and I/Odevices.
➢ One of the important use of an operating system that helps to hide the
variations of specific hardware devices from the user.

The I/O management system offers the following functions, such as:
➢ Hide the details of H/W devices
➢ It provides general device driver code
➢ Manage main memory for the devices using cache, buffer,
➢ It provides drivers for particular hardware devices.
7. Security Management:
➢ The various processes in an operating system need to be secured from other
activities.
➢ Security Management refers to a mechanism for controlling the access of
programs,
➢ Therefore, various mechanisms can ensure those processes that want to operate
files, memory CPU, and other hardware resources should have proper
authorization from the operating system.
8.Command Interpreter System
➢ It is an interface of the operating system with the user
➢ The user gives commands with are executed by operating system
➢ The main function of a command interpreter is to get and execute the
➢ If we want to change the way the command interpreter looks, i.e., I want to change the
interface of command interpreter, I am able to do that if the command interpreter is
separate from the kernel. I cannot change the code of the kernel so I cannot modify the
interface user specified command
Q. List & Explain of Operating System tools:
➢ Operating system is the mode in the computer that turns the machine to a user
enabled service.

1. Device management
2. Users management
3. Security policy
4. Performance monitor
5. Task scheduler
6. System configuration
1. Device Management:
➢ Device management is the process of managing the implementation,
operation and maintenance of a physical and/or virtual device.
➢ When an external hardware is connected to the computer, then the device will
be shown at the Device manager tray or administrative window.
➢ The hardware may be of various types, like the printers, the USB ported devices
like pen drive, a Tablet or a mobile, a Mouse and a Keyboard or even a camera.
➢ All Linux device files are located in the /dev directory, which is an integral part
of the root (/) filesystem because these device files must be available to the
operating system during the boot process.
➢ Example: ls –l /dev above example gives the list of device file from kernel..
2. User Management:

➢ User management includes everything from creating a user to


deleting a user on your system
➢ Command line tools include commands like useradd,
userdel,usermod, passwd, etc
➢ Useadd: With useradd commands you can add a user
➢ Userdel: To delete a user account userdel command is used.
➢ Usermod: The command usermod is used to modify the
properties of an existing user.
➢ Passwd: A user can set the password with the command passwd.
3. Security Policy:
➢ This is a feature for large corporate and is in the ultimate version of the
Windows Operating System.
➢ This feature will not be seen in the home computers.
➢ One can find the local security under the Administrative tools, which one may
get access from the control panel.
➢ This option allows the administrator to provide access or deny access to some
users to some drive or software on those drives.
4. Performance Monitor:
➢ Monitor various activities on a computer such as CPU or memory usage.
➢ It is very tough job for every system or network administrator to monitor and
debug System Performance problems every day
➢ One can press Ctrl, Alt and Del at the same time, to find the option of Start
Task Manager->Performance
5. Task Scheduler:
➢ Windows can perform a task at a scheduled time and scheduled date.
➢ Not only one time does it work, but windows can do a particular task
scheduled every day at a particular time or at particular interval.
➢ One can find the task scheduler by going to the tools.

➢ From tools, one has to go to the control panel.


➢ From control panel, he or she has to go to administrative tools to find
the task scheduler.
6. System Configuration:
➢ One may find the system configuration by going through the control panel from
the tools.
➢ Or else can go to the windows from C drive and by double clicking windows
from there.
➢ In the windows folder one may find the System 32 file and within there the
'Config' folder.
➢ One may also directly go there by writing on run window just the word config
and pressing the enter switch once.
Important Questions
Unit No:02 Services & Components of operating System
Q.N Question
1 List any four services provided by operating system.
2 Define system call. 2 Marks
3 Explain open() system call and close() system call.
4 Enlist any four system call.
5 Draw the diagram of monolithic structure of operating system.

Unit No:02 Services & Components of operating System


Q.N Question
1 List and Explain components of operating system.
2 Explain any four file related system call.
4 Marks
3 Explain any four system call.
4 Explain any four Operating System Tools.

Unit No:02 Services & Components of operating System


Q.N Question
1
Explain any four services provided by operating system. Draw diagram showing 6 Marks
services.
Assignment No:02

Unit No:02 Services & Components of operating System


Q1. 2Marks*05=10 M
Q.N Question
1 List any four services provided by operating system.
2 Define system call.
3 Explain open() system call and close() system call.
4 Enlist any four system call.
5 Draw the diagram of monolithic structure of operating system.
Q2. 05*04M=20M
Q.N Question
1 List and Explain components of operating system.
2 Explain any four file related system call.
3 Explain any four system call.
4 Explain any four Operating System Tools.
5 List & Explain Services provided by OS

You might also like