Author

Author- Ram Ranjeet Kumar
Showing posts with label Operating System. Show all posts
Showing posts with label Operating System. Show all posts

Friday, December 20, 2019

Lecture-03 Types Of Operating System


Types Of Operating System



  1.       Batch OS
  2.       Time Sharing OS
  3.        Distributed OS
  4.       Network OS
  5.       Real Time OS
  6.       Multiprogramming OS
  7.      Multiprocessor OS

1. Batch OS
            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:

·         The computer operators should be well known with batch systems
·         Batch systems are hard to debug
·         It is sometime costly
·         The other jobs will have to wait for an unknown time if any job fails

Examples of Batch based Operating System: Payroll System, Bank Statements etc.


2. Time Sharing OS
            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.


3. Distributed OS
            These types of operating system is a recent advancement in the world of computer technology and are being widely accepted all-over the world and, that too, with a great pace. Various autonomous interconnected computers communicate each other using a shared communication network. Independent systems possess their own memory unit and CPU. These are referred as loosely coupled systems or distributed systems. These system’s processors differ in size and function. The major benefit of working with these types of operating system is that it is always possible that one user can access the files or software which are not actually present on his system but on some other system connected within this network i.e., remote access is enabled within the devices connected in that network.

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:
·         Failure of the main network will stop the entire communication
·         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
Examples of Distributed Operating System are- LOCUS etc.


4. Network OS
            A network operating system (NOS) is a computer operating system (OS) that is designed primarily to support workstations, personal computers and, in some instances, older terminals that are connected on a local area network (LAN). The software behind a NOS allows multiple devices within a network to communicate and share resources with each other.

The composition of hardware that typically uses a NOS includes a number of personal computers, a printer, a server and file server with a local network that connects them together. The role of the NOS is to then provide basic network services and features that support multiple input requests simultaneously in a multiuser environment.

Due to earlier versions of basic operating systems not being designed for network use, network operating systems emerged as a solution for single-user computers.



Types of network operating systems
There are two basic types of network operating systems, the peer-to-peer NOS and the client/server NOS:

Peer-to-peer network operating systems allow users to share network resources saved in a common, accessible network location. In this architecture, all devices are treated equally in terms of functionality. Peer-to-peer usually works best for small to medium LANs and is cheaper to set up.


Client/server network operating systems provide users with access to resources through a server. In this architecture, all functions and applications are unified under one file server that can be used to execute individual client actions regardless of physical location. Client/server tends to be most expensive to implement and requires a large amount of technical maintenance. An advantage to the client/server model is that the network is controlled centrally, makes changes or additions to technology easier to incorporate.


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, Novell NetWare, and BSD etc.



5. Real Time OS
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.          



6.Multiprogramming OS
            To overcome the problem of underutilization of CPU and main memory, the multiprogramming was introduced. The multiprogramming is interleaved execution of multiple jobs by the same computer.

In multiprogramming system, when one program is waiting for I/O transfer; there is another program ready to utilize the CPU. So it is possible for several jobs to share the time of the CPU. But it is important to note that multiprogramming is not defined to be the execution of jobs at the same instance of time. Rather it does mean that there are a number of jobs available to the CPU (placed in main memory) and a portion of one is executed then a segment of another and so on.



As shown in fig, at the particular situation, job' A' is not utilizing the CPU time because it is busy in I/ 0 operations. Hence the CPU becomes busy to execute the job 'B'. Another job C is waiting for the CPU for getting its execution time. So in this state the CPU will never be idle and utilizes maximum of its time.

A program in execution is called a "Process", "Job" or a "Task". The concurrent execution of programs improves the utilization of system resources and enhances the system throughput as compared to batch and serial processing. In this system, when a process requests some I/O to allocate; meanwhile the CPU time is assigned to another ready process. So, here when a process is switched to an I/O operation, the CPU is not set idle.

Multiprogramming is a common approach to resource management. The essential components of a single-user operating system include a command processor, an input/ output control system, a file system, and a transient area. A multiprogramming operating system builds on this base, subdividing the transient area to hold several independent programs and adding resource management routines to the operating system's basic functions.



7. Multiprocessor OS
            Most computer systems are single processor systems i.e they only have one processor. However, multiprocessor or parallel systems are increasing in importance nowadays. These systems have multiple processors working in parallel that share the computer clock, memory, bus, peripheral devices etc. An image demonstrating the multiprocessor architecture is:

Types of Multiprocessors
There are mainly two types of multiprocessors i.e. symmetric and asymmetric multiprocessors. Details about them are as follows:

