Important Announcement
PubHTML5 Scheduled Server Maintenance on (GMT) Sunday, June 26th, 2:00 am - 8:00 am.
PubHTML5 site will be inoperative during the times indicated!

Home Explore CU-BCA-SEM-III-System software and operating system-Second draft

CU-BCA-SEM-III-System software and operating system-Second draft

Published by kuljeet.singh, 2021-04-13 07:19:06

Description: CU-BCA-SEM-III-System software and operating system-Second draft

Search

Read the Text Version

BACHELOR OF COMPUTER APPLICATIONS SEMESTER III SYSTEM SOFTWARE AND OPERATING SYSTEM BCA134

CHANDIGARH UNIVERSITY Institute of Distance and Online Learning Course Development Committee Prof. (Dr.) R.S.Bawa Pro Chancellor, Chandigarh University, Gharuan, Punjab Advisors Prof. (Dr.) Bharat Bhushan, Director – IGNOU Prof. (Dr.) Majulika Srivastava, Director – CIQA, IGNOU Programme Coordinators & Editing Team Master of Business Administration (MBA) Bachelor of Business Administration (BBA) Coordinator – Dr. Rupali Arora Coordinator – Dr. Simran Jewandah Master of Computer Applications (MCA) Bachelor of Computer Applications (BCA) Coordinator – Dr. Raju Kumar Coordinator – Dr. Manisha Malhotra Master of Commerce (M.Com.) Bachelor of Commerce (B.Com.) Coordinator – Dr. Aman Jindal Coordinator – Dr. Minakshi Garg Master of Arts (Psychology) Bachelor of Science (Travel &TourismManagement) Coordinator – Dr. Samerjeet Kaur Coordinator – Dr. Shikha Sharma Master of Arts (English) Bachelor of Arts (General) Coordinator – Dr. Ashita Chadha Coordinator – Ms. Neeraj Gohlan Academic and Administrative Management Prof. (Dr.) R. M. Bhagat Prof. (Dr.) S.S. Sehgal Executive Director – Sciences Registrar Prof. (Dr.) Manaswini Acharya Prof. (Dr.) Gurpreet Singh Executive Director – Liberal Arts Director – IDOL © No part of this publication should be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording and/or otherwise without the prior written permission of the authors and the publisher. SLM SPECIALLY PREPARED FOR CU IDOL STUDENTS Printed and Published by: TeamLease EdtechLimited www.teamleaseedtech.com CONTACT NO:01133002345 For: CHANDIGARH UNIVERSITY 2 Institute of Distance and Online Learning CU IDOL SELF LEARNING MATERIAL (SLM)

First Published in 2021 All rights reserved. No Part of this book may be reproduced or transmitted, in any form or by any means, without permission in writing from Chandigarh University. Any person who does any unauthorized act in relation to this book may be liable to criminal prosecution and civil claims for damages. This book is meant for educational and learning purpose. The authors of the book has/have taken all reasonable care to ensure that the contents of the book do not violate any existing copyright or other intellectual property rights of any person in any manner whatsoever. In the event the Authors has/ have been unable to track any source and if any copyright has been inadvertently infringed, please notify the publisher in writing for corrective action. 3 CU IDOL SELF LEARNING MATERIAL (SLM)

CONTENT Unit - 1: Introduction To System Software ........................................................................................ 5 Unit - 2: Basics Of Operating Systems ............................................................................................ 25 Unit - 3: Types Of Operating Systems ............................................................................................. 39 Unit - 4: Operating System Components 1....................................................................................... 64 Unit - 5: Operating System Components 2....................................................................................... 91 Unit - 6: Processes......................................................................................................................... 116 Unit - 7: Cpu Scheduling............................................................................................................... 140 Unit - 8: Scheduling Algorithms.................................................................................................... 165 Unit - 9: Process Synchronization.................................................................................................. 186 Unit -10: Deadlocks ...................................................................................................................... 206 Unit - 11: Memory Management Strategies ................................................................................... 233 Unit - 12: Paging ........................................................................................................................... 249 Unit - 13: Paging 2 ........................................................................................................................ 274 Unit - 14: Physical File System ..................................................................................................... 298 4 CU IDOL SELF LEARNING MATERIAL (SLM)

UNIT - 1: INTRODUCTION TO SYSTEM SOFTWARE Structure 1.0 Learning Objectives 1.1 Introduction 1.2 Machine Structure 1.3 Machine language 1.4 Generations of languages 1.5 Language Translators 1.6 Components of System Software 1.7 Summary 1.8 Keywords 1.9 Learning Activity 1.10 Unit End Questions 1.11 References 1.0 LEARNING OBJECTIVES After studying this unit, you will be able to:  Describe basic machine structure  Outline machine language  Explain language translators  Discuss system software  Describe components of system software 1.1 INTRODUCTION 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. The operating system is 5 CU IDOL SELF LEARNING MATERIAL (SLM)

the best-known example of system software. The OS manages all the other programs in a computer. System software is used to manage the computer itself. It runs in the background, maintaining the computer's basic functions so users can run higher-level application software to perform certain tasks. Essentially, system software provides a platform for application software to be run on top of. Important features of system software Computer manufacturers usually develop the system software as an integral part of the computer. The primary responsibility of this software is to create an interface between the computer hardware they manufacture and the end user. System software generally includes the following features: 1. High speed. System software must be as efficient as possible to provide an effective platform for higher-level software in the computer system. 2. Hard to manipulate. It often requires the use of a programming language, which is more difficult to use than a more intuitive user interface (UI). 3. Written in a low-level computer language. System software must be written in a computer language the central processing unit (CPU) and another computer hardware can read. 4. Close to the system. It connects directly to the hardware that enables the computer to run. 5. Versatile. System software must communicate with both the specialized hardware it runs on and the higher-level application software that is usually hardware-agnostic and often has no direct connection to the hardware it runs on. System software also must support other programs that depend on it as they evolve and change. What is System Programming? System Programming consists of a variety of programs that support the operations of a computer. This software makes it possible for the user to focus on an application or the other problem to be solved. System programs (e.g., compiler, loader macro processors, and operating systems) were developed to make computer better adapted d to the need of their users. 6 CU IDOL SELF LEARNING MATERIAL (SLM)

Component of System Programming Components of system programming are 1. Assemble 2. Loader 3. Compiler 4. Macros 5. Formal System Assembler:  An assembler is a type of computer program that interprets software programs written in assembly language into machine language, code and instructions that can be executed by a computer.  An assembler enables software and application developers to access, operate and manage a computer's hardware architecture and components.  An assembler is sometimes referred to as the compiler of assembly language. It also provides the services of an interpreter. Loader:  A loader is a program used by an operating system to load programs from a secondary to main memory so as to be executed. Compiler:  A compiler is a computer program (or a set of programs) that transforms source code written in a programming language (the source language) into another computer language (the target language), with the latter often having a binary form known as object code. Macro:  A macro is a single line abbreviation for group of statement.  A macro processor is a program that substitutes and specialized macro definitions for macro calls. 7 CU IDOL SELF LEARNING MATERIAL (SLM)

