Sie sind auf Seite 1von 9

Chapter-01 (Operating Systems Fundamentals)

Dr. Sheeraz Arif (Assoc. Professor)


Operating System:
An operating system (OS) is basically a collection of software that manages computer hardware
resources and provides common services for computer programs and user. The basic goal of
computer systems is to execute user programs and to make solving user problems easier.

An operating system is a construct that allows the user application programs to interact with the
system hardware. Operating system by itself does not provide any function but it provides an
atmosphere in which different applications and programs can do useful work.

Example: Just like a boss gives order to his employee, in the similar way we request or pass our
orders to the Operating System.

Important functions of an operating System:


The major operations of the operating system are process management, memory management,
device management and file management. These are given in detail as follows:

1- Process Management

In a multi programming environment, the OS decides the order in which processes have access
to the processor, and how much processing time each process has. This function of OS is
called process scheduling. An Operating System performs the following activities for processor
management.

Keeps tracks of the status of processes. The program which perform this task is known as traffic
controller. Allocates the CPU that is processor to a process. De-allocates processor when a
process is no more required.

When the processes enter the system, they are put into the job queue. The processes that are
ready to execute in the main memory are kept in the ready queue. The processes that are
waiting for the I/O device are kept in the device queue.

2- Memory Management

The operating system manages the Primary Memory or Main Memory. OS keeps tracks of
primary memory, i.e., which bytes of memory are used by which user program. The memory
addresses that have already been allocated and the memory addresses of the memory that has
not yet been used. In multi programming, the OS decides the order in which process are
granted access to memory, and for how long. It Allocates the memory to a process when the
process requests it and deallocates the memory when the process has terminated.

3- Device Management(I/O)
There are many I/O devices handled by the operating system such as mouse, keyboard, disk
drive etc. There are different device drivers that can be connected to the operating system to
handle a specific device. It performs the following activities for device management. Keeps
tracks of all devices connected to system. designates a program responsible for every device
known as the Input/Output controller. Decides which process gets access to a certain device
and for how long. Allocates devices in an effective and efficient way. Deallocates devices when
they are no longer required.

4- File Management

Files are used to provide a uniform view of data storage by the operating system. All the files
are mapped onto physical devices that are usually non-volatile so data is safe in the case of
system failure. It keeps track of where information is stored, user access settings and status of
every file, deletion, creation, updation and access permission of the files and more… These
facilities are collectively known as the file system.

5- User Management

In network environment, there may be many users and computing resources so this is another
type of operation of OS to manage the resources among different users and take care of
permissions and security.

6- Control over system performance

Monitors overall system health to help improve performance. records the response time
between service requests and system response to have a complete view of the system health.
This can help improve performance by providing important information needed to troubleshoot
problems.

Important services of an operating System:


The Operating System provides certain services to the users which can be listed in the following
manner:
1. Program Execution: The Operating System is responsible for execution of all types of
programs whether it be user programs or system programs. The Operating System utilises
various resources available for the efficient running of all types of functionalities. The
system must be able to load a program into memory and to run that program, end
execution, either normally or abnormally (indicating error).
2. Handling Input/Output Operations: The Operating System is responsible for handling
all sort of inputs, i.e, from keyboard, mouse, desktop, etc. The Operating System does all
interfacing in the most appropriate manner regrading all kind of Inputs and Outputs.
For example, there is difference in nature of all types of peripheral devices such as mouse
or keyboard, then Operating System is responsible for handling data between them.
3. Manipulation of File System: The Operating System is responsible for making of
decisions regarding the storage of all types of data or files, i.e, floppy disk/hard disk/pen
drive, etc. The Operating System decides as how should the data should be manipulated
and stored.
4. Error Detection and Handling: The Operating System is responsible for detection of
any types of error or bugs that can occur while any task. The well secured OS sometimes
also acts as countermeasure for preventing any sort of breach to the Computer System
from any external source and probably handling them.
5. Resource Allocation: The Operating System ensures the proper use of all the
resources available by deciding which resource to be used by whom for how much time.
All the decisions are taken by the Operating System.
6. Accounting: The Operating System tracks an account of all the functionalities taking
place in the computer system at a time. All the details such as the types of errors occurred
are recorded by the Operating System.
7. Information and Resource Protection: The Operating System is responsible for using
all the information and resources available on the machine in the most protected way. The
Operating System must foil an attempt from any external resource to hamper any sort of
data or information.
8. User Interface: Provide an ease/friendly environment to the users to easily and
efficiently use the services and interaction.

Types of Operating Systems


1- Batch Operating system 
The users who using a batch operating system do not interact with the computer directly. Each
user prepares its job on an off-line device like punch cards and submits it to the computer
operator. To speed up the processing, jobs with similar needs are batched together and run as
a group. The programmers exit their programs with the operator and the operator then sorts the
programs with similar requirements into batches.
The problems that occurs with Batch Systems are as follows −
 There is a lack of interaction between the user and the job.
 CPU is being often idle, because the speed of the mechanical I/O devices is slower than
the CPU.
 It is difficult to provide the desired priority.
 Debugging is very hard and these systems are very costly.

2- Distributed Operating System 


Multiple central processors are used by Distributed systems to serve multiple real-time
applications and multiple users. Accordingly, Data processing jobs are distributed among the
processors. Various autonomous interconnected computers communicate each other using a
shared communication network.
Processors communicate with each other through various communication lines (like high-speed
buses or telephone lines). These are known as loosely coupled systems or distributed
systems. Processors in this system may vary in size and function. They are referred as sites,
nodes, computers, and so on.
Advantages of Distributed Operating System:

 Failure of one will not affect the other network communication, as all systems are
independent from each other
 Electronic mail increases the data exchange speed
 Since resources are being shared, computation is highly fast and durable
 Load on host computer reduces
 These systems are easily scalable as many systems can be easily added to the network
 Delay in data processing reduces

Disadvantages of Distributed Operating System:

 To establish distributed systems the language which are used are not well defined yet
 These types of systems are not readily available as they are very expensive. Not only
that the underlying software is highly complex and not understood well yet

3- Time-Sharing Operating Systems

Each task is given some time to execute, so that all the tasks work smoothly. Each user gets
time of CPU as they use single system. These systems are also known as Multitasking
Systems. The task can be from single user or from different users also. The time that each task
gets to execute is called quantum. After this time interval is over OS switches over to next task.
Advantages of Time-Sharing OS:
 Each task gets an equal opportunity
 Less chances of duplication of software
 CPU idle time can be reduced

Disadvantages of Time-Sharing OS:


 Reliability problem
 One must have to take care of security and integrity of user programs and data
 Data communication problem.

4- Network Operating System

These systems run on a server and provide the capability to manage data, users, groups,
security, applications, and other networking functions. These type of operating systems allow
shared access of files, printers, security, applications, and other networking functions over a
small private network. One more important aspect of Network Operating Systems is that all the
users are well aware of the underlying configuration, of all other users within the network, their
individual connections etc. and that’s why these computers are popularly known as tightly
coupled systems.
Advantages of Network Operating System:
 Highly stable centralized servers
 Security concerns are handled through servers
 New technologies and hardware up-gradation are easily integrated to the system
 Server access are possible remotely from different locations and types of systems
Disadvantages of Network Operating System:
 Servers are costly
 User has to depend on central location for most operations
 Maintenance and updates are required regularly

Examples of Network Operating System are: Microsoft Windows Server 2003, Microsoft
Windows Server 2008, UNIX, Linux, Mac OS X

5- Real-Time Operating System

These types of OSs serves the real-time systems. The time interval required to process and
respond to inputs is very small. This time interval is called response time.

Real-time systems are used when there are time requirements are very strict like missile
systems, air traffic control systems, robots etc.

Two types of Real-Time Operating System which are as follows:

 Hard Real-Time Systems:


These OSs are meant for the applications where time constraints are very strict and even
the shortest possible delay is not acceptable. These systems are built for saving life like
automatic parachutes or air bags which are required to be readily available in case of any
accident. Virtual memory is almost never found in these systems.
 Soft Real-Time Systems:
These OSs are for applications where for time-constraint is less strict.

Advantages of RTOS:
 Maximum Consumption: Maximum utilization of devices and system,thus more output
from all the resources
 Task Shifting: Time assigned for shifting tasks in these systems are very less. For
example in older systems it takes about 10 micro seconds in shifting one task to another
and in latest systems it takes 3 micro seconds.
 Focus on Application: Focus on running applications and less importance to
applications which are in queue.
 Real time operating system in embedded system: Since size of programs are small,
RTOS can also be used in embedded systems like in transport and others.
 Error Free: These types of systems are error free.
 Memory Allocation: Memory allocation is best managed in these type of systems.

Disadvantages of RTOS:
 Limited Tasks: Very few tasks run at the same time and their concentration is very less
on few applications to avoid errors.
 Use heavy system resources: Sometimes the system resources are not so good and
they are expensive as well.
 Complex Algorithms: The algorithms are very complex and difficult for the designer to
write on.
 Device driver and interrupt signals: It needs specific device drivers and interrupt
signals to response earliest to interrupts.
 Thread Priority: It is not good to set thread priority as these systems are very less
prone to switching tasks.
Examples of Real-Time Operating Systems are: Scientific experiments, medical imaging
systems, industrial control systems, weapon systems, robots, air traffic control systems, etc.

Operating System Definition


1- Interrupts

Interrupt is a signal emitted by hardware or software when a process or an event needs


immediate attention. It may be generated by a hardware device or a software program. When
the CPU is interrupted it stops what it is doing and immediately transfer the execution/attention
to the interrupt location. An interrupt is sent to the processor as an interrupt request, or IRQ.
Each input device has a unique IRQ setting, or priority. This prevents conflicts and ensures
common input devices, such as keyboards and mice, are prioritized.

When the interrupt is occurred CPU transfer its attention to the fixed location which contains the
starting address where the service routine of the address is located. Interrupt transfers control to
the interrupt service routine generally, through the interrupt vector, which contains the
addresses of all the service routines.

2- Bootstrap Program

This is the initial program that runs when system is powered up or rebooted.
 It must know how to load the operating system and start execution that system.
 It stores in the ROM
 It locates and load the OS kernel to main memory.

3- System Call

What is User Mode?


When a computer application is running, it is in the user mode. Some examples are word
application, PowerPoint, reading a PDF file and browsing the internet. These are application
programs so the computer is in user mode. When the process is in user mode and requires any
hardware resource, that request is sent to the kernel. As there is a limited access to hardware in
this mode, it is known as less privileged mode, slave mode or restricted mode.

In user mode, processes get their own address space and cannot access the address space
which belongs to the kernel. So the failure of one process will not affect the operating system. If
there is an interrupt, it only affects that particular process.

What is Kernel Mode?


A kernel is a software program which is used to access hardware components of a computer
system. Kernel works as a middleware software for hardware and application software/user
programs. Kernel mode is generally reserved for low level trusted functions of the operating
system.
Context Switching
When the process is executing in user mode and if that process requires hardware resources
such as RAM, printer etc, that process should send a request to the kernel. These requests are
sent through system calls. Then the computer enters Kernel Mode from user mode. When the
task is completed, the mode changes back to user mode from kernel mode. This transition is
known as “context switching”. Kernel mode is also called as system mode or privileged mode. It is
not possible to run all processes in the kernel mode because if a process fails the entire
operating system might fail.

What is the Difference Between User Mode and Kernel


Mode?
User Mode vs Kernel Mode
User Mode is a restricted mode, which the Kernel Mode is the privileged mode, which the
application programs are executing and starts computer enters when accessing hardware
out. resources.

 Modes

User Mode is considered as the slave mode or Kernel mode is the system mode, master mode or
the restricted mode. the privileged mode.

Address Space

In User mode, a process gets their own In Kernel Mode, processes get single address
address space. space.

 Interruptions

In User Mode, if an interrupt occurs, only one In Kernel Mode, if an interrupt occurs, the whole
process fails. operating system might fail.

Restrictions

In user mode, there are restrictions to access In kernel mode, both user programs and kernel
kernel programs. Cannot access them directly. programs can be accessed.

Das könnte Ihnen auch gefallen