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

Osy Ch. 02

This document discusses the services, system calls, and components of an operating system. It outlines several key services provided by operating systems including program execution, I/O operations, file system manipulation, communications, error detection, resource allocation, accounting, protection, and security. It describes how system calls allow programs to access these OS services and examples of common system calls related to processes, files, devices, information maintenance, and communication. Finally, it lists some core components of an operating system including process management, main memory management, file management, I/O system management, and secondary storage management.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views

Osy Ch. 02

This document discusses the services, system calls, and components of an operating system. It outlines several key services provided by operating systems including program execution, I/O operations, file system manipulation, communications, error detection, resource allocation, accounting, protection, and security. It describes how system calls allow programs to access these OS services and examples of common system calls related to processes, files, devices, information maintenance, and communication. Finally, it lists some core components of an operating system including process management, main memory management, file management, I/O system management, and secondary storage management.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 36

Ch-2

• Services and components of Operating System


Marks: 10
Services of Operating System
Services of Operating System
• Program Execution: system capability to load a program into memory
and to run it.
• I/O operations: since user programs cannot execute I/O operations
directly, the operating system must provide some means to perform I/O.
• File-system manipulation: program capability to read, write, create, and
delete files. Maintain details of files or directories with their respective
details.
• Communications: exchange of information between processes executing
either on the same computer or on different systems tied together by a
network. Implemented via shared memory or message passing.
Services of Operating System
• Error Detection: ensure correct computing by detecting errors in the
CPU and memory hardware, in I/O devices, or in user programs.
• Resource Allocation: allocating resources to multiple users or multiple
jobs running at the same time. Coordinating among peripherals.
• Accounting: keep track of and record which users use how much and
what kinds of computer resources for account billing or for
accumulating usage statistics.
• Protection: ensuring that all access to system resources is controlled.
• Security: Providing protection to program, data, and files and to ensure
data security.
System call
• System call is an interface between a running program and operating
system.
• It allows user to access services provided by operating system.
• This system calls are procedures written using C, C++ and assembly
language instructions.
• Each operating system has its own name for each system call.
• Each system call is associated with a number that identifies itself.
Execution of system call
• Each system calls associated with a particular number.
• System call interface maintains a table indexed according to these
numbers.
• The system call interface invokes intended system call in operating
system kernel and returns status of the system call and any return values.
• The caller needs to know nothing about how the system call is
implemented. Just needs to obey API and understand what OS will do as
a result call.
• Most details of operating system interface hidden from programmers by
API. It is managed by run- time support library.
Execution of system call
Execution of system call
• Open ( ) system call for most file systems, a program initializes access
to a file in a file system using the open system call.
• This allocates resources associated to the file (the file descriptor), and
returns a handle that the process will use to refer to that file.
System call provided by an Operating
System
• System calls related to Process Control: End, Abort Load, Execute,
create process, terminate process, Ready
• process, Dispatch process, Suspend, Resume, Get Process attribute,
set attribute, Wait for time, Wait event, signal event.
• System calls Related to File Management: Create file, delete file
Open file, Close file, Create directory Read, Write, Reposition Get file
attribute, set file attribute, Create a link, Change the working
directory.
System call provided by an Operating
System
• System calls Related to Device Management: Request a device,
release a device Read, Write, Reposition, Get device attribute, Set
device attribute
• System calls Related to Information Maintenance: Get Time or Date,
Set Time or Date, Get System data, Set system data, Get process, file
or device attributes, Set Process, file or Device attributes.
• System calls Related to Communication: create, delete
communication connection send, receive messages, transfer status
information, attach or detach remote devices
File related system calls
• System calls Related to File management:
• Create file: This system call is used to create a new file in any application.
• Delete file: This system call is used to delete a specific file from the given
directory.
• Open file: This system call is used to open an existing file.
• Close file: This system call is used to close an already opened file.
• Read file: This system call is used to read a file which is already opened. By
using this system call any information which is desired can be read from the
file.
• Write file: This system call is used to write some data to a file.
File related system calls
• Reposition file: It means to change the position of a file pointer
within the file. If there are many numbers of pages in a file then we
can move forward or backward to any position within that file.
• Get file attribute: A file has certain attributes like file_name,
file_type, file_size, date of creation, modification, access permission
etc. By using this system call we can check any of the attributes of a
particular file.
• Set file attribute: With the help of this system call, any of the
attributes which can be modified or changed can be “SET”.
Types of System Calls
System calls can be grouped roughly into five major categories:
• Process or Job control
• File Management
• Device Management
• Information Maintenance
• Communication
Process and Job Control
• A running program needs to be able to halt its execution either normally
(end) or abnormally (abort).
• If the program discovers an error in its input and wants to terminate
abnormally, it may also want to define an error level.
• A process or job executing one program may want to load and execute
another program.
• This allows the control card interpreter to execute program as directly by the
control cards of the user job.
• If we create a new job or process, we should able to control its execution,We
may also want to terminate a job or process that we created (terminate
process).
Process and Job Control
• Example of Process related system call:
• End, Abort
• Load, Execute
• Create process, Terminate process
• Ready process, Dispatch process
• Suspend process, Resume process
• Get process attributes, Set process attributes
• Wait for Time
• Wait event, Signal event
• Change priority of process
File Management
• We can identify several common system calls dealing with files.
• We first need to be able to create and delete files such a system call
requires the name of the file and perhaps some of its attributes.
• Once the file is created, we need to open it and use it.
• We may also read, write and reposition.
• Finally we need to close the file, indicating that we are no longer
using it.
• Some operating systems provide many more calls, such as calls for file
move and copy.
File Management
• Example of file related system call
• Create file, Delete file
• Open a file, Close a file
• Create directory
• Read, Write, Reposition
• Get file attributes, Set file attributes
• Create a link
• Change working directory
Device Management
• Files can be thought of as abstract or virtual devices.
• Thus many of the system calls for files are also needed for devices.
• If there are multiple users of the system however we must first
request the device to ensure that we have exclusive use of it.
• After we are finished with the device, we must release it.
• These functions are similar to the open/close system calls for files.
• Once, the device has been requested we can read, write and
reposition the device just as with files.
Device Management
• System call related to device management:
• Request device, Release device
• Read, Write, Reposition
• Get device attributes, set device attributes
Information Maintenance
• Many system calls exist simply for the purpose of transferring information
between the user program and the operating system.
• For example, most systems have a system call to return the current time and
date.
• Other system calls may return information about the system such as the
number of current users, the version number of the operating system, the
amount of free memory or disk space and so on.
• In addition the operating system keeps information about all of its jobs and
processes and there are system calls to access this information.
• Generally, there are also calls to reset it. (get process attributes and set
process attributes).
Information Maintenance
• Information Maintenance related system call
• Get Time or Date, Set Time or Date
• Get system Data, Set system Data
• Get process, File or Device attributes
• Set process, File or Device attributes
Communication
• There are two models of inter-process communication, the message-
passing model and the shared memory model.
• Message-passing uses a common mailbox to pass messages
between processes: In the message- passing model, the
communicating processes exchange messages with one another to
transfer information.
Shared memory use certain system calls to create and gain access to
regions of memory owned by other processes. : The two processes
exchange information by reading and writing in the shared data.
Communication
• Communication related system calls:
• Establish a connection
• Send, receive messages
• Terminate a connection
System Components