Symmetric Multiprocessors
In these types of systems, each processor contains a similar copy of the operating system and they all communicate with each other. All the processors are in a peer to peer relationship i.e. no master - slave relationship exists between them.


An example of the symmetric multiprocessing system is the Encore version of Unix for the Multimax Computer.

Asymmetric Multiprocessors
In asymmetric systems, each processor is given a predefined task. There is a master processor that gives instruction to all the other processors. Asymmetric multiprocessor system contains a master slave relationship.


Asymmetric multiprocessor was the only type of multiprocessor available before symmetric multiprocessors were created. Now also, this is the cheaper option.

Advantages of Multiprocessor Systems
There are multiple advantages to multiprocessor systems. Some of these are:

  • More reliable Systems : In a multiprocessor system, even if one processor fails, the system will not halt. This ability to continue working despite hardware failure is known as graceful degradation. For example: If there are 5 processors in a multiprocessor system and one of them fails, then also 4 processors are still working. So the system only becomes slower and does not ground to a halt.
  • Enhanced Throughput:  If multiple processors are working in tandem, then the throughput of the system increases i.e. number of processes getting executed per unit of time increase. If there are N processors then the throughput increases by an amount just under N.
  • More Economic Systems:  Multiprocessor systems are cheaper than single processor systems in the long run because they share the data storage, peripheral devices, power supplies etc. If there are multiple processes that share data, it is better to schedule them on multiprocessor systems with shared data than have different computer systems with multiple copies of the data.

Disadvantages of Multiprocessor Systems
There are some disadvantages as well to multiprocessor systems. Some of these are:

  • Increased Expense : Even though multiprocessor systems are cheaper in the long run than using multiple computer systems, still they are quite expensive. It is much cheaper to buy a simple single processor system than a multiprocessor system.
  • Complicated Operating System Required : There are multiple processors in a multiprocessor system that share peripherals, memory etc. So, it is much more complicated to schedule processes and impart resources to processes.than in single processor systems. Hence, a more complex and complicated operating system is required in multiprocessor systems.
  • Large Main Memory Required : All the processors in the multiprocessor system share the memory. So a much larger pool of memory is required as compared to single processor systems.


Thursday, December 19, 2019

Lecture-2- Functions Of Operating System

Functions Of Operating System

  1. Process Management
  2. Memory Management
  3. File
  4. Command Interpreter
  5. Input-Output Management
  6. Security
  7. Deadlock Prevention
  8. Interrupt Handling
  9. Virtual Storage


Process Management : The Operating System also Treats the Process Management means all the Processes those are given by the user or the Process those are System ‘s own Process are Handled by the Operating System . The Operating System will Create the Priorities foe the user and also Start or Stops the Execution of the Process and Also Makes the Child Process after dividing the Large Processes into the Small Processes.


Memory Management : Operating System also Manages the Memory of the Computer System means Provide the Memory to the Process and Also Deallocate the Memory from the Process. And also defines that if a Process gets completed then this will deallocate the Memory from the Processes.


File Management : It manages all the file-related activities such as organization storage, retrieval, naming, sharing, and protection of files.


Command Interpreter : This module is interpreting commands given by the and acting system resources to process that commands.


Input-Output Management : OS manages I/O devices and makes the I/O process effective. OS accepts the input from the input device, stores it in the main memory, ask the CPU to process it and finally provides the result to the output devices for output.


Security : OS makes sure that only authorized users get access to the computer and its data and the users only do things they are authorized to do.


Deadlock Prevention : During processing, a situation can arise in which a resource shared by two or more processes cannot continue because the resource required by one process is held by the other. This situation is called deadlock. OS ensures that the above condition do not hold by carefully allocating resources.



Interrupt Handling : Interrupt is a signal generated from a device or program when they need attention of the CPU. OS determines the type of interrupt and priority of the interrupt, stops the execution process of CPU, preserves the initial state of the CPU, perform the requested operation and brings the CPU at the same state when it was stopped.




Virtual Storage : If there are programs larger than main memory (RAM) of the computer, OS uses the reserved space in the secondary memory which is termed as virtual memory. It makes the execution of larger program (than RAM) possible but at the same times the operation becomes slower.




https://codingmoments.blogspot.com/2019/12/lecture-1-introduction-to-operating.html

Wednesday, December 18, 2019

Lecture- 1- Introduction To Operating System

Introduction: Operating System


Definition:
  • An Operating System(OS) is a program that acts as an interface between the user and the computer hardware and controls the execution of all kinds of programs.
  • The OS helps you to communicate with the computer without knowing how to speak the computer's language. It is not possible for the user to use any computer or mobile device without having an operating system.
  •  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.



System Software: 
  • System software is a type of computer program that is designed to run a computer's hardware and application programs. If we think of the computer system as a layered model, the system software is the interface between the hardware and user applications.
  • Any computer software which manages hardware so that application software can perform task.
  • Example : Operating System, Device Driver etc.
Application Software:
  • Application software is a term which is used for software created for a specific purpose. It is generally a program or collection of programs used by end users. It can be called an application or simply an app.
  • In fact all the software other than system software and programming software are application software.
  • A software which is developed to help the user to perform specific tasks is called application software.
  • Example: Ms-Word, Mp3 Player, Video Player etc..


Applications Of Operating System:

Following are some of the important activities that an Operating System performs −
  • Security: By means of password and similar other techniques, it prevents unauthorized access to programs and data.
  • Control over system performance: Recording delays between request for a service and response from the system.
  • Job accounting: Keeping track of time and resources used by various jobs and users.
  • Error detecting aids: Production of dumps, traces, error messages, and other debugging and error detecting aids.
  • Coordination between other softwares and users: Coordination and assignment of compilers, interpreters, assemblers and other software to the various users of the computer systems.

Wednesday, July 10, 2019

Havender Algorithm In Deadlock Prevention - Operating System

Havender in his pioneering work showed that since all four of the conditions are necessary for deadlock to occur, it follows that deadlock might be prevented by denying any one of the conditions.

  • Elimination of “Mutual Exclusion” ConditionThe mutual exclusion condition must hold for non-sharable resources. That is, several processes cannot simultaneously share a single resource. This condition is difficult to eliminate because some resources, such as the tap drive and printer, are inherently non-shareable. Note that shareable resources like read-only-file do not require mutually exclusive access and thus cannot be involved in deadlock.

  • Elimination of “Hold and Wait” ConditionThere are two possibilities for elimination of the second condition. The first alternative is that a process request be granted all of the resources it needs at once, prior to execution. The second alternative is to disallow a process from requesting resources whenever it has previously allocated resources. This strategy requires that all of the resources a process will need must be requested at once. The system must grant resources on “all or none” basis. If the complete set of resources needed by a process is not currently available, then the process must wait until the complete set is available. While the process waits, however, it may not hold any resources. Thus the “wait for” condition is denied and deadlocks simply cannot occur. This strategy can lead to serious waste of resources. For example, a program requiring ten tap drives must request and receive all ten derives before it begins executing. If the program needs only one tap drive to begin execution and then does not need the remaining tap drives for several hours. Then substantial computer resources (9 tape drives) will sit idle for several hours. This strategy can cause indefinite postponement (starvation). Since not all the required resources may become available at once.

  • Elimination of “No-preemption” ConditionThe nonpreemption condition can be alleviated by forcing a process waiting for a resource that cannot immediately be allocated to relinquish all of its currently held resources, so that other processes may use them to finish. Suppose a system does allow processes to hold resources while requesting additional resources. Consider what happens when a request cannot be satisfied. A process holds resources a second process may need in order to proceed while second process may hold the resources needed by the first process. This is a deadlock. This strategy require that when a process that is holding some resources is denied a request for additional resources. The process must release its held resources and, if necessary, request them again together with additional resources. Implementation of this strategy denies the “no-preemptive” condition effectively.
    High Cost   When a process release resources the process may lose all its work to that point. One serious consequence of this strategy is the possibility of indefinite postponement (starvation). A process might be held off indefinitely as it repeatedly requests and releases the same resources.

  • Elimination of “Circular Wait” ConditionThe last condition, the circular wait, can be denied by imposing a total ordering on all of the resource types and than forcing, all processes to request the resources in order (increasing or decreasing). This strategy impose a total ordering of all resources types, and to require that each process requests resources in a numerical order (increasing or decreasing) of enumeration. With this rule, the resource allocation graph can never have a cycle.
    For example, provide a global numbering of all the resources, as shown

  • 1Card reader
    2Printer
    3Plotter
    4Tape drive
    5Card punch
    Now the rule is this: processes can request resources whenever they want to, but all requests must be made in numerical order. A process may request first printer and then a tape drive (order: 2, 4), but it may not request first a plotter and then a printer (order: 3, 2). The problem with this strategy is that it may be impossible to find an ordering that satisfies everyone.