(1)Discuss the various types of process.
ANS --LTS: long term scheduling, STS:short term scheduling, MTS: medium
term scheduling.
There are five states to executive program
-Start/New: this is the initial state when a process is first started or created.
-Ready: ready processes are waiting to have the processor allocated them by the
operating system so that they can run. Process may come into the state after
start state or while running it but interrupted by the scheduler to assign CPU to
some other process.
-Running: once the process has been assigned to a processor by the operating
system scheduler the process state is set to running and the process executes its
instruction.
-Waiting: process moves into the waiting state if it needs to wait for a resource
such as waiting for user input or waiting for a file to become available.
-Terminated/Exit: once the process finishes it's execution then it terminated by
the operating system.
(2)Define system call? State the various categories of system calls.
ANS--System call is a method of a computer program to request a service from
a kernel of the OS on which it is system call is a method of interacting with the
OS via program.-a system call is a request from computer software to an
operating system kernel.- API connects the OS function to user program.. Types
of system calls are-
-Process control: some process control methods are
load,execute,abort,fork,signal,allocate
-File management: file management which manages how to read,write,create
and delete a file.
-Device management: read, write, reposition, IOCTL,FCTL
-Information :getpid() is a method which is used to maintain the process of
different ID, attributes,get system time,data.
-Communication: communication shmget(share to get the memory), create file
mapping,create file, create pipe.
, -Protection: set file security(), initialise security description ().
(3)Define process control block. Briefly explain with a neat labeled diagram.
ANS--Process control block is a data structure maintained by the operating
system for every process. A PCB keeps all the information needed to keep
track of a process as listed below in the table:
-Process state: the current state of process i.e. weather it is
ready,running,waiting or whatever.
-Process privileges: this is required to allow/ disallow access to system
resources.
-Process ID: unique identification for each of the process in the operating
system.
-Pointer: a pointer to parent process
-Program counter: program counter is a pointer to the address of the next
instruction to be executed for this process.
-CPU registers: various CPU registers where process need to be stored for
execution for running state.
-CPU scheduling Information: process priority and others scheduling
information which is required to schedule the process.
-Memory management information: This includes the information of page
table, memory limits, segment table depending on memory used by the
operating system.
-Accounting information: this includes the amount of CPU used for process
execution, time limits, execution ID, etc.
-I/O status information:This includes a list of I/O devices allocated to the
process. The architecture of a PCB is completely dependent on operating system
and make contain different information in different operating system.
(4)Define Fork() and Exec() system call. Explain how a process is created by
using Fork() system call.
ANS
--Fork()system call: it is used for duplicating a process of a creating child from
a parent process with a different process ID.