• Identification Information And Process Security Attributes
  • Process Control Unit
  • Managing Processes In UNIX and Linux




    Download 6,34 Mb.
    Pdf ko'rish
    bet31/203
    Sana10.01.2024
    Hajmi6,34 Mb.
    #134102
    1   ...   27   28   29   30   31   32   33   34   ...   203
    Bog'liq
    Linux This Book Includes 4 Manuscripts The Underground Bible

    Managing Processes In UNIX and Linux
    Image Of The Process
    In UNIX systems, the process image contains the following components:
    ❖ 
    Process control unit
    ❖ 
    The code of the program executed by the process

    The process stack where temporary data is stored (procedure
    parameters, return values, local variables, etc.)
    ❖ 
    Global data common to the whole process
    Identification Information And Process Security
    Attributes


    The process identifier ( PID ) is unique throughout the system and is used to
    access this process. The init process identifier is always one. The process
    ID of the ancestor ( ppid ) is specified when it is created. If the ancestor of
    process P completes execution, the ancestor of that process automatically
    becomes init, so ppid for P will be unity.
    With the process as fl ' related set of security attributes.
    ❖ 
    The real user and process group identifiers ( uid , gid ) correspond
    to the user who started the program, resulting in the corresponding
    process appearing on the system
    ❖ 
    Effective user and process group identifiers ( euid , egid ) are used
    in a special process execution mode - are owned by the owner
    Process Control Unit
    Consider the structure of the process control unit in Linux.
    The process control block on Linux is displayed by the task _ struct data
    structure. The most important fields in this structure are fields that contain
    the following information:
    ❖ 
    Identification data (including pid - process identifier)
    ❖ 
    Process status (execution, expectations, etc.)
    ❖ 
    Pointers to ancestral and descendant structures
    ❖ 
    Process creation time and total execution time (so-called process
    timers)
    ❖ 
    Processor state (contents of registers and counter of instructions)
    ❖ 
    Process security attributes ( id , gid, euid , egid )
    Note that the Linux kernel does not have a separate data structure for the
    stream, so the processor status information is contained in the control block
    of the process. In addition to the above, task _ struct has several custom
    fields required for different Linux subsystems :


    ❖ 
    Information for signal processing
    ❖ 
    Process planning information
    ❖ 
    About files and directories floor ' related to the process
    ❖ 
    Data structure for managing memory subsystems
    The task _ struct field data can be shared by several special purpose
    processes, in which case these processes are actually threads. The control
    units of the process are stored in the kernel in a special data structure. Prior
    to the release of kernel 2.4, this structure was called a system process
    table; it was an array whose maximum length could not exceed 4K. In the
    core processes, it has been replaced by two dynamic data structures that do
    not have such a restriction:
    ❖ 
    A hash table (where the pid of the process acts as a hash ), this
    structure allows you to quickly find the process by its ID
    ❖ 
    Ring list, this structure ensures the implementation of actions in the
    loop for all system processe s
    Now the limit on the maximum number of processes is checked only within
    the implementation of the fork () function and depends on the amount of
    available memory (for example, there is information that on a system with
    512 MB of memory it is possible to create about 32000 processes).
    The implementation of a control unit in Linux is different from its
    traditional implementation in UNIX systems. In most versions
    of UNIX (System V, BSD), the process control block consists of two data
    layers - a process structure ( proc ) and a user structure ( u ).

    Download 6,34 Mb.
    1   ...   27   28   29   30   31   32   33   34   ...   203




    Download 6,34 Mb.
    Pdf ko'rish