Professional Documents
Culture Documents
Class:CO5I
Prof. Shilpa Budhavale
Department of Computer Engineering
School of Polytechnic & Skill Development
Unit II:Services and Components of
Operating System
[ Marks-10]
Course Outcome
CO 2: Use operating system tools to perform various functions.
Unit Outcomes
a. Start, stop services in Linux
b. Use system calls
c. Understand process of OS in managing given recourses
Points to be Covered
▪Services of operating system
▪System call
▪OS components
A View of Operating System Services
Operating System Services
Operating systems provide an environment for execution of programs and services
to programs and users
One set of operating-system services provides functions that are helpful to the
user:
◦User interface - Almost all operating systems have a user interface (UI).
◦Varies between Command-Line (CLI), Graphics User Interface (GUI), Batch
◦Program execution - The system must be able to load a program into memory
and to run that program, end execution, either normally or abnormally
(indicating error)
◦I/O operations - A running program may require I/O, which may involve a file or
an I/O device
◦File-system manipulation - The file system is of particular interest. Programs
need to read and write files and directories, create and delete them, search
them, list file Information, permission management.
Operating System Services (Cont.)
Mostly accessed by programs via a high-level Application Program Interface (API) rather than
direct system call use
Example of System Calls
System call sequence to copy the contents of one file to another file
System Call Implementation
Typically, a number associated with each system call
◦ System-call interface maintains a table indexed according to these numbers
The system call interface invokes intended system call in OS kernel and returns status of the
system call and any return values
The caller need 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 OS interface hidden from programmer by API
◦ Managed by run-time support library (set of functions built into libraries included with
compiler)
API – System Call – OS Relationship
Types of System Calls
Process control
◦ end, abort
◦ load, execute
◦ create process, terminate process
◦ get process attributes, set process attributes
◦ wait for time
◦ wait event, signal event
◦ allocate and free memory
File management
◦ create file, delete file
◦ open, close file
◦ read, write, reposition
◦ get and set file attributes
Types of System Calls (Cont.)
Device management
◦ request device, release device
◦ read, write, reposition
◦ get device attributes, set device attributes
◦ logically attach or detach devices
Information maintenance
◦ get time or date, set time or date
◦ get system data, set system data
◦ get and set process, file, or device attributes
Communications
◦ create, delete communication connection
◦ send, receive messages
◦ transfer status information
◦ attach and detach remote devices
Examples of Windows and
Unix System Calls
Component activities
1. Process management
2. Memory management
3. Secondary storage management
4. File management
5. I/O system
6. Networking
Process Management
A process is a program in execution. It is a unit of work within the system. Program is a passive
entity, process is an active entity.
Process needs resources to accomplish its task
◦ CPU, memory, I/O, files
◦ Initialization data
Process termination requires reclaim of any reusable resources
Single-threaded process has one program counter specifying location of next instruction to
execute
◦ Process executes instructions sequentially, one at a time, until completion
Typically system has many processes, some user, some operating system running concurrently
on one or more CPUs
◦ Concurrency by multiplexing the CPUs among the processes / threads
Process Management
• User process Single Threaded
• System process Multi threaded
• The OS is responsible for the following activities in connection with processes managed.
• The creation and deletion of both user and system processes
• The suspension are resumption of processes.
• The provision of mechanisms for process synchronization
• Process communication
• The provision of mechanisms for deadlock handling
Main Memory Management
• Memory is central to the operation of a modern computer system.
• Memory is a large array of words or bytes, each with its own address. I
• interaction is achieved through a sequence of reads or writes of specific memory address. The CPU fetches from and stores in
memory.
• In order for a program to be executed it must be mapped to absolute addresses and loaded in to memory.
• In order to improve both the utilization of CPU and the speed of the computer's response to its users, several processes must
be kept in memory.
• The operating system is responsible for the following activities in connection with memory management.
• Keep track of which parts of memory are currently being used and by whom.
• Decide which processes are to be loaded into memory when memory space becomes available.
• Most modem computer systems use disks as the primary on-line storage of information, of
both programs and data.
• The operating system is responsible for the following activities in connection with disk
management
• Storage allocation
File Management
•Computers can store information in several different physical forms; magnetic tape, disk, and drum
are the most common forms. Each of these devices has it own characteristics and physical
organization.
• Files are mapped, by the operating system, onto physical devices.
• In general a files is a sequence of bits, bytes, lines or records whose meaning is defined by its
creator and user.
• A file is a collection of related information defined by its creator. Commonly, files represent
The operating system is responsible for the following activities in connection with file management:
• For example, in Unix, the peculiarities of I/O devices are hidden from the bulk of the operating
system itself by the I/O system.
User management,
Security policy,
Device management
Performance monitor,
Task scheduler
THANK YOU