Chap #1-Introduction To OS
Chap #1-Introduction To OS
Q: – Define user interface. Describe different types of interfaces used by operating system.
Ans: A user interface refers to as the part of operating system. It allows the user to enter and receive
information. Basically it provides the facility to user to interact with computer.
There are two types of user interfaces.
Unit # 1 Introduction to Operating System (2)
i. Process Management
ii. Memory Management
iii. File System Management
iv. Device Management
Process Management:
The most important task of operating system is to manage and monitor different processes
executing in the computer. A program in execution is called process. A process is considered as a unit
of work in a system. Thus the system becomes a collection of processes. Some of these processes are
operating system processes, while the remaining are user processes. The process management
component of the operating system manages all these processes in all respects. A process always needs
some resources for its execution such as CPU time, memory access, and I/O devices etc. The operating
system fulfills these requirements for the process. If multiple processes are executing simultaneously,
the operating system must be capable of providing each process with an appropriate virtual
environment in which it can run.
The operating system also performs the following major activities for process management:-
Memory Management
Computer system's main memory is an area where data and information are kept with unique
address for easy and quick access. Thus the memory unit has very important role in the computer
system. Processor takes data and program instructions from memory, executes them, and stores the
results in the main memory. It is the responsibility of operating system to manage the allocation of
memory to all existing processes.
Therefore, the operating, system performs following major memory management tasks:-
Unit # 1 Introduction to Operating System (4)
o Keep track of which parts of memory are being used by which processes.
o Keep track of which parts of memory are available for allocation.
o Allocate memory space to the newly loaded and other needing processes.
o De-allocate memory space allocated to the program (or process) when it terminated.
o Swap-in and swap-out processes to the memory space, whenever required.
o File operations such as creating, deleting, opening, closing, copying, renaming etc.
o Directory operations such as creating new directory, deleting existing directory, renaming
directory etc.
o File organization such as arrangement of records into files and the ways for accessing these
records.
o File protections to control access to the files etc.
Device Management:
A computer communicates information through its input and output devices. Processes access
those devices through the operating system supervisor calls provided for that purpose. The operating
system attempts to manage those devices in a manner that allows them to be efficiently shared among
the processes requiring them.
1. User Interface:
All operating systems provide a user interface. The user interface can be of different types such
as command-line interface and graphical user interface.
2. Program Execution:
Operating system provides the services to execute programs. It handles many kinds of
activities from user programs to system programs like printer spooler, name servers, file server,
etc.
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.
Following are the major activities of an operating system with respect to file management:
Program needs to read a file or write a file.
The OS gives the permission to the program for operation on file.
Unit # 1 Introduction to Operating System (6)
5. Error Detection:
Operating system provides the facility of error detection and response. It is the ability to detect
errors in CPU, memory hardware, I/O devices or in user programs. Error detection occurs at both
hardware and software levels. At hardware level, all data transfers must be checked to ensure that
data have not been corrupted or changed. At software level, media must be checked for data
consistency.
For example, the number of allocated and unallocated blocks of storage should match the total
number of blocks on the device.
6. Communications:
It is the exchange of information between processes that may be executing on the same
computer or on completely different computers. It is usually implemented via shared memory or
message passing.
7. Resource Allocation:
It is the ability to allocate resources to multiple users or to multiple jobs running at the same
time. When there are multiple users or multiple jobs running at the same time resources must be
allocated to each of them.
There are some major activities that are performed by an operating system:
The OS manages all kinds of resources using schedulers.
CPU scheduling algorithm is used for better utilization of CPU.
8. Protection:
It is an ability to ensure all access to system resources is controlled. The owners of information
stored in a multi-user computer system want to control its use. When several disjoints processes
execute concurrently it should not be possible for any process to interfere with another process.
Every process in the computer system must be secured and controlled.
a. Command Prompt:
A command line operating system provides a command prompt to the user for typing
commands. User interacts with the computer using commands. User has to remember
commands to perform different tasks. It is difficult for user to use as he/she has to
remember the commands. A little mistake in the syntax of command generates an error.
Example of CLI: MS DOS.
Timesharing operating systems allow for interaction between user and process. It supports an
environment that allows programs to respond to user inputs in a reasonable amount of time. The
operating system must not only share resources among the various processes, but it must create the
illusion that processes are running simultaneously. It does this by shifting execution rapidly among all
the active process.
The real-time operating system is designed to support executions of tasks within specific time
limits. The real-time system requires the correct results within specified time period. The correctness
of the processing task's result is totally dependent on completion of the job within the specified time.
For example, a real-time system sensing loss of coolant to a nuclear reactor may be required to
initiate a backup system within a fraction of second. The operating system must guarantee the task can
be executed within a specified time constraint.
Many real-time systems are embedded in specialized devices, such as microwave ovens,
washing machines, digital cameras, cellular telephones.
Ans: Kernel:
A Kernel is a computer program that is the heart and core of an Operating System. Since the
Operating System has control over the system so, the Kernel also has control over everything in the
system. It is the most important part of an Operating System. Whenever a system starts, the Kernel is
the first program that is loaded after the boot loader because the Kernel has to handle the rest of the
thing of the system for the Operating System. The Kernel remains in the memory until the Operating
System is shut-down.
The Kernel is responsible for low-level tasks such as disk management, memory management,
task management, etc. It provides an interface between the user and the hardware components of the
system. When a process makes a request to the Kernel, then it is called System Call.
Functions of a Kernel:
o Access Computer resource
o Resource Management
o Memory Management
o Device Management
Unit # 1 Introduction to Operating System (12)
Interrupt in OS:
Interrupts are signals sent to the CPU by external devices, normally I/O devices. They tell the
CPU to stop its current activities and execute the appropriate part of the operating system.
o User mode
o Kernel/System/Supervisor/Privileged Mode
i. User mode:
When the computer system runs user applications like creating a text document or
using any application program, then the system is in the user mode. When the user application
requests for a service from the operating system or an interrupt occurs or system call, then
there will be a transition from user to kernel mode to fulfill the requests.
To switch from kernel mode to user mode, mode bit should be 1.
Important Questions