Formal System:  A formal system consists of a language over some alphabet of symbols together with (axioms and) inference rules that distinguish some of the strings in the language as theorems.  A formal system has the following components:  A finite alphabet of symbols.  A syntax that defines which strings of symbol are in the language of our formal system. 1.2 MACHINE STRUCTURE All the conventional modern computers are based upon the concept of stored program computer, the model that was proposed by John von Neumann. Figure 1.1: General Machine Structure The components of a general machine are as follows: Instruction interpreter: A group of electronic circuits performs the intent of instruction of fetched from memory. 8 CU IDOL SELF LEARNING MATERIAL (SLM)

1. Location counter: LC otherwise called as program counter PC or instruction counter IC, is a hardware memory device which denotes the location of the current instruction being executed. 2. Instruction registers: A copy of the content of the LC is stored in IR. 3. Working register: are the memory devices that serve as “scratch pad” for the instruction interpreter. 4. General register: are used by programmers as storage locations and for special functions. 5. Memory address registers (MAR): contains the address of the memory location that is to read from or stored into. 6. Memory buffer register (MBR): contain a copy of the content of the memory location whose address is stored in MAR. The primary interface between the memory and the CPU is through memory buffer register. 7. Memory controller: is a hardware device whose work is to transfer the content of the MBR to the core memory location whose address is stored in MAR. 8. I/O channels: may be thought of as separate computers which interpret special instructions for inputting and outputting information from the memory. 1.3 MACHINE LANGUAGE Machine language is the language understood by a computer. It is very difficult to understand, but it is the only thing that the computer can work with. All programs and programming languages eventually generate or run programs in machine language. Machine language is made up of instructions and data that are all binary numbers. Machine language is normally displayed in hexadecimal form so that it is a little bit easier to read. Assembly language is almost the same as machine language, except that the instructions, variables and addresses have names instead of just hex numbers. Sometimes referred to as machine code or object code, machine language is a collection of binary digits or bits that the computer reads and interprets. Machine language is the only language a computer is capable of understanding. 9 CU IDOL SELF LEARNING MATERIAL (SLM)

The exact machine language for a program or action can differ by operating system. The specific operating system dictates how a compiler writes a program or action into machine language. Computer programs are written in one or more programming languages, like C++, Java, or Visual Basic. A computer cannot directly understand the programming languages used to create computer programs, so the program code must be compiled. Once a program's code is compiled, the computer can understand it because the program's code is turned into machine language. Machine language example Below is an example of machine language (binary) for the text \"Hello World.\" 01001000 01100101 01101100 01101100 01101111 00100000 01010111 01101111 01110010 01101100 01100100 Below is another example of machine language (non-binary), which prints the letter \"A\" 1000 times to the computer screen. 169 1 160 0 153 0 128 153 0 129 153 130 153 0 131 200 208 241 96 1.4 GENERATIONS OF LANGUAGES Language translators allow computer programmers to write sets of instructions in specific programming languages. These instructions are converted by the language translator into machine code. The computer system then reads these machine code instructions and executes them. Hence, a language translator is a program that translates from one computer language to another. It was mentioned earlier in this chapter that CPUs could only understand machine code or machine language. Machine code is hardware-specific, and hence there are as many machine codes as there are hardware designs. Although machine code makes complete sense for computers, it is a very difficult and tedious language in which to write programs. Hence programmers developed other less difficult languages in which to write programs. Over the years, these programming languages are moving closer and closer to human language. Consequently, there are several generations of computer programming languages. 10 CU IDOL SELF LEARNING MATERIAL (SLM)

First generation languages (1GLs). 1GLs constitute the actual code that computers understand; that is machine code. In the early days of computing, programmers needed to learn the specific pattern of 1's and 0's of all computing instructions in order to tell the computer what to do. For example, a machine code instruction to load a value of 1 may be 10101001 00000001. Second generation languages (2GLs). 2GLs are called assembly languages. Each machine code instruction is given a mnemonic, making it easier to remember specific codes. The above example in assembly language would be LDA #$01, where LDA stands for Load the following value into a memory Address. Third generation languages (3GLs). 3GLs are called procedural languages or high-level languages. They are easier to understand because they resemble our own English language more than 1GLs and 2GLs. However, specific training is still required to program in these languages. Some examples of 3GLs are BASIC, COBOL, Pascal, FORTRAN, C, C++, Perl and Ada. One of the latest languages to hit the market is called JAVA. Developed by Sun Microsystems, this language allows programmers to write applications that can be used on any operating system (platform-independent). Its main use is in web pages where JAVA is used to write applets (short applications) to enhance the look and feel of a web page. Fourth generation languages (4GLs). 4GLs are sometimes called problem-oriented languages or non-procedural languages, and require less training than 3GLs. In these languages one tells the computer what to do, not how to do it. Programmers and end-users use 4GLs to develop software applications. Some examples are SQL, ACCESS, Informix and FOCUS. Fifth generation languages (5GLs). Called natural languages, 5GLs translate human instructions, including spelling mistakes and bad grammar, into machine code. They are designed to give people a more natural connection with computers. These languages are the objects of considerable research. It is hoped that they would be able to remember as people do, and then improve upon it. 1.5 LANGUAGE TRANSLATORS Time sharing, or multitasking, is a logical extension of multiprogramming. Multiple jobs are executed by the CPU switching between them, but the switches occur so frequently that the users may interact with each program while it is running. 11 CU IDOL SELF LEARNING MATERIAL (SLM)

Compiler  A compiler is a translator used to convert high-level programming language to low-level programming language. It converts the whole program in one session and reports errors detected after the conversion.  Compiler takes time to do its work as it translates high-level code to lower- level code all at once and then saves it to memory. A compiler is processor- dependent and platform-dependent. But it has been addressed by a special compiler, a cross-compiler and a source-to-source compiler.  Before choosing a compiler, user has to identify first the Instruction Set Architecture (ISA), the operating system (OS) and the programming language that will be used to ensure that it will be compatible. Interpreter  Just like a compiler, is a translator used to convert high-level programming language to low level programming language. It converts the program one at a time and reports errors detected at once, while doing the conversion.  With this, it is easier to detect errors than in a compiler. An interpreter is faster than a compiler as it immediately executes the code upon reading the code.  It is often used as a debugging tool for software development as it can execute a single line of code at a time. An interpreter is also more portable than a compiler as it is not processor-dependent, you can work between hardware architectures. Difference between compiler and interpreter Sr. No. Compiler Interpreter 1 Scans the entire program first and thenTranslate the program line-by-line. translate it into machine code 2 Convert the entire program to machineEach time the program is executed, code; when all the syntax errors haveevery line is checked for syntax error been removed execution takes place. and then converted to equivalent machine code 12 CU IDOL SELF LEARNING MATERIAL (SLM)

3 Execution time is less Execution time is more 4 Machine code can be saved and used;Machine code cannot be saved; source code and compiler no longerinterpreter is always required for needed. translation. 5 Since source code is not required Source code can be easily modified and tampering with the source code is nothence no security of programs. possible 6 Slow for debugging Fast for debugging Assembler  An assembler is a translator used to translate assembly language to machine language. It is like a compiler for the assembly language but interactive like an interpreter. Assembly language is difficult to understand as it is a low-level programming language.  An assembler translates a low-level language, an assembly language to an even lower- level language, which is the machine code. The machine code can be directly understood by the CPU. Examples of Translators Translator Examples Compiler Microsoft Visual Studio GNU Compiler Collection (GCC) Common Business Oriented Language (COBOL) Interpreter OCaml List Processing (LISP) Python 13 CU IDOL SELF LEARNING MATERIAL (SLM)

Assembler Fortran Assembly Program (FAP) Macro Assembly Program (MAP) Symbolic Optimal Assembly Program (SOAP) Linker A linker is special program that combines the object files, generated by compiler/assembler, and other pieces of codes to originate an executable file have. Exe extension. In the object file, linker searches and append all libraries needed for execution of file. It regulates memory space that code from each module will hold. It also merges two or more separate object programs and establishes link among them. Generally, linkers are of two types: 1. Linkage Editor 2. Dynamic Linker Figure 1.2: Language Translators Loader The loader is special program that takes input of object code from linker, loads it to main memory, and prepares this code for execution by computer. Loader allocates memory space to program. Even it settles down symbolic reference between objects. It in charge of loading programs and libraries in operating system. The embedded computer systems don’t have loaders. In them, code is executed through ROM. Generally, loader has three types of approach: 1. Absolute loading 14 CU IDOL SELF LEARNING MATERIAL (SLM)

2. Relocatable loading LOADER 3. Dynamic run-time loading Difference between Linker and Loader S.NO. LINKER The main function of Linker is to generate Whereas main objective of Loader is to 1 executable files. executable files to main memory. The linker takes input of object code And the loader takes input of executable 2 generated by compiler/assembler. files generated by linker. Linking can be defined as process of Loading can be defined as process of combining various pieces of codes and loading executable codes to main memory 3 source code to obtain executable code. for further execution. Loader is of 3 types: Absolute loading, Linker is of 2 types: Linkage Editor and Relocatable loading and Dynamic run-time 4 Dynamic Linker. loading. Another use of linker is to combine all It helps in allocating the address to 5 object modules. executable codes/files. Linker is also responsible for arranging Loader is also responsible for adjusting 6 objects in program’s address space. references which are used within the program. Assembly Language 15 CU IDOL SELF LEARNING MATERIAL (SLM)

 An assembler is a program that takes computer instruction and converts them into a pattern of bits that the computer processor can use to perform its basic operation.  The assembler is responsible for translating the assembly language program into machine code. When the source program language is essentially a symbolic representation for a numerical machine language, the translator is called assembler and the source language is called an assembly language. Figure 1.3: Assembler functions Basic function of Assembler  Translate mnemonics opcodes to machine language.  Convert symbolic operands to their machine addresses.  Build machine instructions in the proper format  Convert data constants into machine representation.  Error checking is provided.  Changes can be quickly and easily incorporated with a reassembly.  Variables are represented by symbolic names, not as memory locations.  Assembly language statements are written one per line. A machine code program thus consists of a sequence of assembly language statements, where each statement contains a mnemonic. Advantages  Reduced errors  Faster translation times  Changes could be made easier and faster. 16 CU IDOL SELF LEARNING MATERIAL (SLM)

 Addresses are symbolic, not absolute \\  Easy to remember Disadvantages  Assembler language are unique to specific types of computer  Program is not portable to the computer.  Many instructions are required to achieve small tasks  Programmer required knowledge of the processor architecture and instruction set. Translation phase of Assembler The six steps that should be followed by the designer 1. Specify the problem 2. Specify data structure 3. Define format of data structure 4. Specify algorithm 5. Look for modularity 6. Repeat 1 through 5 on modules Functions / Purpose of Assembler An assembler must do the following 1. Generate instruction a.Evaluate the mnemonics in the operation field to produce the machine code b.Evaluate the subfield-fine the value of each symbol. Process literals and assign addresses. 2. Process pseudo-ops a.Pass 1 (Define symbol and literals) i. Determine length of machine instruction (MOTGET) ii. Keep track of location counter (LC) iii. Remember value of symbol until pass 2 (STSTO) 17 CU IDOL SELF LEARNING MATERIAL (SLM)

iv. Process some pseudo ops (POTGET1) v. Remember literal (LITSTO) b.Pass 2 (Generate object Program) i. Look up value of symbol (STGET) ii. Generate instruction (MOTGET2) iii. Generate data (for DS, DC and Literal) iv. Process pseudo ops (POTGET2) Components of System Software  Network and Internet Services.  Hardware Level of Operating System.  Logical Level of Operating System.  Graphics Engine.  User Interface.  System Services.  Command Shell.  System Utilities. 1.6 COMPONENTS OF SYSTEM SOFTWARE System software is designed to operate the hardware of the computer. It also provides platform for running application software and basic functions for the computer usage. The purpose of system software is to protect the applications programmer from the complexity and specific details of a particular computer being used, especially memory and other hardware features. It consists of the following components: Device Driver: This is a computer program that allows higher level computer programs in interacting with the computer hardware. A device driver simplifies programming as it acts as a translator between a hardware device and the applications that use it. Operating System: 18 CU IDOL SELF LEARNING MATERIAL (SLM)

An operating system manages computer hardware, provides services for execution of application software. It consists of programs and data. Examples of operating systems for computers are Linux, Microsoft Windows, OS X, and UNIX. Server: A server is a program that operates as a socket listener in computer networking. A server computer is a computer, or series of computers, that link other computers and they often provide essential services across a network, either to private users inside a large organization or to public users via the internet. Utility Software: Utility software is used to manage the computer hardware and application software and performs small tasks. Some of the examples of utility software are systems utilities, virus scanners and disk defragmenters. Windowing System: A windowing system supports the implementation of window managers and provides basic support for graphics hardware and pointing devices such as mice, and keyboards. It is a component of graphical user interface. Application Programs: Application programs are the top software layer. You can perform specific tasks with these programs, such as using a word processor for writing, a spreadsheet for accounting, or a computer-aided design program for drawing. The other two layers, device drivers and the operating system, play important support roles. Your system might run one application program at a time, or it might run many simultaneously. Root-User Processes: Root-user processes are programs that can be run only by a user with root authority. A system administrator has root authority for all processes. Root-user processes include:  Read or write any object  Call any system function  Perform certain subsystem-control operations 19 CU IDOL SELF LEARNING MATERIAL (SLM)

When you are not allowed to run a command, the system displays a message saying you do not have the correct permissions or you are not allowed to run that command. The system administrator may be the only person who can log in as root on your system. The system administrator can also set you up to use particular commands, giving you some control over processes. 1.7 SUMMARY  System software is software that provides platform to other software. Some examples can be operating systems, antivirus software, disk formatting software, Computer language translators etc. These are commonly prepared by the computer manufacturers.  This software consists of programs written in low-level languages, used to interact with the hardware at a very basic level. System software serves as the interface between the hardware and the end users.  Machine language is a collection of binary digits or bits that the computer reads and interprets. Machine language is the only language a computer is capable of understanding.  The exact machine language for a program or action can differ by operating system. The specific operating system dictates how a compiler writes a program or action into machine language.  A translator or programming language processor is a generic term that can refer to anything that converts code from one computer language into another. A program written in high-level language is called source program. 1.8 KEYWORDS  System Software: System software is software designed to provide a platform for other software.  Assembler: An assembler is a program that converts assembly language into machine code. It takes the basic commands and operations from assembly code and converts them into binary code that can be recognized by a specific type of processor.  Compiler: Primarily used for programs that translates source code from a high-level programming language to a lower-level language to create an executable program.  Loader: It is part of an operating system that is responsible for loading programs and libraries. 20 CU IDOL SELF LEARNING MATERIAL (SLM)

 Linker: A system program that takes one or more object files and combines them into a single executable file, library file, or another object file.  Interpreter: A computer program that directly executes instructions written in a programming or scripting language, without requiring them previously to have been compiled into a machine language program. 1.9 LEARNING ACTIVITY 1. Multithreading is a commonly used programming technique. Describe three different ways to implement threads and compare these three methods with the Linux clone () mechanism. When might using each alternative mechanism be better or worse than using clones? ___________________________________________________________________________ ____________________________________________________________________ 1.10 UNIT END QUESTIONS A. Descriptive Questions Short Questions 1. Define: System software. 2. What are language translators? 3. Differentiate between compiler and interpreter. 4. Differentiate between linker and loader. 5. List the components of system software. Long Questions 1. Outline the general structure of a machine. 2. Describe the machine language. 3. Explain different types of language translators. 4. Discuss the basic functions of assembler. 5. Describe various phases an assembler 21 CU IDOL SELF LEARNING MATERIAL (SLM)

B. Multiple Choice Questions 1. What type of Software is needed to control the computer’s hardware? a. Programming Software b. Systems Software c. Application Software d. Bespoke Software 2. The following is not a type of Systems Software. a. Device drivers b. Utility programs c. Applications d. Operating system 3. This piece of software is used to control hardware devices and allow an Operating System to make use of the hardware. a. Device Management b. Device Driver c. Device System d. Hardware Peripheral Device 4. Assembler is a machine dependent, because of? 22 a. Argument list array b. Macro definition table c. Pseudo operation table d. Mnemonics operation table CU IDOL SELF LEARNING MATERIAL (SLM)

5. A program a. is a sequence of instructions b. is the device where information is stored c. is a device that performs a sequence of operations specified by instructions in memory d. is a communication bus 6. Macro processor is an inbuilt function of a. assembler b. loader c. linker d. editor 7. Assembler is a. A program that places programs into memory an prepares them for execution b. Is a program that appears to execute a source program as if it were machine language new file c. A program that automates the translation of assembly language into machine language d. A program that accepts a program written in high level language and produces an object program 8. An interpreter is a. A program that places programs into memory an prepares them for execution b. A program that appears to execute a source program as if it were machine language c. A program that automates the translation of assembly language into machine language d. A program that accepts a program written in high level language and produces an object program 23 CU IDOL SELF LEARNING MATERIAL (SLM)

9. The translator used by second generation languages is? a. assembler b. interpreter c. compiler d. linker 10. A computer program that converts the whole program into machine language at a single time is called a. Compiler b. Translator c. Interpreter d. All of these Answers: 1 b, 2 c,3 b, 4 d, 5 a, 6 a, 7 c, 8 b, 9 a, 10 a 1.11 REFERENCES  A. Silberschatz P.B. Galvin, Gange (2002). Operating System Concepts, 6th Ed., Addison Wesley Publishing Co., Boston.  H.M. Deitel (1990). An Introduction to Operating Systems, Addison Wesley Publishing Co., Boston.  D.M. Dhamdhare (2002). Operating System. Tata McGraw Hill, New Delhi.  A.S. Tanenbaum (2000). Operating Systems: Design and Implementation, Prentice Hall of India, New Delhi.  Nutt (2005). Operating Systems, 3rd Edition, Pearson Education, Delhi. 24 CU IDOL SELF LEARNING MATERIAL (SLM)

UNIT - 2: BASICS OF OPERATING SYSTEMS Structure 2.0 Learning Objectives 2.1 Introduction 2.2 Introduction to operating system 2.2.1 Linux as the Kernel of the Linux Operating System 2.3 Basic Operating System 2.3.1 Functions 2.4 Generations of operating Systems 2.5 Summary 2.6 Keywords 2.7 Learning Activity 2.8 Unit End Questions 2.9 References 2.0 LEARNING OBJECTIVES After studying this unit, you will be able to:  Describe operating system  Discuss evolution of operating systems  Outline the history of operating systems  State the latest computer systems 2.1 INTRODUCTION  If we just build a computer, using physical components, we end up with a lot of assembled metal, plastic and silicon. In this state the computer can do nothing useful.  To turn it into one of the most versatile tools known to man we need software. We need applications that allow us to write letters develop (other) programs and calculate cash flow forecasts.

 But, if all we have are the applications, then each programmer has to deal with the complexities of the hardware. If a program requires data from a disc, the programmer would need to know how every type of disc worked and then be able to program at a low level in order to extract the data. In addition, the programmer would have to deal with all the error conditions that could arise.  As an example, it is a lot easier for a programmer to say READ NEXT RECORD than have to worry about moving the read/write heads, waiting for the correct sector to come around and then reading the data (and this is very simplified view of what actually happens).  It was clear, from an early stage in the development of computers, that there needed to be a layer of software that sat between the hardware and the software. This had led to this view of a computer.  The bottom layer of the hardware consists of the integrated circuits, the cathode ray tubes, the wire and everything else that electrical engineers use to build physical devices.  The next layer of hardware (microprogramming) is actually software (sometimes called firmware) that provides basic operations that allow communication with the physical devices. This software is normally in Read Only Memory (and that is why it is called firmware).  The machine language layer defines the instruction set that are available to the computer. Again, this layer is really software but it is considered as hardware as the machine language will be part and parcel of the hardware package supplied by the hardware supplier.  The operating system is a layer between this hardware and the software that we use. It allows us (as programmers) to use the hardware in a user-friendly way.  Furthermore, it allows a layer of abstraction from the hardware. For example, we can issue a print command without having to worry about what printer is physically connected to the computer. In fact, we can even have different operating systems running on the same hardware (e.g., DOS, Windows and UNIX) so that we can use the hardware using an operating system that suits us. 26 CU IDOL SELF LEARNING MATERIAL (SLM)

2.2 INTRODUCTION TO OPERATING SYSTEM Operating System (or shortly OS) primarily provides services for running applications on a computer system. The primary need for the OS arises from the fact that user needs to be provided with services and OS ought to facilitate the provisioning of these services. The central part of a computer system is a processing engine called CPU. A system should make it possible for a user’s application to use the processing unit. A user application would need to store information. The OS makes memory available to an application when required. Similarly, user applications need use of input facility to communicate with the application. This is often in the form of a key board, or a mouse or even a joy stick (if the application is a game for instance). 2.2.1 Linux as the Kernel of the Linux Operating System When we look at a Linux Operating System, its core component is its kernel. The kernel all Linux Operating System use is the Linux kernel, or just Linux. Yes, that's right, the Linux Operating System is called after the kernel, Linux. Now although all Linux Operating Systems use Linux as their kernel, many of them use a different flavor. This is because the kernel development has several branches. The most important one I call the vanilla kernel. This kernel is the main development kernel where most kernel developers work on; every other kernel is based on this kernel. Other kernels introduce features that the vanilla kernel doesn't want yet (or has tossed away in favour of another feature); still, these kernels are fully compatible with the vanilla kernel. The Linux kernel saw its first light in 1991 and is created (and still maintained) by Linus Torvalds. It grew rapidly (in 1994, version 1.0.0 saw the light) both in size (1.0.0 had more than 175000 lines of code) and in popularity. Over the years, its development model stayed the same: there are few major players in the development who decide what goes in and what stays out of the kernel code, but the majority of contributions happen from several hundred volunteers (kernel 2.6.21 had contributions from more than 800 individuals). The latest kernel version at the time of writing is 3.10.7. The first two numbers play the role of the major version, the third number is the minor version (mostly bugfix releases). Sometimes a fourth number is added when a one-off bug fix was needed. The Linux kernel 27 CU IDOL SELF LEARNING MATERIAL (SLM)

development generally increments the major numbers (most of the time the second number) for functional improvement releases: for every increment, users (and developers) know that the kernel has new features. 2.3 BASIC OPERATING SYSTEM Try to recall what all happens when you switch on a computer and before you start operating on it. In a typical personal computer scenario, this is what happens. Some information appears on the screen. This is followed by memory counting activity. Keyboard, disk drives, printers and other similar devices are verified for proper operation. These activities always occur whenever the computer is switched on or reset. There may be some additional activities on some machine also. These activities are called power-on routines. Why do these activities always happen? You will learn about it elsewhere in this lesson. You know a computer does not do anything without properly instructed. Thus, for each one of the above power-on activities also, the computer must have instructions. These instructions are stored in a non-volatile memory, usually in a ROM. The CPU of the computer takes one instruction from this ROM and executes it before taking next instruction. Since ROMs are of finite size, they can store only a few kilobytes of instructions. One by one the CPU executes these instructions. Once, these instructions are over, the CPU must obtain further instructions from somewhere else. Usually, further instructions are stored on a secondary storage device like hard disk, floppy disk or CD-ROM disk. These instructions are collectively known as operating system and their primary function is to provide an environment in which users may execute their own instructions. In general, however, there is no completely adequate definition of an operating system. Operating systems exist because they are a reasonable way to solve the problem of creating a usable computing system. 28 CU IDOL SELF LEARNING MATERIAL (SLM)

Figure 2.1: Operating Systems Act as Interface between the User and the Computer Hardware The fundamental goal of computer systems is to execute user programs and to make solving user problems easier. Hardware of a computer is equipped with extremely capable resources – memory, CPU, I/O devices etc. All these hardware units interact with each other in a well- defined manner. Bare hardware is not enough to solve a problem. Application programs are developed for the purpose, which require certain common operations, such as those controlling the I/O devices. The common functions of controlling and allocating resources are then brought together into one piece of software: the operating system. It is easier to define operating systems by their functions, i.e., by what they do than by what they are. The computer becomes easier for the users to operate, is the primary goal of an operating system. Operating systems exist because they are supposed to make it easier to compute with them than without them. This view is particularly clear when you look at operating systems for small personal computers. Efficient operation of the computer system is a secondary goal of an operating system. This goal is particularly important for large, shared multi-user systems. These systems are typically expensive, so it is desirable to make them as efficient as possible. 29 CU IDOL SELF LEARNING MATERIAL (SLM)

2.3.1 Functions An operating system performs these services for applications: 1. In a multitasking operating system where multiple programs can be running at the same time, the operating system determines which applications should run in what order and how much time should be allowed for each application before giving another application a turn. 2. It manages the sharing of internal memory among multiple applications. 3. It handles input and output to and from attached hardware devices, such as hard disks, printers, and dial-up ports. 4. It sends messages to each application or interactive user (or to a system operator) about the status of operation and any errors that may have occurred. 5. It can offload the management of what are called batch jobs (for example, printing) so that the initiating application is freed from this work. 6. On computers that can provide parallel processing, an operating system can manage how to divide the program so that it runs on more than one processor at a time Figure 2.2: Basic Functions of an Operating System An operating system is a layer of software which takes care of technical aspects of a computer's operation. It shields the user of the machine from the low-level details of the machine's operation and provides frequently needed facilities. There is no universal definition of what an operating system consists of. You can think of it as being the software which is 30 CU IDOL SELF LEARNING MATERIAL (SLM)

already installed on a machine, before you add anything of your own. Normally the operating system has a number of key elements: 7. A technical layer of software for driving the hardware of the computer, like disk drives, the keyboard and the screen; 8. A file system which provides a way of organizing files logically 9. A simple command language which enables users to run their own programs and to manipulate their files in a simple way. Some operating systems also provide text editors, compilers, debuggers and a variety of other tools. Since the Operating System (OS) is in charge of a computer, all requests to use its resources and devices need to go through the operating system. An operating system therefore provides legal entry points into its code for performing basic operations like writing to devices. 2.4 GENERATIONS OF OPERATING SYSTEMS The First Generation (1945 - 1955): Vacuum Tubes and Plug boards Digital computers were not constructed until the Second World War. Calculating engines with mechanical relays were built at that time. However, the mechanical relays were very slow and were later replaced with vacuum tubes. These machines were enormous but were still very slow. These early computers were designed, built and maintained by a single group of people. Programming languages were unknown and there were no operating systems so all the programming was done in machine language. All the problems were simple numerical calculations. By the 1950’s punch cards were introduced and this improved the computer system. Instead of using plug boards, programs were written on cards and read into the system. The Second Generation (1955 - 1965): Transistors and Batch Systems Transistors led to the development of the computer systems that could be manufactured and sold to paying customers. These machines were known as mainframes and were locked in air- conditioned computer rooms with staff to operate them. The Batch System was introduced to reduce the wasted time in the computer. A tray full of jobs was collected in the input room and read into the magnetic tape. After that, the tape was rewound and mounted on a tape drive. Then the batch operating system was loaded in which 31 CU IDOL SELF LEARNING MATERIAL (SLM)

read the first job from the tape and ran it. The output was written on the second tape. After the whole batch was done, the input and output tapes were removed and the output tape was printed. Figure 2.3: Various Generations of operating systems The Third Generation (1965 - 1980): Integrated Circuits and Multiprogramming Until the 1960’s, there were two types of computer systems i.e., the scientific and the commercial computers. These were combined by IBM in the System/360. This used integrated circuits and provided a major price and performance advantage over the second- generation systems. The third-generation operating systems also introduced multiprogramming. This meant that the processor was not idle while a job was completing its I/O operation. Another job was scheduled on the processor so that its time would not be wasted. The Fourth Generation (1980 - Present): Personal Computers Personal Computers were easy to create with the development of large-scale integrated circuits. These were chips containing thousands of transistors on a square centimetre of 32 CU IDOL SELF LEARNING MATERIAL (SLM)

silicon. Because of these, microcomputers were much cheaper than minicomputers and that made it possible for a single individual to own one of them. The advent of personal computers also led to the growth of networks. This created network operating systems and distributed operating systems. The users were aware of a network while using a network operating system and could log in to remote machines and copy files from one machine to another. 2.5 SUMMARY  An operating system is the most important program in a computer system. This is one program that runs all the time, as long as the computer is operational and exits only when the computer is shut down. Operating systems are the programs that make computers operational, hence the name. Operating systems are computers’ resource manager. Job scheduling is the process of sequencing jobs so that they can be executed on the processor.  The main advantage of the layered approach is modularity. The layers are selected such that each uses functions (operations) and services of only lower-level layers. System calls provide the interface between a process and the operating system. These calls are generally available as assembly-language instructions, and are usually listed in the manuals used by assembly-language programmers.  The design of a new operating system is a major task. The goals of the system must be well defined before the design begins. They form the foundation for choices among various algorithms and strategies that will be necessary. At the highest level, the design of the system will be affected by the choice of hardware and type of system: batch, time shared, single user, multi-user, distributed, real time, or general purpose.  The system should be convenient and easy to use, easy to learn, reliable, safe and fast. The operating system should be easy to design, implement, and maintain; it should be flexible, reliable, error free and efficient. One important principle is the separation of policy from mechanism. The separation of policy and mechanism is important for flexibility. Policies are likely to change across places or over time. Once an operating system is designed, it must be implemented. 33 CU IDOL SELF LEARNING MATERIAL (SLM)

2.6 KEYWORDS  Central processing unit (CPU): It is a principal part of any digital computer system, generally composed of the main memory, control unit, and arithmetic-logic unit.  Kernel: The kernel is a computer program at the core of a computer's operating system that has complete control over everything in the system.  Operating System: It is system software that manages computer hardware, software resources, and provides common services for computer programs.  Vacuum Tube: A vacuum tube computer, now termed a first-generation computer, is a computer that uses vacuum tubes for logic circuitry.  Plugboard: control panel is an array of jacks or sockets into which patch cords can be inserted to complete an electrical circuit. Control panels are sometimes used to direct the operation of unit record equipment, cipher machines, and early computers. 2.7 LEARNING ACTIVITY 1. Linux runs on a variety of hardware platforms. What steps must Linux developers take to ensure that the system is portable to different processors and memory-management architectures and to minimize the amount of architecture-specific kernel code? ___________________________________________________________________________ ____________________________________________________________________ 2.8 UNIT END QUESTIONS A. Descriptive Questions Short Questions 1. Define operating system. 2. What are functions of operating systems? 3. What are the goals of an operating system? 4. What are plug boards? 5. Define batch systems. Long Questions 34 1. Describe the architecture of a layered operating system. 2. Explain the working of an operating system with regard to resource management. CU IDOL SELF LEARNING MATERIAL (SLM)

3. Explain generations of operating systems. 4. Compare and contrast the evolution of operating systems and its features. 5. Describe basics operating systems. B. Multiple Choice Questions 1. When was the first operating system developed? a. 1948 b. 1949 c. 1951 d. 1952 2. To access the services of operating system, the interface is provided by the a. system calls b. API c. library d. assembly instructions 3. Which one of the following is not true? a. kernel is the program that constitutes the central core of the operating system b. kernel is the first part of operating system to load into memory during booting c. kernel is made of various modules which cannot be loaded in running operating system d. kernel remains in the memory during the entire computer session 4. Which one of the following errors will be handling by the operating system? 35 a. power failure CU IDOL SELF LEARNING MATERIAL (SLM)

b. lack of paper in printer 36 c. connection failure in the network d. All of these 5. The main function of the command interpreter is a. to get and execute the next user-specified command b. to provide the interface between the API and application program c. to handle the files in operating system d. None of these 6. By operating system, the resource management can be done via a. time division multiplexing b. space division multiplexing c. both (a) and (b) d. None of these 7. If a process fails, most operating system write the error information to a a. log file b. another running process c. new file d. None of these 8. Which electronic components are used in First Generation Computers? a. Transistors CU IDOL SELF LEARNING MATERIAL (SLM)

b. Integrated Circuits c. Vacuum Tubes d. VLSI Microprocessor 9. ENIAC Computer belongs to __________. a. First generation computers b. Second generation computers c. Third generation computers d. Fifth generation computers 10. VLSI Stands for __________. a. Very Large Storage Integration b. Very Large Storage Integrator c. Very Large-Scale Integration d. Very Large-Scale Integrator Answers 1 c, 2 a, 3 c, 4 d,5 a, 6 c, 7 a, 8 c, 9 a, 10 c 2.9 REFERENCES  A. Silberschatz P.B. Galvin, Gange (2002). Operating System Concepts, 6th Ed., Addison Wesley Publishing Co., Boston.  H.M. Deitel (1990). An Introduction to Operating Systems, Addison Wesley Publishing Co., Boston.  D.M. Dhamdhare (2002). Operating System. Tata McGraw Hill, New Delhi. 37 CU IDOL SELF LEARNING MATERIAL (SLM)

 A.S. Tanenbaum (2000). Operating Systems: Design and Implementation, Prentice Hall of India, New Delhi.  Nutt (2005). Operating Systems, 3rd Edition, Pearson Education, Delhi. 38 CU IDOL SELF LEARNING MATERIAL (SLM)

UNIT - 3: TYPES OF OPERATING SYSTEMS 39 Structure 3.0 Learning Objectives 3.1 Introduction 3.2 Batch Operating System 3.3 Mainframe Operating System 3.4 Time Sharing Operating System 3.5 Multiprocessing Operating System 3.6 Multiprogramming Operating System 3.7 Multithreading Operating System 3.8 Real Time Operating System 3.9 Embedded Operating System 3.10 Distributed Operating System 3.11Clustered Operating System 3.12 Summary 3.13 Keywords 3.14 Learning Activity 3.15 Unit End Questions 3.16 References 3.0 LEARNING OBJECTIVES After studying this unit, you will be able to:  Describe operating system  Discuss batch operating system  Outline multiprogramming system  Describe embedded operating system CU IDOL SELF LEARNING MATERIAL (SLM)

 Explain distributed operating system 3.1 INTRODUCTION  Whether it's a desktop or laptop computer, a smartphone or a video game system, every modern computer needs an operating system. That's the core software on the computer that sits between application software and the hardware, distributing memory and computing resources to apps, managing files and enforcing security rules.  Operating systems define how a computer stores files, switches between different applications, manages memory, keeps itself secure, and interacts with peripherals like printers and cameras. Different operating systems take different approaches to all of these, which is why you normally can't run a Windows program on a Macintosh computer and why permissions look different on an Android phone than on an iPhone.  Some operating systems are designed by groups of people around the world, like the open source, freely available operating system Linux, while others are commercial products made by one company, such as Microsoft's Windows and Apple's macOS.  Different operating systems run on different types of hardware and are designed for different types of applications. For example, iOS is designed for iPhones and iPad tablets, while Mac desktops and laptops use MacOS. Your computer or smartphone comes equipped with an OS, but you can install another one in some cases 3.2 BATCH OPERATING SYSTEM Batch processing system works as an operating system. Batch processing system means to grab all types of programs and data in the batch form then proceed to process. Main motive of using batch processing system is to decrease the set-up time while submitting the similar jobs to CPU. Batch processing techniques was implemented in the hard disk and card readers as well. In this, all jobs are saved on the hard disk for making the pool of jobs for their execution as a batch form. Batch monitor is started for executing all pooled jobs, after reading them. These jobs are divided into groups, and finally precede same jobs to similar batch. Now all batched jobs are ready to execution one by one without wasting more time, and due to this system enhance the system utilization while decrease the turnaround time. 40 CU IDOL SELF LEARNING MATERIAL (SLM)

Figure 3.1: Batch processing systems All jobs are executed in the “First Come First Serve” nature. When job is completed its processing, then its memory is free and result for job get copied as an output spool for further printing otherwise processing. Advantages of Batch Processing Operating System  In batch system all jobs are performed in repeating form without user’s permission.  Can be feed input data in the batch processing system without using extra hardware components.  Small scale business can use batch processing system for executing small tasks to their benefits.  For giving rest to system’s processors, your batch system is capable to work in off- line mode.  Batch processing system consumes less time for executing the all jobs.  Batch system is shareable nature, so it can be shared for couples of users, if needed.  When batch processing system executes their jobs then its idle time is very low.  Batch processing system has more capable to handle huge repeated task smoothly. Disadvantages Batch Processing Operating System  Provide well education to computer handler for operating the batch processing system.  It takes more time for debugging the batch processing system. 41 CU IDOL SELF LEARNING MATERIAL (SLM)

 Some time it may be more costly.  It has more turnaround time.  Batch processing system’s online sensors is often not available.  Include constrained operation.  If any one job halts, then increase workload for predicting time.  Due to any mistake, any job can enter into infinite loop.  If your protection system is not well then, any one job can affect pending jobs. Examples  Payroll System  Bank Invoice System  Transactions Process  Daily Report  Research Segment  Billing System 3.3 MAINFRAME OPERATING SYSTEM A mainframe operating system is networking software infrastructure that allows a mainframe computer to run programs, connect linked machines, and process complex numerical and data-driven tasks. All computers use some sort of basic operating system (OS), which is what enables them to organize files and execute commands. The biggest difference between a simple, one-computer OS and a mainframe operating system is where each is located. Simply put, a mainframe system works on a mainframe computer, which is usually thought of as sort of the “headquarters” or server for a computer network. Most major networks and infrastructures have a mainframe, which is where data is backed up and systems are broadly organized. Back in the early days of computing, all computers were mainframes, and most were very cumbersome to use and operate. Things have come a 42 CU IDOL SELF LEARNING MATERIAL (SLM)

long way, but there is still an important role for these larger operating systems when it comes to supporting all of the machinations of the modern technological landscape. Mainframe OS applications:  A number of today’s busiest Web sites save their production databases on a mainframe host  The mainframe inhabits a coveted place in today’s e-business environment.  In banking, financing, healthcare, insurance, utilities, government, and a wide range of various other public and private enterprises.  CICS (Customer Information Control System) used in bank-teller applications, ATM systems, 90 percent of Fortune 500, companies, there is a transaction web server that runs mainly on mainframe systems. Background of Mainframe OS:  Mainframes first came out in the early 1940s. The most popular sellers included IBM, Hitachi and Amdahl.  In 1950s, mainframe computers were literally the largest computers; couple of companies could afford them.  In the 1960s, with standard mainframe customers can create business applications that really did not require specialized hardware or software.  In 1964, the introduction of the IBM System/360 (or S/360) signified the beginning of the 3G: first general-purpose computers. 3.4 TIME SHARING Time sharing means to share time into multiple slots in several processes. Time sharing system allowing multiple clients for getting access to specific system resources at once from different remotely locations and it is a logical extension of multi programming system. In this technique, time of single processor is shared in among of multiple users over the entire network system simultaneously. Time sharing Operating system delivers direct access to multiple users while splitting CPU time in among all users according to schedule system, and this operating system assigns set of time for every user. When this time slot gets time out session then it 43 CU IDOL SELF LEARNING MATERIAL (SLM)

forwards own control to further user over this system. The time slot is getting very small and all users are provided various impression which they contain own CPU as sole owner of CPU. This small frame of time duration where all users grab attention of CPU, it is called the “Time Slice or Quantum “. Figure 3.2: Time sharing systems 44 Advantages of Time Sharing of Operating System  It delivers quick response.  Every task makes same opportunity.  Easy to use and user friendly  It helps to increase performance of entire system.  Multiple applications can be run at once.  More efficient and convenient to use  It eliminates replication of software.  Interactive computing  Decrease paper work  It decreases CPU idle time. CU IDOL SELF LEARNING MATERIAL (SLM)

Disadvantages of Time-Sharing Operating System  Time sharing has problem of reliability.  Less security and integrity data and user programs  Issue of data communication  It consumes much system resources.  Hang up problem, so it must have higher specification hardware components because there are lot of users and other applications working at once. Examples  UNIX  Multics  Linux  Windows 2000 server  Windows NT server 3.5 MULTIPROCESSING SYSTEMS A computer’s capability to process more than one task simultaneously is called multiprocessing. A multiprocessing operating system is capable of running many programs simultaneously, and most modern network operating systems (NOSs) support multiprocessing. These operating systems include Windows NT, 2000, XP, and UNIX. Although UNIX is one of the most widely used multiprocessing systems, there are others. For many years, OS/2 has been the choice for high-end workstations. OS/2 has been a standard operating system for businesses running complex computer programs from IBM. It is a powerful system, employs a nice graphical interface, and can also run programs written for DOS and Windows. However, OS/2 never really caught on for PCs. The main reason why multiprocessing is more complicated than single-processing is that their operating systems are responsible for allocating resources to competing processes in a controlled environment. 45 CU IDOL SELF LEARNING MATERIAL (SLM)

With the growth of commercial networks, the practice of using multiple processors in embedded motherboard designs has become almost universal. Not too long ago, clients or network administrators constructed most multiprocessing configurations at the board or system level themselves. Today, motherboards are available incorporating multiple microprocessors on the same die. A multiprocessing system uses more than one processor to process any given workload, increasing the performance of a system’s application environment beyond that of a single processor’s capability. This permits tuning of the server network’s performance, to yield the required functionality. As described in Chapter 2, \"Server Availability,\" this feature is known as scalability, and is the most important aspect of multiprocessing system architectures. Scalable system architecture allows network administrators to tune a server network’s performance based on the number of processing nodes required. Collections of processors arranged in a loosely coupled configuration and interacting with each other over a communication channel have been the most common multiprocessor architecture. Figure 3.3: Time sharing systems Multiprocessing Features Dual-processor systems are designed for use exclusively with dual-processor motherboards, fitted with either one or two sockets. Multiprocessor systems usually have room on the board for four or more processors, although no minimum requirement exists. Xeon MPs are not 46 CU IDOL SELF LEARNING MATERIAL (SLM)

designed for dual-processor environments due to specific features of their architecture, and as such, are more expensive. Dual processors were developed to function at higher clock speeds than multiprocessors, making them more efficient at handling high-speed mathematical computations. Multiprocessors are designed to work together in handling large databases and business transactions. When several multiprocessors are working as a group, even at slower clock speeds, they outperform their DP cousins. Although the NOS is capable of running multiprocessor systems using Symmetrical Multi-Processing (SMP), it must be configured to do so. Simply adding another processor to the motherboard without properly configuring the NOS may result in the system ignoring the additional processor altogether. Types of MPs Various categories of multiprocessing systems can be identified. They include  Shared nothing (pure cluster)  Shared disks  Shared memory cluster (SMC)  Shared memory 3.6 MULTI-PROGRAMMING SYSTEMS In the multi-programming system, one or multiple programs can be loaded into its main memory for getting to execute. It is capable only one program or process to get CPU for executes for their instructions, and other programs wait for getting their turn. Main goal of using of multiprogramming system is overcome issue of underutilization of CPU and primary memory. Main objective of multiprogramming is to manage entire resources of the system. The primary components of multiprogramming system are command processor, file system, I/O control system, and transient area. So, multiprogramming operating system is designed based on this principle that sub segmenting parts of transient area to store individual programs, and then resource management routines are attached with basic function of operating system. 47 CU IDOL SELF LEARNING MATERIAL (SLM)

In the multiprogramming system, multiple users can perform their tasks concurrently, and it can be stored into main memory. CPU has ability to deliver time to several programs while sitting in idle mode, when one is getting engage along with I/O operations. Figure 3.4: Time sharing systems Advantages of Multiprogramming Operating System  TO increase CPU utilization and it never gets idle.  Resources are utilized smartly.  Less response times  Short time jobs are done fastest compare to long time jobs.  Multiple users can use multiprogramming system at once.  It can help to execute multiple tasks in single application at same time duration.  It can help to improve turnaround time for short jobs.  It reduces total read time that is required to execute a job.  Multiprogramming system helps to optimize total job throughput of computer.  Multiprogramming system can monitor fastest as entire tasks run in parallel. 48 CU IDOL SELF LEARNING MATERIAL (SLM)

Disadvantages of Multiprogramming System Here, few limitations of multiprogramming operating system; such as –  CPU scheduling is needed.  Memory management is required because all types of jobs are stored in the main memory.  If, it contains massive load of jobs then its long-time jobs have to need long waiting time.  Harder task is to manage of all processes and jobs.  It is highly complex and sophisticated. 3.7 MULTITHREADING OPERATING SYSTEM A thread is a path which is followed during a program’s execution. Majority of programs written now a days run as a single thread. Let’s say, for example a program is not capable of reading keystrokes while making drawings. These tasks cannot be executed by the program at the same time. This problem can be solved through multitasking so that two or more tasks can be executed simultaneously. Multitasking is of two types: Processor based and thread based. Processor based multitasking is totally managed by the OS, however multitasking through multithreading can be controlled by the programmer to some extent. The concept of multi-threading needs proper understanding of these two terms – a process and a thread. A process is a program being executed. A process can be further divided into independent units known as threads. A thread is like a small light-weight process within a process. Or we can say a collection of threads is what is known as a process. As we have two types of thread i.e., user-level thread and kernel-level thread. So, for these threads to function together there must exist a relationship between them. This relation is established by using Multithreading Models. There are three common ways of establishing this relationship. 49 CU IDOL SELF LEARNING MATERIAL (SLM)

Figure 3.5: Thread model 1. Many-to-One Model 2. One-to-One Model 3. Many-to-Many Model Figure 3.6: Thread Relationship Benefits of Multithreading 1. Resource sharing: As the threads can share the memory and resources of any process it allows any application to perform multiple activities inside the same address space. 50 CU IDOL SELF LEARNING MATERIAL (SLM)


Like this book? You can publish your book online for free in a few minutes!
Create your own flipbook