OS L2 Process_2014

download OS L2 Process_2014

of 14

Transcript of OS L2 Process_2014

  • 7/24/2019 OS L2 Process_2014

    1/14

    OPERATING SYSTEMS (THEORY)

    LECTURE - 2

    K.ARIVUSELVAN

    Assistant Professor Senior SITE

    VIT University

  • 7/24/2019 OS L2 Process_2014

    2/14

    PROCESS MANAGEMENT

  • 7/24/2019 OS L2 Process_2014

    3/14

    Program

    A program consists of:

    Code: machine instructions

    Data: variables stored and manipulated in memory

  • 7/24/2019 OS L2 Process_2014

    4/14

    Preparing a Program

    static libraries

    (libc, streams)

    compiler/assembler Linker

    file

    .

    Executable file

  • 7/24/2019 OS L2 Process_2014

    5/14

    PROCESS

    Program in Execution

    You mi ht think of it as

    The collection of data structures that fully describes how far the

    execution of the program has progressed.

  • 7/24/2019 OS L2 Process_2014

    6/14

    PROCESS

    A Process includes 4 Segments:

    DATA: Holds program variables

    HEAP: Holds intermediate computation data generated

    during run time

    STACK: Holds

    => oca var a es

    => Temporaries & Procedure Calls

  • 7/24/2019 OS L2 Process_2014

    7/14

    Process in Memory

  • 7/24/2019 OS L2 Process_2014

    8/14

  • 7/24/2019 OS L2 Process_2014

    9/14

    Processes in Memory

  • 7/24/2019 OS L2 Process_2014

    10/14

    PROGRAM PROCESS

    Instructions in any Instruction execution in machine

    Passive Entity

    {Content of file stored on

    Active Entity

    {Contains program counter,s ecif in next instruction tos

    execute}

    Resides in the Secondary

    storageResides in Main memory

  • 7/24/2019 OS L2 Process_2014

    11/14

    PROCESS IMAGE

    o ect on o , ,

    Process IdentificationParent & Child ID

    Process StateInformation

    Content ofprocessor register PCB

    Information

    User Stack

    Priority, State

    ser ress pace

    (Code& Data)

    Shared Address Space

    The Collection of attributes is called as Process Control Block

    (PCB) or Task Control Block (TCB)

  • 7/24/2019 OS L2 Process_2014

    12/14

    The Process image is stored on the disk as contiguous block,

    this block may be:=> Fixed Size (Pages)

    => Variable Size (Segments)

    Process 2

    .

    -

    PImg-2

    Process n

    Primary Process Table

    PImg-n

    Process

    Image

    The address of each Process image is stored on Primary

    Process Table

    * To maintain the process, its image must be brought into main memory

  • 7/24/2019 OS L2 Process_2014

    13/14

    Process Images in Main Memory

  • 7/24/2019 OS L2 Process_2014

    14/14

    Structure of PCB

    en er n que prov e y on processcreation

    StateNew, Ready, Running, Suspend,Terminated

    PriorityMay be Internal (Set by OS) or

    External (depends on external

    factors) Program CounterAddress of next instruction to be

    executed

    Includes Pointer to the

    = emory o n er

    => Data associated with this process

    => Memory block shared with other process

    Context Data Data present in Registers, while process

    is executing

    I/O Status

    Includes

    => I/O requests,I/o devices asssigned to this

    process

    => List of Files in use by the process

    Accounting Includes the amountn orma on => Amount of processor time used

    => Time limits`