Technical Point.

The Best Platform of Diploma CSE Students.

Subscribe Us

Breaking

Wednesday, July 29, 2020

Operating System Unit 1.

Operating System                 Unit 1.

INTRODUCTION

Operating System: - An Operating System (OS) is an interface between a computer user and computer hardware. An operating system is a software which performs all the basic tasks like file management, memory management, process management, handling input and output, and controlling peripheral devices such as disk drives and printers.
An Operating System performs all the basic tasks like managing file, process, and memory. Thus operating system acts as manager of all the resources, i.e. resource manager. Thus operating system becomes an interface between user and machine.
                                                                
An Operating System is a software that acts as an intermediate between the hardware and the user. It is a kind of resource manager that manages both hardware and software resources of a system
There can be various resources present in the system and to manage it manually is a very very difficult task. So, we make the use of the Operating System to manage all the resources present in the system.
Some popular Operating Systems include Linux Operating System, Windows Operating System, VMS, OS/400, AIX, z/OS, etc.
                                                           

Goals of the Operating System

There are two types of goals of an Operating System i.e. Primary Goals and Secondary Goal.

  • Primary Goal: Primary goal of operating system is convenience for the user opearting system exist because they are supposed to make it easier to computer with them without them
 The primary goal of an Operating System is to provide a user-friendly and convenient environment. We know that it is not compulsory to use the Operating System, but things become harder when the user has to perform all the process scheduling and converting the user code into machine code is also very difficult. So, we make the use of an Operating System to act as an intermediate between us and the hardware. All you need to do is give commands to the Operating System and the Operating System will do the rest for you. So, the Operating System should be convenient to use.
  • Secondary Goal: other goal of operating system is efficient operating of the computer system
 The secondary goal of an Operating System is efficiency. The Operating System should perform all the management of resources in such a way that the resources are fully utilised and no resource should be held idle if some request to that resource is there at that instant of time.
The purpose of an operating system is  to be provided an environment in which an user can


Types of Operating Systems / Evaluation of Operating Systems :- 
Some types are used in  operating systems are as follows-

1.Mainframe Systems

Mainframe computer system of where the first computers used to tackle many commercial and scientific application It is the system where the first computer used to handle many commercial scientific applications. The growth of mainframe systems traced from simple batch system where the computer runs one and only one application to time shared systems which allowed for user interaction with the computer system
Reduce setup time by batching similar jobs Automatic job sequencing – automatically transfers control from one job to another. First rudimentary operating system. Resident monitor
·        initial control in monitor
·        control transfers to the job
·        when the job completes control transfers  to monitor

2. Batch Operating System –
In batch operating system if after some to process p1 , required some input device operation it leaves the C.P.U and program input request and go for input device at that time C.P.U becomes idle
In this type of system, there is no direct interaction between user and the computer.
·        This type of OS accepts more than one jobs and these jobs are batched/ grouped together according to their similar requirements. This is done by the computer operator. Whenever the computer becomes available, the batched jobs are sent for execution and gradually the output is sent back to the user.
·        It allowed only one program at a time.
This OS is responsible for scheduling the jobs according to priority and the resource required.

This type of operating system does not interact with the computer directly. There is an operator which takes similar jobs having same requirement and group them into batches. It is the responsibility of operator to sort the jobs with similar needs.


Advantages of Batch Operating System:
·        It is very difficult to guess or know the time required by any job to complete. Processors of the batch systems know how long the job would be when it is in queue
·        Multiple users can share the batch systems
·        The idle time for batch system is very less
·        It is easy to manage large work repeatedly in batch systems

Disadvantages of Batch Operating System:
·        Increase C.P.U  idleness
·        Decrease throughput of system
·        The computer operators should be well known with batch systems
·        Batch systems are hard to debug
·        It is sometime costly
Eg – IBM O/S/2

03    Multiprogramming Operating System:

In multiprogramming operating system after same time amount of CPU time it job requires some input operation it will leave the CPU to perform the input operation .At that time CPU is not idle because immediately at that time another job is scheduled into the CPU
This type of OS is used to execute more than one jobs simultaneously by a single processor. it increases CPU utilization by organizing jobs so that the CPU always has one job to execute
Multiprogramming operating systems use the mechanism of job scheduling and CPU scheduling. Multiprogramming concept increases CPU utilization by organization jobs so that the CPU always has one job to execute the idea behind multiprogramming concept. The operating system keeps several jobs in memory simultaneously as shown in below figure
Note :- If the job is leaving the CPU to perform input operation then another job which is ready for execution will be sheduled into CPU.