• Process management
• Main memory management
• File management
• I/O system management
• Secondary storage management
1.Process Management:
• A program is a set of instructions. When CPU is allocated to a
program, it can start its execution. A program in execution is a
process.
• E.g. A word processing program run by a user on a PC is a process.
• The operating system responsible for the following activities in
connection with process management:
• Creation and deletion of user and system processes.
• Suspension and resumption of processes.
• A mechanism for process synchronization.
• A mechanism for process communication.
• A mechanism for deadlock handling.
Main Memory Management
• Main memory is a large array of words or bytes, ranging in size from
hundreds of thousands to billions.
• Main memory is a repository of quickly accessible data shared by the
CPU and I/O devices.
• The central processor reads instructions from main memory during the
instruction fetch cycle and both reads and writes data from main
memory during the data fetch cycle.
• The operating system responsible for the following activities in
connection with main memory s management:
• Keeping track of which parts of memory are currently being used and by whom.
• Deciding which processes (or parts thereof) and data to move into and out of
memory.
• Allocating and deallocating memory space as needed.
File Management
• A file is a collected of related information defined by its creator. Computer can
store files on the disk (secondary storage), which provide long term storage.
• Some examples of storage media are magnetic tape, magnetic disk and optical
disk.
• Each of these media has its own properties like speed, capacity, and data transfer
rate and access methods.
• A file system normally organized into directories to ease their use. These
directories may contain files and other directions.
• The operating system responsible for the following activities in connection with
file management:
• The creation and deletion of files.
• The creation and deletion of directions.
• The support of primitives for manipulating files and directions.
• The mapping of files onto secondary storage.
• The backup of files on stable storage media.
I/O Device Management
• Input / Output device management provides an environment for the
better interaction between system and the I / O devices (such as
printers, scanners, tape drives etc.).
• To interact with I/O devices in an effective manner, the operating
system uses some special programs known as device driver.
• The device drivers take the data that operating system has defined as
a file and then translate them into streams of bits or a series of laser
pulses (in regard with laser printer).
• The I/O subsystem consists of several components:
• A memory management component that includes buffering, caching, spooling
• A general device driver interface
• Drivers for specific hardware devices
Secondary Storage Management
• Secondary storage consists of tapes drives, disk drives, and other media
• The computer system provides secondary storage to back up main memory.
• Secondary storage is required because main memory is too small to
accommodate all data and programs, and the data that it holds is lost when
power is lost.
• Most of the programs including compilers, assemblers, word processors,
editors, and formatters are stored on a disk until loaded into memory.
• The operating system is responsible for the following activities in
connection with disk management:
• Free space management
• Storage allocation
• Disk scheduling.
Operating System Tools
• User Management
• Security Policy
• Device Management
• Performance monitor
• Task Scheduler
User Management
• User management describes the ability for administrators to manage
user access to various IT resources like
systems,devices,applications,storage systems,networks and more
• User management is a core part to any directory service and is a basic
security essential for any organization
• User Management enables admins to control user access and on-
board and off-board users to and from IT resources
• There are 3 types of accounts in UNIX OS:
1.Root:this account belongs to system administrator(Super user)
2.System Accounts:Related to system components(Mail)
3.User Accounts:Belongs to users and group of users.They have
limited access to system files and directories
Security Policy
• This option allows the administrator to provide access or deny access
to some users to some drive or software on those drives.
• Thus the changes in those software or drives will not be possible for
them, whom the access to change or configure is not given by the
administrator.
• E.g.By this end user policy one administrator can allow or disallow any
user on those computers to get an access over few websites or not.
By these the users can also be restricted to surf freely at their work
place as most of the irrelevant website; basically the irrelevant
websites to the job will not be opened from there.
Device Management

• Managing all the hardware or virtual devices of computer system.


• Allow interaction with hardware devices through device driver.
• Used to install device and component-level drivers as well as associated
software.
• Allocate devices to the process as per process requirement and priority.
• Deallocate devices either temporarily or permanently depending on
condition.
• Keeping track of all device’s data and location.
• Monitoring device status like printers, storage drivers and other devices.
• Used to enforce the predetermined policies and decides which process
receives the device when and for how long.
Performance monitor

• Monitor various activities on a computer such as CPU or memory


usage.
• Used to examine how programs running on their computer affect
computer’s performance
• It is used to identify performance problems or bottleneck that affect
operating system or installed applications.
• Used to observe the effect of system configuration changes
Task scheduler

• Assign processor to task ready for execution


• Executing predefined actions automatically whenever a certain set of
condition is met.
• E.g. 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.
From control panel,go to administrative tools to find the task
scheduler
CLI VS GUI

You might also like