Osy Chapter-2
Osy Chapter-2
Osy Chapter-2
Unit -II
Services and components of operating system: (Marks 10)
2.1 Different services of Operating System.
2.2 System Calls-Concept,types of system calls
2.3 OS components:- Process Management,Main Memory Management,File
Management,I/O syste, Management, Secondary Storage Management.
2.4 Use of operating system tools:- user management,security policy,device
management,performance monitor,task schedular
1. Program execution
2. I/O Operation
● The executing program may require some input and produces some output.
● The input may be either from a file on the disk or from some other input device.
● The output may be written to some file on disk or sent to some output device.
● The operating system makes these files and I/O device available to the user.
4. Communication
5. Error Detection
The malfunctioning of the system may be due to the errors occured in CPU, I/O
devices or in the memory hardware. Following are the major activities of an
operating system with respect to error handling -
● OS constantly remains aware of possible errors.
● OS takes the appropriate action to ensure correct and consistent computing.
6. Resource Management
8. Accounting:
➢ Once a system call occurs, the processor is switched from the user mode to
kernel(privileged) execution mode.
➢ key parts of the current process, like the program counter and the stack pointer,
are saved.
➢ The current program execution flow is changed so that the program counter is
set to a fixed (determined by the hardware) memory address, which is within the
kernel’s address space. The stack pointer is pointed at a stack in the kernel’s address
space.
➢ The kernel’s handler determines which service the calling process wanted, and
3. Device Management :
The system calls are also used for accessing devices. Many of the system calls used
for files are also used for devices.
In multi user environment the request is made to use the device. After using the
device, it must be released. Using release system call the device is freed to be used
by another user. These functions are similar to open & close system calls of files.
● request device, release device
● read, write, reposition
● get/set device attributes
● logically attach or detach devices
4. Information Maintenance :
Many system calls exist only for the purpose of transferring information between
the user program and the operating system.
For example the information like, current date and time, number of current users,
version number of OS, the amount of free memory or disk space etc.
System calls related to information maintenance are:
● get/set time or date
● get/set system data
● get/set process, file, or device attributes
5. Communication:
Processes need to exchange information with each other. Various system calls are
used during this information exchange.
● create, delete communication connection
● send, receive messages
● transfer status information
● attach or detach remote devices
The operating system is responsible for the following activities in connection with
process management.
a) Process creation :
It involves loading the program from secondary storage to main memory.
b) Process deletion:
When the process has successfully finished its execution or when the process is
terminated forcibly by OS.
c) Process scheduling or dispatching:
Transferring a process from ready state to run state.
d) Process synchronization:
It provides the mechanism for process synchronization for sharing resources
amongst concurrent processes.
e) Process communication:
It provides the mechanism for inter-process communication amongst concurrent
processes.
f) Deadlock handling:
It provides the mechanism for deadlock handling.
g) Process suspension:
Transferring a process from run state to wait state.
h) Process resumption:
Transferring a process from wait state to ready state.
2. Main-Memory Management
● For execution of a program it must be loaded into memory and when a program
terminates, the memory space occupied by this program should be freed.
● The operating system is responsible for the following activities in connections
with memory management.
a) Keep track of which segment of memory is currently being used and by whom.
b) Decide which processes to load when memory space becomes available.
c) Allocate and deallocate memory space as needed.
d) Swapping in and out of processes.
3. File Management
5. Secondary-Storage Management
● The main purpose of OS is to execute programs.
● Instructions and data must be placed in primary storage or cache.
● But the main memory is too small to accommodate all data and programs, and its
data are lost when power is lost.
● The computer system must provide secondary storage to back up main memory.
● Secondary storage consists of tapes, disks, and other media designed to hold
information that will eventually be accessed in primary storage.
The three major activities of an operating system related to secondary storage
management are:
a) Managing the free space available on the secondary-storage device.
b) Allocation of storage space when new files have to be written.
c) Scheduling the requests for memory access.