Advantage :-
·        Increase CPU utillization
·        Increase through put of the system
O/S
J2
J2
J3
J4
max
Memory layout for a multiprogramming system

04   Time-Sharing/multitasking Operating Systems
Multiprogramed  batch system provide on environment where the various system resources where utilized effectively . but it did not provide for user interaction with the computer system . Time sharing / multitasking Os is a logical extension of multiprogramming . The cpu executes multiple jobs by switching among them but the switches occur so frequently that the users can interact that the user can interact with each program while it is running.
A time share operating system allows many users to share the computer simultaneously . since each action or command in a time –shared system tends to be short .only a little CPU time is needed for each user .
The time sharing system is also known as multi user systems. The CPU executes multiple jobs by switching among them but the switches occurs so frequently that the user can interact with each program while it is running. An interactive computer system provides direct communication between a user and system Time-sharing (or multitasking) OS is a logical extension of multiprogramming. It provides extra facilities such as:
·        Faster switching between multiple jobs to make processing faster.
·        Allows multiple users to share computer system simultaneously.
·        The users can interact with each job while it is running.
The disadvantages of time sharing system are:
• It is more complex than multiprogrammed operating system
• The system must have memory management & protection, since several jobs are kept
in memory at the same time.
• Time sharing system must also provide a file system, so disk management is required.
• It provides mechanism for concurrent execution which requires complex CPU
scheduling schemes.  

05 Multiprocessor system :-
Most system to data are sinngle –processor system that is they have only one main CPU How ever multiprocessor system (also known as parallel system or tightly coupled system ) are growing in importance Ex: UNIX, LINUX. Multiprocessor Systems have 3 main

Advantages
a. Increased throughput: No. of processes computed per unit time. By increasing the no. of processors move work can be done in less time. The speed up ratio with N processors is not N, but it is less than N. Because a certain amount of overhead is incurred in keeping all  the parts working correctly.

b. Increased Reliability: If functions can be properly distributed among several processors, then the failure of one processor will not halt the system, but slow it down. This ability to continue to operate in spite of failure makes the system fault tolerant.


c. Economic scale: Multiprocessor system can save more many then multiple single processor system because they can share peripherals mass storage and power supply   .Multiprocessor systems can save money as they can share peripherals, storage & power sup
·       

06 Real-TimeOperating Systems (RTOS) :- 


·           A real-time operating system (RTOS) is a multitasking operating system intended for applications with fixed deadlines (real-time computing). Such applications include some small embedded systems, automobile engine controllers, industrial robots, spacecraft, industrial control, and some large-scale computing systems.
·        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.
·        Real time system is used when there are rigid time requirements on the operation of a processor or flow of data. Sensors bring data to the computers. The computer analyzes data and adjusts controls to modify the sensors inputs. System that controls scientific experiments, medical imaging systems and some display systems are real time systems. The disadvantages of real time system are

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

·        Hard Real-Time Systems:

hard real-time system guarantees that critical tasks be completed on time. This goal requires that all delays in the system be bounded, from the retrieval of stored data to the time that it takes the operating system to finish any request made of it. Such time constraints dictate the facilities that are available in 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:

soft real-time system is a less restrictive type of real-time system. Here, a critical real-time task gets priority over other tasks and retains that priority until it completes. The soft real-time system can be mixed with other types of systems. Due to less restriction, they are risky to use for industrial control and robotics.
These OSs are for applications where for time-constraint is less strict
These have more limited utility than hard real time systems. Missing an occasional deadline is acceptable
                                             
Basic Functions of Operation System:
The various functions of operating system are as follows:

1. Process Management:

• A program does nothing unless their instructions are executed by a CPU.A process is a program in execution. A time shared user program such as a complier is a process. A word processing program being run by an individual user on a pc is a process. 
• A system task such as sending output to a printer is also a process. A process needs certain resources including CPU time, memory files & I/O devices to accomplish its task.
•  These resources are either given to the process when it is created or allocated to it while it is running. The OS is responsible for the following activities of process management.
• Creating & deleting both user & system processes.
• Suspending & resuming processes.
• Providing mechanism for process synchronization.
• Providing mechanism for process communication.
• Providing mechanism for deadlock handling.

2. Main Memory Management: 

The main memory is central to the operation of a modern computer system. Main memory is a large array of words or bytes ranging in size from hundreds of thousand to billions. Main memory stores the quickly accessible data shared by the CPU & I/O device. The central processor reads instruction from main memory during instruction fetch cycle & it both reads &writes data from main memory during the data fetch cycle. The main memory is generally the only large storage device that the CPU is able to address & access directly.
Memory management module performs the task of allocation and de-allocation of memory space to programs in need of this resources.

