Unit-2 Notes
Unit-2 Notes
➢Service ??.
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:
➢ The operating system gives the permission to the program for operation on
file.
➢ 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
➢ OS ensures that external I/O devices are protected from invalid access attempts.
➢ 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()
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: