Notes of Operating System

Embed Size (px)

Citation preview

  • 8/6/2019 Notes of Operating System

    1/37

    Created by Mr.Manga Page 1 of 37

    Chapter 1Introduction to Operating System.

    As we know that there are Many Hardwares and Softwares those are attachedwith the System. So for Performing any Operations both Software andHardware are Mandatory. So that For Communication between the Softwareand Hardware, Operating System is used. Operating System is that whichinteract with the software and the hardware. The Software is the Non-Touchable Parts of theComputer , and Softwaresare those which are used for

    Performing an Operation Sothat Softwares are just usedfor Making an Application

    but hardwares are thosewhich are used for Performing an Operation .For Example if we want toPerform Some Paintings on the Screen, t

    hen we must use the ApplicationSoftware as Paint and Hardware as a Mouse for Drawing an Object. But howthe System knows what to do when Mouse Moves on the Screen and When theMouse Draws a Line on the System so that Operating System is Necessarywhich Interact between or which Communicates with the Hardware and theSoftware. For Better understanding you can see the Working of the OperatingSystem .

    So we can say that the Operating System have the Following Characteristics:-1) Operating System is a Collection of Programs those are Responsible for

    the Execution of other Programs.2) Operating System is that which Responsible is for Controlling all the

    Input and Output Devices those are connected to the System.3) Operating System is that which Responsible is for Running all the

    Application Softwares.4) Operating System is that which Provides Scheduling to the Various

    Processes Means Allocates the Memory to various Process those Wantsto Execute.

    5) Operating System is that which provides the Communication between theuser and the System.

    6) Operating System is Stored into the BIOS Means in the Basic Input andOutput System means when a user Starts his System then this will Readall the instructions those are Necessary for Executing the System Meansfor Running the Operating System, Operating System Must be Loadedinto the Computer For this, this will use the Floppy or Hard Disks WhichStores the Operating System.

    Brief History of Computers

  • 8/6/2019 Notes of Operating System

    2/37

    Created by Mr.Manga Page 2 of 37

    As we know that the humane always needs Some Changings in theEnvironment in which they are working So that we can also say Necessity isMother of invention because the demands of the humane are now growing and

    they wants to built Some Fast and calculating devices means they wants todevelop the Huge Size of Computer to Small Size Computer. There are manycomputers developed and they also use the Different Technology in Compareto other Computers. Some Examples of Computers those have been developedare as followings:-

    Note : This is also called as the Zeros Generation Computers because they usesSome Mechanical Techniques Means at that time there is no Spe

    cific Manner to Compute the Computation and at that Time the Computer just uses the SomeGeneral things For Example Wooden Frames. Wheels and also Some gears etc.

    1) ABACUS: This Computer is developed in the China and this Computer is used for Mathematical Operations.

    2) Napier Bones: This Computer is developed by the John Napier and thisComputer contains Some Wooden boards and the small Beads those arealso called as the small bolls those are used for calculation and this alsouses the Strips or Some Rows for Counting.

    3) Babbage Engine: The Charles Babbage which is also known as theFather of Computer also has made the Modern Computer which is alsoused for performing all the Calculations and the Computer was developedin the Cambridge University. And he was the Professor of Mathematics.

    4) First Computer Programmer (Lady Augusta ADA): The First Lady or

    First Computer Programmer which Translate the Computer Language of Babbage into the English form.

    5) ENIAC:- The Electrical Numerical Integrator and Calculator Machine ,is the name if First Generation Computer which uses the Vacuum Tubeswhich consume 20 by 40 Square Feet Large Room For Operating. Andthis Computer was developed in the Moore School of Pennsylvania. Butit operates on Limited Information and this is very difficult to detect the

    Errors.6) EDSAC: The Electronic Delay Storage Automatic Calculator was the

    first Computer which is used for Storing the Instructions those are given by the user and the EDSAC Computer was used for taking input from theTapes and also Stores the Results on the Media.

    7) UNIVAC-I: This Computer was developed by Eckert and Mauchly in1952 and this Computer was developed in the 1952 and this Computer was developed in the USA. And this Computer was developed for

    processing the Commercial Data.

  • 8/6/2019 Notes of Operating System

    3/37

    Created by Mr.Manga Page 3 of 37

    8) MARK I : The Mark-I Computer is also called as the AutomaticSequence Control Calculator and this Computer is designed by the

    Howard in the Howard University and with the Collaboration of IBM or International Business Machines. And these Machines were also used for performing the Mathematical Operations.

    9) Von Neumann : This is the Name of Mathematician which gives the ideaof Storing the data into the Computers and the idea was that Computer first Process the data and then Store into his Memory for Displaying andwhen a user Enters Some data then that data is Stored into s

    ome Place of Computer for Processings

    The term Generation is used which distinguish the various techniques thosehave already been developed. :-

    Generation of ComputersGenerations of Computer Specifies the Changings those Comes Time ByTime. Or we can say Generations Refers to the Changes those are occurred inthe Technology of the Computers. The Generations also Specifies theChangings those are made by modifying the Previous Systems. All theGenerations of the Computer are Classified into the Five Categories those areas followings:-

    1) First Generation: The First Generation Computers are developed in1947 and those Computers are used up to 1955. The Computers of FirstGenerations use the Vacuum tubes these tubes are Made up of Glass .andthese Computers just perform the Addition and Multiplication of

    Numbers and these Computers consumes lots of power and theseComputers generates lots of heat. Because there are 18,000 vacuum tubesthose are used in these Computers. So that they are also big in Size andConsumes lots of Power of Lights and they have only the LimitedOperations that they can Performed. And these Computers are also knownas the ENIAC or Electronic Numerical Integrator and Calculator Computers. And they are used for just Performing the two Operationsfirst Sum and second the Multiplication. And For Addition they uses the200 microseconds and 2000 micros seconds will be used for Performing

    the Product on Two Numbers. But those Computers are Not Used manyTimes because the Size of those computers is very large and thoseComputers Consumes a Large Size Room. The Main advantage anddisadvantages of the First generation Computers are as follows-

    Advantages are :-1) Vacuum Tubes are used for Storage and Calculations.

    2) The Concept of Stored Programs has been developed.

  • 8/6/2019 Notes of Operating System

    4/37

    Created by Mr.Manga Page 4 of 37

    3) Perform all the Mathematical Operations like addition, Multiplication,

    Subtraction etc. at a high speed and they were the fast calculating

    machines at that time.Limitations of First Generations.1) They have a Huge Size , they consumes a Large Room to setup.

    2) Near About 18,000 Vacuum tubes were used for Computations.

    3) Have a Great Possibility of failure.

    4) Maintenance Cost of those Computers was very high.

    2) Second Generation: The Second Generations Com

    puters are designed inthe 1951 and in the Second Generation, The Technology of theComputers has changed and they use the or transistors instead of Vacuumtubes. The Transistors are made up of silicon Materials or aluminum. TheMai Advantage of these dives is that they have the smaller size incompare to the other devices but these devices so cheaper and theyconsume small amount of Space and Heat in Compares to the Vacuum

    tubes.So that the Size of those Computers becomes less and reduces in compare tothe First Generation Computer.

    Advantages of Second Generation Computers 1) Have the Greater Speed.

    2) Consume Less Electricity and Less heat Generated.

    3) Small size in Compare to First Generation.

    4) Better Portability.

    5) Takes Milliseconds instead of microseconds.

    6) Less Chances of Hardware Failure.

    Limitation of Second Generation Computers:-1) For Placing Many Vacuum Tubes Some Special Unit is required.

    2) Chances of Damage are more because Many Vacuum Tubes are placedon the Single Chip.

    3) Maintenance required for performing day to day Activities.

    c) Third Generation Computers: The Third Generation Computers aredesigned in the 1960 and the technology also has been changed from transistorsto Resisters. There are Many Transistors those are integrated into the Single

    Chip which is also known as the Registers and there are Many Registers thoseare placed onto the Single Motherboard. There are Many Circuit Elements

  • 8/6/2019 Notes of Operating System

    5/37

    Created by Mr.Manga Page 5 of 37

    those are integrated into the Single Chip which are also known as the ICs. Andthousands of Transistors are placed on the Single Chip which is also known asthe IC chip or Small Scale Integration Chip.

    Advantages of Third Generation Computers:-1) Less Amount of heat has generated.

    2) Cost of Maintenance is Lowe in Compare to the first and second

    generation Computers.

    3) Smaller in the Size and have More Reliability.

    4) These Computers can perform many Operations.

    5) They are used for general Purpose. And they are also used in a

    ll Types of Works.

    6) They have more speed and they consume less Amount of Heat and they

    have the more Operating Speed.

    7) Have a Large Memory Area for Storing the Data and Results after the

    Processing.

    Limitation of Third Generation Computers:-1) Require Some Advanced Techniques to develop these types of

    Computers.

    2) Requires also some Controls those are also called as the Temperature

    Control. As there are Many Enhancements performed into the Technique

    so that this will also leads to the increasing the Cost of Purchasing.

    3) Requires highly Maintenance.

    Fourth Generation Computers.The Fourth generation Computers were brings the new Technology and

    them also uses the Chips but the Integration of Circuits were high Means now itis Possible to Integrate the 30,000 Circuits on the Single Chip. That was alsocalled as the Small Scale Integration but with the advent of fourth generationComputers it is Possible to integrate the 10,000, 0000, 000 Circuits of Registerson the Single Chip. And this Technology is also called as the LSI or LargeScale integration. The Size of the Computers now has reduced and the Speed of Processing is also high. And these Computers bring the Revolution in theTechnology of the Computers. And they have also called as high Speedcalculation Machines.

    Advantages of the Fourth Generation Computers:-1) They have the Reduced Size in Compare to the other Computers.

    2) They have designed for the General Purpose Works.

  • 8/6/2019 Notes of Operating System

    6/37

    Created by Mr.Manga Page 6 of 37

    3) The Chances of Failure are now few.

    4) The Speed of Production is high and they have More Processing Power in

    compare to the Other Generation Computers.5) The Cost of these Computers are also less in compare to the Other

    Computers.

    Limitation of Fourth Generation Computers :-1) They Have designed for the All the General Purposes and they requires

    higher Maintenance for Processing.

  • 8/6/2019 Notes of Operating System

    7/37

    Created by Mr.Manga Page 7 of 37

    The Fifth Generation ComputersAs we know Computers never think like a Human. But the Computers just

    perform all the Instructions one by one. And the Computers have lack of

    imagination and they have lack of logics. So that the Computers those willthink and see like humans are going to be developed. So that the FifthGeneration Computers are going to be Developed but they are not alreadydeveloped. The Fifth Generation Computers have KIPS means Knowledgeinformation Processing System means they will also gives us the Informationafter the Processing means they will also gives us Some information after Processing. And they will also call as the data or logic information processingSystem.

    Concept of Computer Languages: For Performing O

    perations on theMachines we use Some Programs those are also called as the Softwares. Andthere are various types of Software those are used for performing the Activitiesand the Softwares are made by using Some Computer Languages those arealso called as the Programming Languages.

    Software : The Software are the non Touchable Parts those are used for Performing the Operations and a user cant touch them he just use them for Processing. And the Softwares are also known as the Collections of theinstructions, and the Softwares are also called as the Application and SystemSoftwares.

    Application Softwares: The Application Softwares are those which are usedfor making an Application or they are used for Preparing any Document For Example Paint is used for Making Some Pictures and the Ms Word is Used for Making Documents. So that Application Softwares are used for Making or

    Designing the Special Applications. Some Examples of Application Softwaresare as below:-

    1) Word Processor: Which is also known as Ms-Word or any Processor which Process the data which is written by the user. And the WordProcessors are used for Changing the Size of the Text, Colors of the Textand also changing the Alignment of text.

    2) Spread Sheet: Generally known as Ms-Excel which is used for storingthe data of the user into the form of Rows and Columns.

    3) Database Softwares: Used for storing the data of the user in the Formof Tables.

    4) Graphics Packages: used for making some Models and Design before processing and they are used for Making Some Design Objects.

  • 8/6/2019 Notes of Operating System

    8/37

    Created by Mr.Manga Page 8 of 37

    5) Anti-virus Softwares: These Softwares are used for protecting theComputer Systems from the Virus. And the Anti virus Softwares is usedfor removing the unwanted data from the Computer Systems.

    System Software: The System Softwares are those which are used for Operating Other Application Softwares. Means if we wants to use anyApplication Software then this is must that our Computer Must have a SystemSoftware For Example Windows. The Windows are also called as the SystemSoftware because if our Computer contains a window then we can run.

    Language Translators:As we know that the Computer Understands the Machine or Bina

    ry Language

    but a Human Language is also known as the English Language. So that we usethe Language Translators those are used for Changing the Human Languageinto the Machine Language. And the Language Translator also detects SomeErrors those are occurred in the Programs. There are two Types of LanguageTranslators those are Explained below:-

    1) Compilers: The Compilers are those which translate the Entire Programinto the Machine Program and also Display the Errors those are occurredin the Code Writing and All the Errors those are contained into theProgram will be displayed at the end of the Program.

    2) Interpreter: The Interpreter is same like a Compiler; the Interpreter isthat which Translate the Humane Language into the Machine Language

    by using Single Statement and the Interpreter will display the Error Messages one by one. But the Interpreter will Consumes the Lots of Timefor Translation in Compare to the Compiler.

    Chapter - 2Computer Architecture

    The Computer Architecture is related with the Integration of the InternalParts of the Computer System, the Architecture is also called as theStructure of the Computer System. The Architecture defines how the variousElements of Computer are linked with each other. When the user entersSome data for Processing then this is the Computer Architecture whichidentify how the Input will goes to the Computer System and how the

    Results will be Displayed After the Processing. So the Architecture is alsocalled as the Structure of the Elements of the Computer System.There are Many Elements those are used while performing any Operation onthe System. Among of them Some Buses are very popular. The Buses arevery useful which provides the flow of the data from one Register to another Register.

    When a user Enter Some Data For Processing then the data is first storedin the Memory of the Computer System and For Processing on the data , that

    data must be brought into the Registers so that a Computer can perform thevarious Operations on the database.

  • 8/6/2019 Notes of Operating System

    9/37

    Created by Mr.Manga Page 9 of 37

    The Input which is given by the user is also stored into the Registers. TheRegisters are useful for performing the Operations on the data. When theInput is given then that Input is Stored into the Registers. There are Many

    Types of Registers and the Elements those are included in the Architectureor those are used when we are performing the Operations on the System.1) Memory Buffer Register: This Register is very useful and this Register is

    used for Storing the Results in the Temporary Manner So that WhileProcessing on the data then the Produced Results are also Stored into theRegisters because that data Might be used Later by the System.

    2) Program Counter: This Register is also used for controlling the Number of Programs those are running on the System and the Progr

    am Counter gets Automatically Increment by one when a new Program will start andthe Counter will decrease its value automatically when a Program will beclosed.

    3) Memory Address Register: The Memory Address Register is used for Taking the Data or Instructions from the Memory to the Cache Memoryor in the Memory. Because if we wants to Perform Execution on the Datathen that data must be Brought into the Memory of the computer System.

    4) Cache Memory: The Cache Memory is the Memory which Resides between the Processor and the Main Memory and the Cache Memory isused for storing the Data which is useful and which is used by the CPU atthe Time of Processing. So that data which is necessary for the CPU andthe data which is recently used will be Stored into the Cache Memory.

    Always remember that all the Elements of the System are interconnectedMeans the Data which is the Input for the First Elements will be the Output for the Second and the Output of the Element may be the Input for the Another Element.The Process for Reading the data and Writing the Data into the Memory.

    1) When the User Wants to Read the data from the Computer System thenthe Memory Address Register will store the Address of the Memoryfrom System. Then the Memory Data Register will Read all the contentsfrom that Memory Address.

    2) When the data will be Read by the Register, then that data will be Storedinto the Main Memory of the Computer System.

    3) After that The System will Display the Data on the users Terminalmeans on the Screen of user Computer. Always Remember the data

    which is Displayed on the Computer System will also be Stored in theCache Memory. Which is just placed between the Processor and theMain Memory. So that When the Request will be goes for Reading thedata, then data will also be stored in the Cache Memory because that datamay also be Used Later by the user and that data may also be used for further Processing.

    Concept of Direct Memory Access: DMA is the concept which is usedfor Reading the data without the help of CPU. When a user wants to read anydata from the Computer System, then the Request will goes to the CPU andafter that CPU will read the data and Stores that data into his Memory and after

  • 8/6/2019 Notes of Operating System

    10/37

    Created by Mr.Manga Page 10 of 37

    that data will be Displayed But with the help of the DMA we can Access thedata of the Computer System without the CPU.

    In this user will Request for the Bus to the CPU and then the CPU will

    provides the Control on the Bus for Reading the contents of the system to theuser directly and we can say that the CPU will Release his control on the Bus.So that there will be the Direct Access Mechanism between the Bus and theUser Means the Data which is Requested by the User will Accessible to theuser without the user Intervention. The Main Advantage of using the DMA isthat this will increase the Speed of Processing. Because there will be no Role of the CPU between the Data and the computer System.

    Introduction to Computer Programming Langu

    ages

    As we know that there are Many Programming Languages developed and eachLanguage have its Different Purpose. Programming Languages are used for Making Some Softwares those may be a Application or any system Software.And a Program Generally Contains the instructions those are Executed in theForm of Sequence. All the Programming Languages also Developed in theForm of Some Generations those are as Explained below:-

    1) 1 GL or Machine Language : This is also called as the First GenerationComputer Languages. And in these Machine Languages has developed.The Machine Language Programs contains all the instructions in theBinary Form and we know that the Program which has written into theMachine Language are easily understandable. So that it is very difficult tounderstand because all the instructions are written into the Form of 0 and1 So that the Instructions those are written into the 0 and 1 are verydifficult To understand. But the Main Advantage is that this is very easyfor the Computer and this will also increase the Speed of Processing of the Computer System.

    2) 2 GL or Assembly Language: As We know that the Program whish isWritten into the Machine Language are very difficult to understand for the user So that there is the Development of the new ProgrammingLanguage which is also known as the second Generation LanguageWhich is also known as the Assembly Language and in the AssemblyLanguage there are Many Mnemonics those are also Called as theReserve Words those are easy to understand to the users and those haveSome Specific Meaning. In the Assembly Language the Programs are

    written into the Form of some Words those are Machine Oriented Manswhich have the Specific Meaning and the Words those are Easilyunderstand by the Machine Language. But the Words are not MachineLanguage Oriented Means the Words are Just the English LanguageForms so that they are not easily understand by the Machine and we musthave to convert the Words of the Assembly Language into the MachineLanguage and For Converting the Assembly Language into the MachineLanguage we must uses the Assembler. Which Converts the WholeProgram which is written into the Assembly Language into the MachineLanguage.

  • 8/6/2019 Notes of Operating System

    11/37

    Created by Mr.Manga Page 11 of 37

    3) 3 GL or Some High Level Languages : Due to the Development of theAssembly Language and the Mnemonics there is also the newdevelopment of Some High Level Languages those are used for Making

    the Programs. There are Many High Level Programming Languages hasdeveloped at that Time which Contains the Java, c C++ , LOGO etc .Allthe High Level Programming Languages are User Friendly means theSyntax of theses Languages is Quite Simple because they Contains all theWords those are in the Form of English Language.

    But the Main Problem is that they are not Machine Oriented Means theProgram which is written into the High Level Languages is not understand bythe Computer So that the Program Must be Converted into

    the MachineLanguage and the Program which is Written into the Human Language willcause the Computer in Slow of Processing.

    4) 4 GL Program: The Fourth Generation Language is not has beendeveloped yet. The Fourth Generation will also be the Some High LevelLanguage which contains the Set of Instructions those are fewer and thosewill be Understandable to the user. And the Programs those will bewritten into the 4GL will also be easier to understand and also containsSome Language Translator for Converting the High Level Languages intothe Machine Languages.

    Always remember that the Programming Languages are also developed byseeing the Programming Environment in which we are Working Means theLanguages are also developed by using Some Environments. The Benefit andadvantage of any Programming Language will be set According to theEnvironment in which we are working. Mostly in Todays Environment MultiComputers are connected with Each other and they are designed for Sharing the

    Other resources those re stored on the other computers so that now the programming languages are designed as they can be used in the networkingenvironment.

    Introduction to the Language TranslatorsThere are Many language Translators those are developed for Converting oneComputer Language into the another Languages. As we know that there are SoMany Languages those are Developed for the users . But he Programs those areWritten into the Human languages must be Converted into the Machine

    Language. So that there are also come Softwares those are called as thelanguage Translator. The Main Purpose to use the language Translator is toconvert the Human Language Program into the Machine language Program.There are basically two Softwares those are provided by the ProgrammingLanguages which we are using and these are also Known as the compilers andthe Interpreters.

    1) Compilers :- The Compilers are the Language Translators which Takesentire Program at a Time and then they convert the Human Program into theMachine program and this will also display the Errors Messages those areFound in the Program which is written by the users . . Every Language has its

  • 8/6/2019 Notes of Operating System

    12/37

    Created by Mr.Manga Page 12 of 37

    own Compiler which is used for Translating the Entire Code of the Human intothe Machine Code. But if we are using an Assembly Language then Assembler will be used for converting the Assembly Language program into the Machine

    Language Programs.Chapter -3

    Explain various Functions of Operating SystemThere are Many Functions those are Performed by the Operating System Butthe Main Goal of Operating System is to Provide the Interface between the user and the hardware Means Provides the Interface for Working on the System bythe user. The various Functions those are Performed by the Operating Systemare as Explained below:-

    1) Operating System as a Resource ManagerOperating System Also Known as the Resour

    ce Manager MeansOperating System will Manages all the Resources those are Attached to theSystem means all the Resource like Memory and Processor and all the Inputoutput Devices those are Attached to the System are Known as the Resourcesof the Computer System and the Operating system will Manage all theResources of the System. The Operating System will identify at which Timethe CPU will perform which Operation and in which Time the Memory is used

    by which Programs. And which Input Device will respond to which Request of the user means When the Input and Output Devices are used by the whichPrograms. So this will manage all the Resources those are attached to theComputer System.

    2 Storage Management: Operating System also Controls the all theStorage Operations means how the data or files will be Stored intothe computers and how the Files will be Accessed by the users etc.All the Operations those are Responsible for Storing and Accessingthe Files is determined by the Operating System Operating Systemalso Allows us Creation of Files, Creation of Directories andReading and Writing the data of Files and Directories and also Copythe contents of the Files and the Directories from One Place toAnother Place.

    3) Process Management : The Operating System also Treats the Process

    Management means all the Processes those are given by the user or theProcess those are System s own Process are Handled by the OperatingSystem . The Operating System will Create the Priorities foe the user andalso Start or Stops the Execution of the Process and Also Makes theChild Process after dividing the Large Processes into the SmallProcesses.

    4) Memory Management: Operating System also Manages the Memory of

    the Computer System means Provide the Memory to the Process andAlso Deallocate the Memory from the Process. And also defines that if a

  • 8/6/2019 Notes of Operating System

    13/37

    Created by Mr.Manga Page 13 of 37

    Process gets completed then this will deallocate the Memory from theProcesses.

    5) Extended Machine : Operating System also behaves like an ExtendedMachine means Operating system also Provides us Sharing of Files between Multiple Users, also Provides Some Graphical Environmentsand also Provides Various Languages for Communications and alsoProvides Many Complex Operations like using Many Hardwares andSoftwares.

    6) Mastermind: Operating System also performs Many Func

    tions and for those Reasons we can say that Operating System is a Mastermind. It

    provides Booting without an Operating System and Provides Facility toincrease the Logical Memory of the Computer System by using thePhysical Memory of the Computer System and also provides variousTypes of Formats Like NTFS and FAT File Systems. And OperatingSystem also controls the Errors those have been Occurred into theProgram and Also Provides Recovery of the System when the Systemgets Damaged Means When due to Some Hardware Failure , if SystemDoesnt Works properly then this Recover the System and also Correctthe System and also Provides us the Backup Facility. And OperatingSystem also breaks the large program into the Smaller Programs those arealso called as the threads. And execute those threads one by one.

    Concept of Multi Computers and Cache MemoryMulti Computers: Multi Computers are those which are connected with

    each other. For Performing any Operations they are Combined With each other For Example in a Network all the Computers are Connected With each other So that if a Computer wants to Perform any Work then he will Request to theanother Computer so that A Network is also called as Collection of MultiComputers .

    Cache Memory : The Cache Memory is the Memory which is verynearest to the CPU , all the Recent Instructions are Stored into the CacheMemory. The Cache Memory is attached for storing the input which is given

    by the user and which is necessary for the CPU to Perform a Task. But the

    Capacity of the Cache Memory is too low in compare to Memory and HardDisk.

    Process of Booting.Booting: When we start our Computer then there is an operation which is

    performed automatically by the Computer which is also called as Booting. Inthe Booting, System will check all the hardware and Software those areinstalled on the System and this is will also load all the Files those are neededfor running a system.

    There are two Types of Booting

  • 8/6/2019 Notes of Operating System

    14/37

    Created by Mr.Manga Page 14 of 37

    1) Warm Booting: when the System Starts from the Starting or from initialState Means when we Starts our System this is called as warm Booting.

    2) Cold Booting: The Cold Booting is that in which System Automatically

    Starts when we are running the System, For Example due to LightFluctuation the system will Automatically Restarts So that in thisChances of system are More.

    Concept of System call As we know that for performing any Operation as user must have to specify theOperation which he wants to Operate on the Computer. We can say that For Performing any Operation a user must have to Request for a Service from theSystem. For Making any Request a user will prepare a Specia

    l call which is

    also known as the System Call, The System Call is the Request for Runningany Program and for Performing any Operation on the System. When a user First Time Starts the System then the System is in the user Mode and When herequest For a Service then the User Mode will be Converted into the KernelMode Which just Listen the Request of the user and Process the Request andDisplay the Results those are Produced after the Processing. When a user Request for Opening any Folder or When a Moves his Mouse his Mouse on theScreen, then this is called as the System call which he is using for performing

    any Operation. Concept of Shell and Kernel Both the Shell and the Kernel are the Parts of this Operating System. TheseBoth Parts are used for performing any Operation on the System. When a user gives his Command for Performing Any Operation, then the Request Will goesto the Shell Parts, The Shell Parts is also called as the Interpreter whichtranslate the Human Program into the Machine Language and then the Requestwill be transferred to the Kernel. So that Shell is just called as the interpreter of

    the Commands which Converts the Request of the User into the MachineLanguage.Kernel is also called as the heart of the Operating System and the Every

    Operation is performed by using the Kernel , When the Kernel Receives theRequest from the Shell then this will Process the Request and Display theResults on the Screen. The various Types of Operations those are Performed bythe Kernel are as followings:-

    1) It Controls the State the Process Means it checks whether the Process isrunning or Process is Waiting for the Request of the user.

    2) Provides the Memory for the Processes those are Running on the SystemMeans Kernel Runs the Allocation and De-allocation Process , FirstWhen we Request for the service then the Kernel will Provides theMemory to the Process and after that he also Release the Memory whichis Given to a Process.

    3) The Kernel also Maintains a Time table for all the Processes those areRunning Means the Kernel also Prepare the Schedule Time means thiswill Provide the Time to various Process of the CPU and the Kernel also

    Puts the Waiting and Suspended Jobs into the different Memory Area.

  • 8/6/2019 Notes of Operating System

    15/37

    Created by Mr.Manga Page 15 of 37

    4) When a Kernel determines that the Logical Memory doesnt fit to Storethe Programs. Then he uses the Concept of the Physical Memory whichWill Stores the Programs into Temporary Manner. Means the Physical

    Memory of the System can be used as Temporary Memory.5) Kernel also maintains all the files those are Stored into the Computer

    System and the Kernel Also Stores all the Files into the System as no onecan read or Write the Files without any Permissions. So that the KernelSystem also Provides us the Facility to use the Passwords and also all theFiles are Stored into the Particular Manner.

    As we have learned there are Many Programs or Functions those are Performed by the Kernel But the Functions those are Performed by the Ker

    nel will never be Shown to the user. And the Functions of the Kernel are Transparent to theuser.

    Concept of Booting Booting : When we start our Computer then there is an operation which is

    performed automatically by the Computer which is also called as Booting. Inthe Booting, System will check all the hardwares and Softwares those areinstalled or Attached with the System and this will also load all the Files thoseare needed for running a system. In the Booting Process all the Files those areStored into the ROM Chip will also be Loaded for Running the System. In theBooting Process the System will read all the information from the Files thoseare Stored into the ROM Chip and the ROM chip will read all the instructionsthose are Stored into these Files. After the Booting of the System this willautomatically display all the information on the System. The Instructions thoseare necessary to Start the System will be read at the Time of Booting.

    There are two Types of Booting

    1) Warm Booting: when the System Starts from the Starting or from initial

    State Means when we Starts our System this is called as warm Booting. In

    the Warm Booting the System will be Started from its beginning State

    means first of all, the user will press the Power Button , then this will read

    all the instructions from the ROM and the Operating System will b

    Automatically gets loaded into the System.

    2) Cold Booting : The Cold Booting is that in which System Automatically

    Starts when we are Running the System, For Example due to Light

    Fluctuation the system will Automatically Restarts So that in this Chances

    Damaging of system are More. and the System will no be start from its

    initial State So May Some Files will b Damaged because they are not

    Properly Stored into the System.

  • 8/6/2019 Notes of Operating System

    16/37

    Created by Mr.Manga Page 16 of 37

    Types of Operating SystemThere are Many Operating Systems those have be Developed for Performingthe Operations those are Requested by the user. There are Many OperatingSystems which have the Capability to Perform the Requests those are Receivedfrom the System. The Operating system can perform a Single Operation andalso Multiple Operations at a Time. So there are Many types of Operatingsystems those are Organized by using their Working Techniques.

    1) Serial Processing : The Serial Processing Operating Systems are thosewhich Performs all the instructions into a Sequence M

    anner or theInstructions those are given by the user will be Executed by using theFIFO Manner means First in First Out. All the Instructions those areEntered First in the System will be Executed First and the Instructionsthose are Entered Later Will be Executed Later. For Running theInstructions the Program Counter is used which is used for Executing allthe Instructions. In this the Program Counter will determines whichinstruction is going to Execute and the Which instruction will be Executeafter this. Mainly the Punch Cards are used for this. In this all the Jobsare firstly Prepared and Stored on the Card and after that card will be

    Entered in the System and after that all the Instructions will be Executedone by One. But the Main Problem is that a user doesnt interact with theSystem while he is Working on the System , means the user cant be ableto enter the data for Execution.

    2) Batch Processing: The Batch Processing is Same as the SerialProcessing Technique. But in the Batch Processing Similar Types of jobsare Firstly Prepared and they are Stored on the Card . and that card will

    be Submit to the System for the Processing/. The System then Perform allthe Operations on the Instructions one by one. And a user cant be Able toSpecify any input. And Operating System will increments his ProgramCounter For Executing the Next Instruction. The Main Problem is thatthe Jobs those are Prepared For Execution must be the Same Type and if a job Requires for any type of Input then this will not be Possible for theuser. And Many Time will be Wasted for Preparing the Batch. The BatchContains the Jobs and all those jobs will be Executed without the user Intervention. And Operating System will use the LOAD and RUNOperation. This will first LOAD the Job from the Card and after that hewill Execute the instructions. By using the RUN Command. The Speedof the Processing the Job will be Depend on the Jobs and the Resultsthose are Produced by the System in difference of Time which is used for giving or Submit the Job and the Time which is used for Displaying theResults on the Screen.

    3) Multi-Programming : As e know that in the Batch Processing Systemthere are Multiple jobs Execute by the System. The System first prepare a

    batch and after that he will Execute all the jobs those are Stored into the

    Batch. But the Main Problem is that if a process or job requires an Inputand Output Operation , then it is not possible and second there will be the

  • 8/6/2019 Notes of Operating System

    17/37

    Created by Mr.Manga Page 17 of 37

    wastage of the Time when we are preparing the batch and the CPU willremain idle at that Time.

    But With the help of Multi programming we can Execute Multiple Programs onthe System at a Time and in the Multi-programming the CPU will never getidle, because with the help of Multi-Programming we can Execute ManyPrograms on the System and When we are Working with the Program then wecan also Submit the Second or Another Program for Running and the CPU willthen Execute the Second Program after the completion of the First Program.And in this we can also Specify our Input means a user can also interact withthe System. The Multi-programming Operating Systems never us

    e any cards because the Process are entered on the Spot by the user. But the OperatingSystem also use the Process of Allocation and De-allocation of the MemoryMeans he will provide the Memory Space to all the Running and all theWaiting Processes. There must be the Proper Management of all the RunningJobs.

    4) Real Time System : There is also a Operating System which is known asReal Time Processing System. In this Response Time is already fixed. Meanstime to Display the Results after Possessing has fixed by the Processor or CPU.Real Time System is used at those Places in which we Requires higher andTimely Response. These Types of Systems are used in Bomb and Reservation.So When we Specify the Request , the CPU will Perform at that Time. Thereare two Types of Real Time System

    1) Hard Real Time System : In the Hard Real Time System, Time is Fixedand We cant Change any Moments of the Time of Processing. MeansCPU will Process the data as we Enters the Data.

    2) Soft Real Time System. : In the Soft Real Time System , some Moments

    can be Change. Means after giving the Command to the CPU, CPUPerforms the Operation after a Microsecond.

    5) Distributed Operating System.- Distributed Means Data is Stored andProcessed on Multiple Locations. When a Data is stored on to the MultipleComputers, those are placed in Different Locations. Distributed means In the

    Network, Network Collections of Computers are connected with Each other.Then if we want to Take Some Data Fro other Computer, Then we uses the

    Distributed Processing System. And we can also Insert and Remove the Datafrom out Location to another Location. In this Data is shared between manyusers. And we can also Access all the Input and Output Devices are alsoaccessed by Multiple Users.

    6) Multiprocessing: Generally a Computer have a Single Processor means aComputer have a just one CPU for Processing the instructions. But if we areRunning multiple jobs, then this will decrease the Speed of CPU. For Increasing the Speed of Processing then we uses the Multiprocessing, in theMulti Processing there are two or More CPU in a Single Operating System if one CPU will fail, then other CPU is used for providing backup to the first

  • 8/6/2019 Notes of Operating System

    18/37

    Created by Mr.Manga Page 18 of 37

    CPU. With the help of Multi-processing, we can Execute Many Jobs at a Time.All the Operations are divided into the Number of CPUs. if first CPUCompleted his Work before the Second CPU, then the Work of Second CPU

    will be divided into the First and Second.

    Chapter 4 :Information Management.

    Concept of Disk Scheduling Disk Scheduling: As we know that on a single Computer w

    e can PerformMany Operations at a Time so that Management is also necessary on all theRunning Processes those are running on the System at a Time. With the help or Advent of the Multi-programming we can Execute Many Programs at a Time.So fir Controlling and providing the Memory to all the Processes OperatingSystem uses the Concept of Disk Scheduling.

    In this the Time of CPU is divided into the various Processes and alsodetermines that all the processes will Work Properly. So that Disk SchedulingWill Specifies that at which time which Process will be executed by the CPU.

    So that the Scheduling means to Execute all the Processes those are given to aCPU at a Time. The Scheduling is used for Divide the Total Time of the CPU between the Number or Processes So that the Processes can executeConcurrently at a Single Time. For Sharing the Time or For Dividing the TotalTime of the CPU, the CPU uses the following the Scheduling Techniques.

    1) FCFC or First Come First Serve: In this Jobs or Processes are Executed inthe Manner in which they are entered into the Computer. In this OperatingSystem Creates a Queue which contains the Sequence Order in which they areto be Executed and the Sequence in which the CPU will Execute the Process..In this all the Jobs are performed according to their Sequence Order as theyhave entered. In this the Job which had Requested first will firstly performed

    by the CPU. And the Jobs those are entered Later will be Executed in to their Entering Order.

    3) SSTF or Shortest Seek Time First :- in this Technique The OperatingSystem will Search for the Shortest time means this will search which jobwill takes a Less Time of CPU for Running. And After Examining all the

    jobs, all the Jobs are arranged in the Sequence wise or they are Organizedinto the Priority Order. The Priority of the Process will be the Total Timewhich a Process will use For Execution. The Shortest Seek Time WillInclude all the Time means Time to Enter and Time to Completion of theProcess. Means the Total Time which a Process Will Take For Execution.

    4) C-Scan Scheduling: - In the C-Scan all the Processes are Arranged by using

    Some Circular List. Circular List is that in which there is no start and end pointof the list means the End of the List is the Starting Point of the list. In the C-

  • 8/6/2019 Notes of Operating System

    19/37

    Created by Mr.Manga Page 19 of 37

    Scan Scheduling the CPU will search for the Process from Start to end and if an End has Found then this again start from the Starting Process. BecauseMany Times When a CPU is executing the processes then may a user wants to

    enter some data means a user wants to enter Some data So that at that Situationthe CPU will Again Execute that Process after the Input Operation. So that C-Scan Scheduling is used for Processing Same Processes again and Again.

    5) Look Scheduling : - In the Look Scheduling the CPU Scans the List fromStarting to End of the Disk in which the various Processes are Running and inthe Look Scheduling the CPU will Scan the Entire Disk from one End to theSecond end.

    6) Round Robin. : In the Round Robin Scheduling the Time of

    CPU isdivided into the Equal Numbers which is also called as Quantum Time.Each Process which is Request for Execution will Consumes the Equal

    Number of Times of the CPU and after the Quantum Time of FirstProcess, the CPU will automatically goes to the Next Process. But theMain Problem is that after the Completion of the Process the Time Willalso be Consumed by the Process. Means if a Process either or not haveSome Operations To perform the Time of CPU will also be Consume by

    the CPU , So this is the Wastage of the Time of the CPU.

    7) Priority Scheduling : In this Each Process have Some Priorities AssignTo them , Means each and Every Process will be Examined by using theTotal Time Which will be Consumed by the Process. The Total Time of the Process, and Number of times a Process needs Some Input and Outputand Number of Resources will be Examines to set the Priorities of theProcesses. So that all the Processes are Arranged into the Form of theseCriterias and After that they will be Processed by the CPU.

    8) Multilevel Queue: The Multilevel Queue is used when there are multiplequeues for the various different processes as we know that there are manydifferent types of Works those are to be performed on the Computers at aTime. So that for organizing the various or different Types of Queues theCPU Maintains the Queues by using this Technique. In this all the queuesare Collected and Organized in the Form of Some Functions which theyare requesting to perform. So that the various Types of Queues aremaintained which contains all the Processes which have Same Type.

    Concept of Files & Types of FilesFiles: As we know that Computers are used for storing the information

    for a Permanent Time or the Files are used for storing the Data of the users for a Long time Period. And the files can contains any type of information meansthey can Store the text, any Images or Pictures or any data in any Format. So

    that there must be Some Mechanism those are used for Storing the information,Accessing the information and also Performing Some Operations on the files.

  • 8/6/2019 Notes of Operating System

    20/37

    Created by Mr.Manga Page 20 of 37

    There are Many files which have their Owen Type and own names. Whenwe Store a File in the System, then we must have to specify the Name and theType of File. The Name of file will be any valid Name and Type means the

    application with the file has linked.So that we can say that Every File also has Some Type Means Every File belongs to Special Type of Application softwares. When we Provides a Nameto a File then we also specify the Extension of the File because a System willretrieve the Contents of the File into that Application Software. For Example if there is a File Which Contains Some Paintings then this will Opened into thePaint Software.

    There are Many Types of Files in the System

    1) Ordinary Files or Simple File: - Ordinary File m

    ay belong to any typeof Application for example notepad, paint, C Program, Songs etc. So allthe Files those are created by a user are Ordinary Files. Ordinary Files areused for Storing the information about the user Programs. With the helpof Ordinary Files we can store the information which contains text,database, any image or any other type of information.

    2) Directory files. : The Files those are Stored into the a Particular Directory or Folder. Then these are the Directory Files. Because they

    belongs to a Directory and they are Stored into a Directory or Folder. For Example a Folder Name Songs which Contains Many Songs So that allthe Files of Songs are known as Directory Files.

    3) Special Files. : The Special Files are those which are not created by theuser. Or The Files those are necessary to run a System. The Files those

    are created by the System. Means all the Files of an Operating System or Window, are refers to Special Files. There are Many Types of SpecialFiles, System Files, or windows Files, Input output Files. All the SystemFiles are Stored into the System by using. sys Extension.

    4) FIFO Files: The First in First Out Files are used by the System for Executing the Processes into Some Order. Means To Say the Files thoseare Come first, will be Executed First and the System Maintains a Order

    or Sequence Order. When a user Request for a Service from the System,then the Requests of the users are Arranged into Some Files and all theRequests of the System will be performed by the System by using SomeSequence Order in which they are Entered or we can say that all the filesor Requests those are Received from the users will be Executed by usingSome Order which is also called as First in First Out or FIFO order.

    Types of File OperationsFiles are not made for just reading the Contents, we can also Perform Someother operations on the Files those are Explained below As :-

  • 8/6/2019 Notes of Operating System

    21/37

    Created by Mr.Manga Page 21 of 37

    1) Read Operation: Meant To Read the information which is Stored into

    the Files.

    2) Write Operation: For inserting some new Contents into a File.3) Rename or Change the Name of File.

    4) Copy the File from one Location to another.

    5) Sorting or Arrange the Contents of File.

    6) Move or Cut the File from One Place to Another.

    7) Delete a File

    8) Execute Means to Run Means File Display Output.

    We can Also Link a File with any other File. T

    hese are also called as theSymbolic Links, in the Symbolic Links all the files are linked by using SomeText or Some Alias.

    When a User Clicks on the Special text or on the Alias then this will openthat Linked File. So that we can say that the Files are linked With each other by

    using Some Names and by using Some Locations.These are Also Called as the Symbolic Links and always remember thatwhen we remove the Link from the System then this will not effect on theActual file Means the Original File will be Kept Save into the Locations.

    Concept of File Sharing and Locking The Concept of File Sharing and Locking is used in the Multi-usersEnvironment, or in which there are many users those are Requesting for a

    Single File, to Perform Some Operations.So that with the help of File Sharing Many users can perform the Operations

    on the Single File. But there must be Some Mechanism which is used for Controlling the Access onto the Single File.

    File Locking is used when a Single User is Performing Operations on Thefile and other users cant be able to change the contents of the File. So thatthere are three types of Lock:-

    1) Read Only : This Lock is used when all the users are Reading theContents from the Single File and no one can be able to Change thecontents on the File.

    2) Linked shared: The Linked Shared Locked is used when there are manyusers working on a Single file. And when the various users are requestingto change the contents of the File then the Changings will perform on theFile by using some Linear Order.

    3) Exclusive Lock: This is very important Lock and in this when themultiple users are working on the Single File. Then the File will be

  • 8/6/2019 Notes of Operating System

    22/37

    Created by Mr.Manga Page 22 of 37

    locked when any user is going to Change the data of the file, TheChangings will be made by only the Single user and for the Other usersWill be Locked.

    File System Architecture and its TypesFile System: Files are used for storing the Information of the user; But Filesare organized into the System by using a Specific Manner. Generally for arranging all the Files, directories or Folders are used.

    A Folder is also called as the Container of the Files in which many Subdirectors and Files are Stored. But there is also a Access Method in which dataof the File will be accessed by the user.

    Means from which Location Information of the File will be A

    ccessible.There are various types of Storage Architectures which specify fro whichLocations. File will be Read and from which Locations Data will read and howthe data will be Read from the Files.

    There are three types of Attributes of the Files1) Read We can only read the data but we cant modify the Data of

    the File.

    2) Write We can also write the data and also Read the data

    3) Hidden File will not be shown to the user. But these will Remain

    Saved on the user Computer.

    There are two Types of Access in which Files are Read from the System1) Sequential2) Random.

    In the Sequential Method or Access Data of a file is Read from StartingPoint to the End Means if we wants to Read the Line then we must have toTravel all the Files. For Example if a File Contains 100 Lines and we wants toRead the 50 th Line then we must have to all the Lines all the Lines from 1 to 50.

    And In the Indexed File an index has maintained which Stores the Index or the Files which Contains the Address of the File, So that we can Read a Filefrom a Specific Location. For Example in our Books there is an index on theeFirst Page Which Will Stores all the Page Numbers of all the Topics and wecan jump to any Topic with the help of Index.

    The File System Architecture Specifies that how the Files will be stored intothe Computer system means how the Files will be Stored into the System.Means how the data of the user will be Stored into the Files and how we willAccess the data from the File. There are many types of Storage or Spaceallocation techniques which specify the Criteria by using; the Files will Storesthe data into them.

  • 8/6/2019 Notes of Operating System

    23/37

    Created by Mr.Manga Page 23 of 37

    1) Continues Space Allocations: - The Continues space allocation will beused for storing all the data into the Sequence Manner. Means all the datawill store by using the Single Memory Block. In this all the data of the

    File will be stored by using the Continues Memory of the Computer Systems. This makes fastest Accessing of data and this is used in theSequential Access.

    In this when System Finds out the First Address or base Address from the Setof Address of the Files, then this will makes easy for the System to read all thedata from the Computer Systems. But for Storing the Data into the ContinuesForms, CPU loss his Time because many Times Data any Large from theExisting Space. So that this will create Some Difficulties to find

    out the FreeSpace on the disk.

    2) Linked Allocation: - This Technique is widely used for storing thecontents into the System. In this the Space which is provided to the Filesmay not be in the Continuous Form and the Data of the Files will beStored into the Different blocks of the Disks. This Makes AccessingDifficult for the Processor. Because Operating System will Traverse allthe Different Locations and also use Some Jumping Mechanism for Reading the contents from the File in this the First Location will beaccessed and after that System will search for the other Locations. ButAlways Remember that all the Locations will be linked with Each other and all the Locations will be automatically traversed.

    3) Index Allocation: - This is also called as Some Advancement into theLinked Space Allocation. This is same as the Linked Space Allocation byit also maintains all the Disk Address into the Form of Indexes. As EveryBook Contains an index on the Front Page of the System Like this All the

    Disk Addresses are Maintained and stored into the Computer System andWhen a user Request To read the Contents of the File , then the WholeAddress will be used by the System by using the index numbers. For thisSystem also Maintains an index Table which contains the Entry for thedata and the Address Means in which Address, which Data has Stored Sothat this makes the Accessing Fastest and Easy for the Users.

    Arrangement of Files or Concept of directory Structure

    Files are used for storing the Information of the user. Generally for arrangingall the Files directories or Folders are used. A Folder or Directory is also calledas the Container of the Files in which many Sub directors and Files are Stored.So that Files System Specifies the Arrangement of the Files in the System.There are following Directory Structures Available for organizing all the Files,

    1) Hierarchical: In this all the Files are organized in the Form of Parent andChild Relationship. Means in this there is the Parent Directory whichContains all the sub Files,. For Example there is a Folder Which ContainsMany Sub Directories and their Files. So in this all the files are Stored inthe Parent and child Mode. And if we want to Access a Directory or a

  • 8/6/2019 Notes of Operating System

    24/37

    Created by Mr.Manga Page 24 of 37

    File then we must have to Move all the Parent Directories and files for better understanding see the Following Figures.

    Here Rohit is the Parent Directory or Top Most directory. And all Rajat andthe Microsoft are the Child Directories of this Parent Directory.

    Note: Rectangle denotes all Directories and Circles Represents Files.

    2) Single Level Directory : in this there is a single directory which containsall the Files into. But this is not the best way because all the Files areStored into the Single Folder So this is very difficult for a user to search aFile. There is Only one Directory Which contains the other files So thatMany times this is not used because this will Contains Huge Amount of Files and this will Makes difficult for the users to Locate or Find a File.

    3) Two Level Directories: in this a Directory also contains a Another Directory and all the Files are Organized into the Sub Directory. In theTwo Level a directory also Contains Sub Directory and the Files. Or we

    can say that a Single Directory will be the Container of Many other filesand the Directories So that When a user wants to Access any Directorythen he has To Travel all the other Directories and Files from thatDirectory.

    4) Acyclic Graph Directory: if a Directory Contains a Directory and Filesthen it is called as the Acyclic Directory in this a Single DirectoryContains Both Directory and Files and all the Directories are connectedwith some Paths Means a single Folder or File can be Accessible viaanother Files.

  • 8/6/2019 Notes of Operating System

    25/37

    Created by Mr.Manga Page 25 of 37

    In this each directory and a File is linked with one or more Directories and theFiles. When a Single File or directory can be reached from any Directory or from any File, then it is called as the Acyclic Directory. In the Acyclic Graph a

    Single File or a Directory can be Reached from any File because there areMultiple path Exists between that file. Or there are More Routs for that SingleFile or Directory.

    Chapter 5 Process Man

    agement Explain process: Any Operation or any Request for a Service is called as theProcess; Process May a Request for Moving the Mouse, reading the data fromthe File or Writing the data into the file, printing a Document or any work

    which is given by the user is known as the Process. We can also say a programwhich is requested by the user for the Execution is also known as the Process.

    There are Many Models which Watches the Processes and Which Describes theStates of the Processes means what is the state of the process, whether they arerunning, or whether they are requesting for the Input and output, all these will

    be determine with the help processing Models.

    A Single Process may also contain sub Processes those are also known asthe Child Process. So that we can say that a Process which is given to theSystem is also known as the Parent Process and all the other Parts of the SingleProcess are known as the Child Process. So that Every Process may alsoContains Some Child process. For Example if we are giving a Command toPrint the File, and if a Single File Contains 8 pages to print. Then there are 8small or child processes to print; and the Whole Process will be over when allof the 8 pages will be printed.

    When a user Request for a Service from the System, then theSystem Automatically initializes the Process by using the initial State and theSystem also provides the various types of input and output Resources to theProcess, Provides also Some Memory and also Control the Execution and AlsoControls the State of the Process. So that in the Execution of Process, wedoesnt implement only the Process creation but we also use the variousControlling Mechanism for the Process.

    There are Many Types of Operating Systems which executed the Processeither Single or Multiple Processes are executed at a Single time. And For

    Executing the Multiple Processes we must have to use Some ControllingMechanisms.

  • 8/6/2019 Notes of Operating System

    26/37

    Created by Mr.Manga Page 26 of 37

    Concept of Process SchedulingAs we know that we can perform many Programs at a Tim e on the Computer.But there is a Single CPU. So for running all the Programs concurrently or simultaneously. Then we use the Scheduling. Processes are the Small Programsthose are executed by the user according to their Request. CPU Executes all theProcess according to Some Rules or Some Schedule. Scheduling is that inwhich each process have Some Amount of Time of CPU. Scheduling ProvidesTime of CPU to the Each Process.

    There are Two Types of Scheduling 1) Preemptive: In this all the Processes are executed by using some Amount

    of Time of CPU. The Time of CPU is divided into the

    Number of

    Minutes and Time of CPU divided into the Process by using Some Rules.

    2) NON-Primitive: In this No Time Scheduling is used and in this CPU will be automatically free after Executing the Whole Process Means When theExecution of the Process will Completed then the CPU will be Free.When two or more Process are given then this will first Complete theProcess and after Completing the First Process, this will Automaticallystart the Second Process.

    Preemptive Scheduling: We have various Techniques of Scheduling.1) First Come First Serve: As the name Suggest, the Processes those are

    Coming first, will be Executed first and Means CPU Will Creates aQueue, means all the Process are Inserted into the Queue and the CPUwill Perform all the Process by using their Coming Order.. In this all theProcess are arranged by the CPU and After Executing a Single Process,then this will Automatically Execute second Process by Picking up thenext Process.

    2) Shortest Job first: In this Scheduling, All the Process are Arranged intotheir Size Means How Many Time a Process require, of CPU for Executing. CPU Arrange all the Processes according to the RequirementTime. CPU Executes the Processes by Examining the Time Required byProcess. CPU Prepare a queue in which all the Processes are arranged byusing the Number of Time Units Requires by the Process. For Example if we want to Print a Page and move a Mouse on the Screen. So that CPUwill first Move the Mouse on the Screen. Then after that he will print a

    Page. Because Job of printing Require a Lots of Time and Moving aMouse is just requires little Time of CPU.

    3) Priority Scheduling: When the Process are Given, then Each Process havea Priority means Some Preference issue. Which Job will be executed first, isdetermined by the CPU. After Examining the Priority of the CPU. EachProcess takes different Time of CPU and also the Number of Inputs those areneeded by the CPU. So CPU Maintains the Priority Level after Examining the

    Total time which a Process will consume. All the Processes are Arranged byusing Some Priority,. Then CPU Executes the Process by using the ProcessPriority.

  • 8/6/2019 Notes of Operating System

    27/37

    Created by Mr.Manga Page 27 of 37

    4) Round Robin: In this Scheduling the Time of CPU is divided into the EqualParts and Assign to various Processes. In this Time of CPU is also known as

    Quantum Time. In the Round Robin, when the time of First Process hasfinished, then the CPU will execute the Second Process. But there also be possibility that the Process doesnt End, up to The Time. So that if processdoesnt end at the End of Time. Then CPU uses the Context Switching, MeansCPU Record the State of Process. After executing the other Processes, he willexecute the First Process Again until the Process never ends.

    5) Multilevel Queue Scheduling: In this The Time of CPU is di

    vided by usingSome Process Categories. In this the Process those are executed on theForeground or on the Screen, have a higher Priority and the Process those arerunning in the Background to fill the Request the user. When we Input the datainto the Computer. Then the Data is displayed on the Screen after Processing.

    Preemptive Scheduling and Non- Preemptive Scheduling: - in the PreemptiveSchedulingJobs are Executed one by one according to the Scheduling Techniques, But inthis when the Higher Priority ob will Request for a Service. To the CPU, thenCPU will transfer the Control to the Request Job, Means the Running job willwait for Some Time.

    But in Non-Preemptive Scheduling means No scheduling then all the Jobsare Executed One by One. And in this when the First Job will be Completed,after that second Job will Started.

    Various Process StatesA process which is Executed by the Process have various States, the State of the Process is also called as the Status of the process, The Status includes

    whether the Process has Executed or Whether the process is Waiting for Someinput and output from the user and whether the Process is Waiting for the CPUto Run the Program after the Completion of the Process.The various States of the Process are as Followings:-

    1) New State : When a user request for a Service from the System , then theSystem will first initialize the process or the System will call it an initialProcess . So Every new Operation which is Requested to the System isknown as the New Born Process.

    2) Running State : When the Process is Running under the CPU, or Whenthe Program is Executed by the CPU , then this is called as the Running process and when a process is Running then this will also provides usSome Outputs on the Screen.

    3) Waiting : When a Process is Waiting for Some Input and OutputOperations then this is called as the Waiting State. And in this process isnot under the Execution instead the Process is Stored out of Memory andwhen the user will provide the input then this will Again be on readyState.

    4) Ready State : When the Process is Ready to Execute but he is waitingfor the CPU to Execute then this is called as the Ready State. After the

  • 8/6/2019 Notes of Operating System

    28/37

    Created by Mr.Manga Page 28 of 37

    Completion of the Input and outputs the Process will be on Ready Statemeans the Process will Wait for the Processor to Execute.

    5) Terminated State : After the Completion of the Process , the Process

    will be Automatically terminated by the CPU . So this is also called asthe Terminated State of the Process. After Executing the Whole Processthe Processor will Also deallocate the Memory which is allocated to theProcess. So this is called as the Terminated Process.

    As we know that there are many processes those are running at a Time, this isnot true. A processor can execute only one Process at a Time. There are thevarious States of the Processes those determined which Pr

    ocess will beexecuted. The Processor will Execute all the processes by using the States of the Processes, the Processes those are on the Waiting State will not be executedand CPU will Also divides his time for Execution if there are Many Processesthose are Ready to Execute.

    When a Process Change his State from one State to Another, then this isalso called as the Process State Transition. In this a Running Process may goeson Wait and a ready Process may goes on the Wait State and the Wait State can

    be goes on the Running State. Explain Context Switching

    As I have mentioned that the Processes have various States So that the State of the Process is also maintained by the System, for Resuming the Execution of the Process. For Storing the State or For Monitoring the States we use theContext Switching.

    When any Another Request has been Received during the Execution of the Request then the CPU will jump to the newly Requested Process. So thatthis is also necessary to store the State of the Previous Running Process meansthere will also be Some Mechanism which Stores the States of the CurrentProcess. Because after the Completion of Newly Process, the CPU will alsoagain Execute the previous State. So that CPU will Store the Previous State toResume the Processing from the Previous State .

    Context Switching is used for Resuming the Execution from the PreviousState of the Process. So that

    Introduction to PCBProcess Control block is used for storing the collection of information about the

    Processes and this is also called as the Data Structure which Stores theinformation about the process. The information of the Process is used by theCPU at the Run time. The various information which is Stored into the PCB asfollowings:

    1) Name of the Process.

    2) State of the Process. Means Ready, Active, Wait.

    3) Resources allocated to the Process

    4) Memory which is provided to the Process.5) Scheduling information.

  • 8/6/2019 Notes of Operating System

    29/37

    Created by Mr.Manga Page 29 of 37

    6) Input and Output Devices used by the Process.

    7) Process ID or a Identification Number which is given by the CPU when a

    Process Request for a Service.

    Process Management Process: Process is the job which is the under Execution. Process is also knownas the Running Job. For Execution there must be a System call which call theProcessor or CPU for Performing any Operation. Process includes reading datafrom a File, Writing a Data from a File, Printing a document means to Say anyType of Operation is known as the Process. Every Process has som

    e Attributes

    Like1) Process ID or Identification Number.- Process id is given by the CPU

    when we Request for an Operation. Process id is also known as a uniqueidentification Number which is Available when we request for a service.As we know there are many types of Operation those are performed onthe Computer. So that for identification means which Process will beexecuted.

    2) Process Name. : Name Specify the Description of the Process. Name of Operation which is performed by the Process. For Example Move theMouse, Click on My Computer, Play the Song etc.

    3) Process State (Ready, Active, Wait or Suspend). The Process has SomeStates, State Specify the Process State means whether a Process isrunning or not, Whether a Process wait for CPU etc. There are threeTypes of States

    1) Ready: Process wills Ready State, when we completed all theInput and Outputs. After giving the input, we wait for theExecution. After the Completion of user Interaction means after all the Inputs and Outputs.

    2) Active: Active Means Process is running under the CPU.3) Wait: When a Process is waiting for the Input and Outputs from

    the user then this is called as on Wait State.

    Process State will give you the Information about the Status of the Process .

    4) Process Resources: For Running a Process, then there are manyResources used. For entering some data then we must use the Keyboardand for Sending data to the Computer CPU has used. So that For Performing any Operation, what types of Resources. All the Devicesthose are attached with the Computer are known as Resources of theSystem.

  • 8/6/2019 Notes of Operating System

    30/37

    Created by Mr.Manga Page 30 of 37

    5) Scheduling Information. : Scheduling is used when there is ManyProcess those are running at a Time. Which Process will be executed bythe CPU? So that we use the Scheduling, determines the Time of CPU,

    Means CPU Time Divided into the various Processes.Chapter 7 : What is Dead-Lock?

    Dead-Lock is occurred in multiple users Computing Environment. As we knowthat there is Many Number of users those are going to perform their Transactions. Dead-Lock has occurred when two or More Users are requestingfor data item or for a Resource of System for example two or more usersRequest for the Printers at a Same Time and When Dead-Lock has occurred.

    All the users will be on Wait State Means, No user can get t

    he resource of

    the System. Or Dead-Lock is occurred when two or More Requests are waitingfor Some Operation Which is not possible. There is also Some Situation Whenthe Problem of Dead Lock has occurred. There are Following Conditions for aDeadlock has Occur:-

    1) Circular Wait:- W hen two or More Requests are Waiting For aLong Period of Time and no one can Access the Resource from theSystem Resources , Then this is called as Circular Wait For

    Example if two or more users Request for a Printer, at a Same Time, they Request to Print a Page. Then they will be on the Circular Wait. Means System Will Display Busy Sign of Sign.

    2) Partial Allocation: - After Processing the Request, if a user doesntleave the Resource of the System, then we cant use the Resource of the System. Then in this Situation when the other users, Request for the Resource then the other users, will also be on the Waiting State.Then this will create the Deadlock.

    3) Mutual Exclusive: When a Single Process is used by two or moreProcesses, Means a Single Resource if used for performing the twoor more activities as a Shared Based. But this is will Also Create aProblem because when a Second user Request for the SystemResource which is being used by the user.

    4) HOLD and Wait: A Single Process may need two or more SystemResources. And suppose if a Process have a Single Resource, andhe is waiting the Second Resource. Then Process cant Leave thefirst Resource and waiting for the Second Resource. So that there

    will also be the Condition of Deadlock.5) No Preemption: if there is no Rule to use the System Resources.

    Means if all the System Resources are not allocated in the Manner of Scheduling. Then this will also create a Problem for a Deadlock

    because there is no surety that a Process will Release the SystemResources after the Completion.

    For Avoiding a Dead Lock First of all we have to detect Dead-Lock Means

    Firstly we have to detect why and how a Deadlock has occurred and ThenAvoid or Solve the Problems those are Occurred due to Occurrence of Deadlock.

  • 8/6/2019 Notes of Operating System

    31/37

    Created by Mr.Manga Page 31 of 37

    Unit 8:- Memory managementAs we know that memory is that which stores the programs and these programsare used by the CPU for processing. And there are two types of memories firstis the logical memory and second is the physical memory. The memory whichis temporary such as ram is also known as the temporary memory and thememory which is permanent such as hard disk is also known as the physicalmemory of system. When we wants to execute any progra

    ms then that

    programs must be brought from the physical memory into the logical memory.So that we uses the concept of the memory management. This is theresponsibility of the operating system to provide the memory spaces to eachand every program. Also manage which process will be executed at that time.

    Operating system translates the physical address into the logicaladdress, if he wants to perform the operation, then he must translate the

    physical address into the logical address. This is the also known as binding.Means when a physical address is mapped or convert into the logical address,and then this is called as the binding.

    There is also a concept which is also known as the dynamic loading,in this a program doesnt reside into the memory of the computer and we musthave to load that process for processing. So that when a process is loaded onlywhen a request has found, then it is called as the loading of the process.

    Concept of contiguous allocation:-The contiguous allocation means the memory spaces is divided into the

    small and equal size and the different process uses the various partitions for

    running their applications process. And when a request has found then the process will allocate the space. And in this the contiguous spaces is provided toeach and every process. Means all the process will reside in the memory of thecomputer and when a process will request for the memory then this availablememory or free memory will be allotted to him.

    But there will be problem when the memory which is required bythe process is not enough for him or when the size of memory is less which isrequired for the process. So this problem is also known as the internal

    fragmentation. The main reason for the internal fragmentation is, all thememory is divided into the fixed and continuous sizes. So that if a processrequires large memory then that process will not be fit into the small area.

    The second problem is also occurred in the continues allocation.This is also known as the external fragmentation. In this when the memory isnot enough after combing the multiple parts of single memory. In this when therequired memory is high after combining the various areas of memory then thisis called as external fragmentation. So there are the following problems arisewhen we use the contiguous memory allocation.

    1) Wasted memory: the wasted memory is that memory which isunused and which cant be given to the process. When the

  • 8/6/2019 Notes of Operating System

    32/37

    Created by Mr.Manga Page 32 of 37

    various process comes which require memory which is notavailable this is called as the wasted memory.

    2) Time complexity: there is also wastage of time for allocating

    and de-allocating the memory spaces to the process.3) Memory access there must be some operations those are performed for providing the memory to the processes.

    Concept of swapping For improving the performance of the system we use the concept of swapping.In the swapping the processes those are on waiting state and those are onsuspend or temporary suspend will be stored from out side the memorylocations so that the speed of process will be high. In this the proc

    ess those are

    waiting for some input and output are transferred to the physical memory fromthey are running and the processes those are ready for the execution will beexecute by the CPU.

    When there is a situation to perform swapping, then we uses the sweeper.The sweeper is used for

    1) Selecting which process to be out2) Selecting which process to be in3) Providing the memory space to the processes those are newly entered.

    In this sweeper will select the suspended process then brings the ready process in memory and after the execution that suspended process will beagain entered into the memory by the sweeper.For swapping the sweeper also uses some address those are also known asthe logical and physical address of processes. For providing the logicaladdress into the physical address there the following two approachesused.

    1) Static relocation. : In the static relocation swapping never to be performed because the process are always have a memory. Which isnot to be changed at the execution time. For example the memorywhich is provided to the input and output operations and the memorywhich is provided to the CPU for executing the processes will not bechanged so that this is also known as the static relocation of thememory.

    2) Dynamic relocation. The dynamic relocation is also known as the

    memory which is changed and relocates by the processes at the time of execution. So that there must be some mechanism to provide memorythose processes those are running. The mapping of the logical addressinto the physical address will be performed at the time of execution or at run time. When the memory is provided to the process then the

    particular address is stored by the CPU which is also have a entry intothe partition description table means in which partitions a process isrunning because when the process needs swapping that particular

    address must be reloaded.

  • 8/6/2019 Notes of Operating System

    33/37

    Created by Mr.Manga Page 33 of 37

    Concept of variable partitioned or dynamic memoryallocation

    As we know that there are many problems arise in the continues memoryallocation so that we uses the concept of the dynamic memory allocation. In thedynamic memory allocation memory is divided into the various partitions at therun time.

    In this when a execution request of a process has to be made, then thememory is partition according to the size which is needed by the processes sothat there will not be the internal and external fragmentation. In this when a

    process requested for some memory then the needed memory wi

    ll be allocated by the process so that there will not be the case when some memory spaces will be the left. The memory spaces will be provided up to that time, when theability of performing the number of programs doesnt comes to end or up tothat time when the space of the hard disk never comes to an end.

    The dynamic memory allocation also provides us the compaction.In the compaction the memory areas those are free and those are not allocated

    by the process, will be combined and makes a single large memory part.Because as we know that when we execute the processes then the processesmany not allocate the small amount of spaces so for avoiding this problem and

    to use the small areas we can use the compaction, which will combine all thefree memory spaces and makes a single area so that the newly large area canagain be used by the process.

    Memory partition or non contiguous allocation concept

    As we know that operating system is that which executes the system and theoperating system is the software which is responsible for running all the user

    programs so that generally memory is divided in to the two parts, first part isused by the operating system and the second part is used by the user programsand there may be some situations that the memory size of the operating systemmay be higher from the user memory and also vice versa.

    So that there must be some mechanism in which a user cant access thedata of the operating system and there must be some mechanism. Thatmechanism contains two types of registers

    1) Relocation register: the relocation register is the smallestregister which contains the smallest value of the physical address.

    2) Limit register: the limit register is that which contains thehighest values of the address of physical memory.

    When we use the static memory allocation then all the memory is provided tothe various process will be in the continuous form and when any process endsthen the memory of that process will not be allotted to any new join process

    because memory is already to all the processes so this will create the problemof internal fragmentation means there is not enough memory available which

    can be allocated to the processes so that we uses the dynamic memoryallocation , in this memory which is allocated by the processes in the form of

  • 8/6/2019 Notes of Operating System

    34/37

    Created by Mr.Manga Page 34 of 37

    needs and dynamic demands of the process and in this when a process endsthen the memory of that process will be provided to the process which is newly

    join and the memory is provided to the process by using the compaction means

    after providing the memory space to each and every process , this will refreshthe memory or will uses the process of compaction and in this all the freememory will make a single large memory so that the memory will be providedto the process those are newly created. For providing the memory to the various

    processes there are three methods or techniques-

    1) First fit: in the first fit the operating system will search for the freememory or available memory from the entire memory

    and this willselect the first area or first part of the memory and in this first partwhich is large enough for the process will be provided to the process.

    2) Best fit: in this operating system will search for the memory areawhich is small as well as enough for the process. Will be provided tothe process. And in this all the memory holes or parts are arranged into the sorted order and the operating system will search for the bestwhole means this will search for the smallest hole or part from thememory.

    3) Worst fit : in the worst fit we uses the largest hole for the process andin this the memory area which is large enough means which is greater from the required area will be allocated to the process.

    Concept of Virtual MemoryAs we know that a Computer is designed for Performing the Multiple Tasks ata Time and for this Some Memory is also used by the Computer for executingthe instructions those are given by the user. But when there is a Situation whenthe Memory which is required by the user is high from the Available Memory.So that the Logical Memory will be treat as the Permanent Memory or from thePhysical Memory. And when we wants to display the size of Log