3.File Management:

File management is one of the most important components of an OS computer can store information on several different types of physical media magnetic tape, magnetic disk & optical disk are the most common media. Each medium is controlled by a device such as disk drive or tape drive those has unique characteristics. These characteristics include access speed, capacity, data transfer rate & access method (sequential or random).For convenient use of computer system the OS provides a uniform logical view of information storage. The OS abstracts from the physical properties of its storage devices to define a logical storage unit the file. A file is collection of related information defined by its creator. The OS is responsible for the following activities of file management.
• Creating & deleting files.
• Creating & deleting directories.
• Supporting primitives for manipulating files & directories.
• Mapping files into secondary storage.
• Backing up files on non-volatile media.

4. I/O System Management:

One of the purposes of an OS is to hide the peculiarities of specific hardware devices from the user. For example, in UNIX the peculiarities of I/O devices are hidden from the bulk of the OS itself by the I/O subsystem. The I/O subsystem consists of:
• A memory management component that includes buffering, catching & spooling.
• A general device- driver interfaces drivers for specific hardware devices. Only the device driver knows the peculiarities of the specific device to which it is assigned.

5. Secondary Storage Management:

The main purpose of computer system is to execute programs. These programs with the data they access must be in main memory during execution. As the main memory is too small to accommodate all data & programs & because the data that it holds are lost when power is lost. The computer system must provide secondary storage to back-up main memory. Most modern computer systems are disks as the storage medium to store data & program. The operating system is responsible for the following activities of disk management.
• Free space management.
• Storage allocation.
• Disk scheduling Because secondary storage is used frequently it must be used efficiently.

6.  Networking:

A distributed system is a collection of processors that don’t share memory peripheral devices or a clock. Each processor has its own local memory & clock and the processor communicate with one another through various communication lines such as high speed buses or networks. The processors in the system are connected through communication networks which are configured in a number of different ways. The communication network design must consider message routing & connection strategies are the problems of connection & security.

7. Protection or security:

If a computer system has multi users & allow the concurrent execution of multiple processes then the various processes must be protected from one another’s activities. For that purpose, mechanisms ensure that files, memory segments, CPU & other resources can be operated on by only those processes that have gained proper authorization from the OS.
8. Command interpretation: One of the most important functions of the OS is connected interpretation where it acts as the interface between the user & the OS. System Calls: System calls provide the interface between a process & the OS. These are usually available in the form of assembly language instruction. Some systems allow system calls to be made directly from a high level language program like C, BCPL and PERL etc. systems calls occur in different ways depending on the computer in use. System calls can be roughly grouped into 5 major categories.

8.   Job accounting: Keeping track of time & resource used by various job and users.

9.     Communication management: Coordination and assignment of compilers, interpreters, and another software resource of the various users of the computer systems
                       



·       views of the Operating Systems 
The Operating system control and coordinates the user of the hardware among the various application program for the various user . Operating System can be explored from two view point the user and the system     


User View

The user view computer various by  the interface being used most computer users sit in front of the PC consisting of a monitor keyboard mouse and system unit . Such system is designed for one user to monopolize . Its resources maximize the work that the user is performing .

User view:The user view of the computer varies by the interface being used. The examples are -windows XP, vista, windows 7 etc.

The user view of computer depends on the interface which is user friendly. Every computer that is to be operated by an individual requires a user interface

 Some computers have little or no user view. For example, embedded computers in home devices and automobiles may have numeric, keypads but they and their operating systems are designed primarily to run without user intervention.

If the user is using a personal computer, the operating system is largely designed to make the interaction easy. Some attention is also paid to the performance of the system, but there is no need for the operating system to worry about resource utilization. This is because the personal computer uses all the resources available and there is no sharing.

System View

From the computer point of view the operating system is the program that is most intimate with the hardware . We can view on operating System as a resource allocator . A computer system has many resource – h/w and software that may be required to solve a problem . CPU time memory space file storage space input device and soon . The operating system acts as the manager  of these resource .

Another view of the operating system is it is a control program. A control program manages the execution of user programs to present the errors in proper use of the computer. It is especially concerned of the user the operation and controls the I/O devices.

The operating system can also work as a control program. It manages all the processes and I/O devices so that the computer system works smoothly and there are no errors. It makes sure that the I/O devices work in a proper manner without creating problems.

The operating system allocates resources among running programs. It controls the sharing of resources within multiple programs.
                          

No comments:

Post a Comment

Recently

All C program

Write a C program to print ‘Hello World’ on screen . #include < stdio.h > #include < conio.h > void  m...