Process Description and Control

 

  • Aim Of article:
    • OS keeps track of the process state by elaborate data structure describing each process. This article looks at the data structures and techniques used in a typical OS for process management
  • Process Definition:
    • A program in execution
    • An instance of a program running on a computer
    • The entity that can be assigned and executed on a processor
  • Process consists of:
    • Program Code
    • Set of data
    • Process control block
  • While the program is running process can specified by the Process Control Block (PCB) that contains:
    • Identifier: as ID number
    • Program Counter: the address of next instruction in the program to be executed
    • Memory Pointers: includes pointers to:-
      • Program code
      • Data associated with the process
      • Memory blocks shared with other processes
    • Context Data: data in the processor registers while the process executing
    • I/O Status Info: includes I/O requests, devices assigned to this process and files used by process
    • Accounting Info: includes amount of processor time, clock time used and time limits
    • State, Priority
  • Process Trace: the sequence of instructions that the process will execute
  • Dispatcher: OS Program that switches between processes
  • Reasons for process creation:
    • New patch job: a process is created in response to the submission of a job
    • Interactive logic: a process is created when a new user attempts to log on
    • Provide a service: when a program request a service (i.e. printing a paper(s))
    • Spawned by other process: Dictated by a user program (former called parent spawned as child)
  • Reasons for process termination:
    • Memory unenviable: the process requires more memory than the system can provide
    • Protection error: the process attempts to use protected resource (i.e. write to read-only file)
    • Time overrun: the process has waited longer than max. time for a certain event to occur
    • Invalid instruction: attempting to execute invalid instructions (i.e. executing data)
    • Privileged instruction: attempting to use an OS reserved instruction
    • Data misuse: using an uninitialized data or not suitable data type
    • Operator or OS intervention: terminated by OS (i.e. if deadlock happened)
    • Normal completion, time limit exceeded, bounds violation, arithmetic error, I/O failure
    • Parent termination, parent request
  • Process States:
    • Two-State Model: running and not running
    • Five State Model: new, ready, running, blocked, exit
  • Round-Robin:
    • Process is given amount of time, in turn to execute and then return to queue unless blocked
  • When the process is at the new state it’s program remains on the secondary storage
  • Preempted Process means that moving this process from running to ready state for priority reason
  • Blocked/Suspended State: The process in the secondary memory and awaiting an event
  • Ready/Suspended State: The process in the secondary memory and ready for execute
  • Reasons for process suspension:
    • Other OS Reasons: as if the process in a deadlock
    • Interactive user request, swapping, timing, parent process request
  • General structure of OS control tables:
    • Memory:
      • Used to keep track of the main and secondary memory
      • Memory tables must indicate the following information:
        • The allocation of main/secondary memory to process
        • Any protection attributes of blocks of main or virtual memory: sheared memory
        • Any information needed to manage virtual memory
    • Devices, Files and Processes
  • Process Control Structures: these knowledge are important so the OS can manage the processes
    • Process Location:
      • Process Image: the collection of program, data, stack and attributes (PCB)
    • Process Attributes (Process Control Block):
      • Process Identification: ID, parent ID and user ID
      • Process State Information:
        • User Visible Registers: EAX, EBX …
        • Control Status Registers: PC, Condition Codes (EFLAGS) and Status Information
        • Stack Pointers
      • Process Control Information:
        • Scheduling and State info: State, priority, scheduling info and event
        • Interprocess Communication:
          • Info related to the process communication with other processes
        • Process Privilege: contains accessible memory and valid type of instructions
        • Memory Management: pointers to the virtual memory used by this process
        • Resource ownership utilization: info about the resources used by the process
        • Data Structuring
  • The mode of processor execution is determined by the PSW
  • OS creates new process by:
    • Assign unique process ID to the new process
    • Allocate space for the process
    • Initialize the process control block
    • Set appropriate linkages: put the process in its appropriate queue (ready/ suspended…)
    • Create or expand other data structures
  • System Interrupts Types:
    • Interrupt:
      • Relates to the external from the current process (i.e. I/O operation)
    • Trap:
      • Relates to an errors or exception condition generated within currently running process
    • Supervisor call
  • The interrupt handler does the following as housekeeping to OS routine:
    • Clock Interrupt: OS determines if process has work for it’s specified max time limit or not
    • I/O Interrupt: changing processes states that is waiting for the current I/O action
    • Memory Fault:
      • When the OS encounters a null memory address then the process is blocked till data come
  • If an interrupt is pending then the processor does the following:
    • Sets the PC to the starting address of the interrupt handler
    • Switches the processor mode to kernel mode
  • Steps involved in process switching:
    • Save the contexts of the processor (PC and other registers)
    • Update the PCB of the current running process (state, reason of leaving)
    • Move the PCB of this process to the appropriate queue
    • Select another process for execution
    • Update PCB of the selected process
    • Update memory management data structures
    • Restore the context of the processor to that which existed at the time the selected process running
  • Execution of the OS processes:
    • Non-process Kernel
    • Execution within user process
      • Here the process image will also holds the program, data and stack of the kernel programs
    • Process Based OS
  • Security Issues:
    • System Access Threats
      • Malicious Software:
        • Parasitic: malware that depends on other program to work (virus, logic bombs)
        • Independent self-contained programs that can be operated by OS (Worms, bot)
      • Intruders (hacker or cracker):
        • Masquerader:
          • An individual who is not authorized to use the computer and access it to exploit legitimate user account
        • Misfeasor:
          • A legitimate user that access unauthorized data or misuse of authorized data
        • Clandestine user:
          • System supervisor who use his authority to evade from auditing and control
      • Intrusion Detection Systems (IDS):
        • Host-based IDS: monitor the host for suspicious activities
        • Network-based IDS: monitor the network for suspicious activities
      • IDS Logical Components:
        • Sensors:
          • Responsible for collecting data from network packets, log files, system call , send them to analyzer
        • Analyzer:
          • Responsible for determining if an intrusion occurred and provide info about what actions to take. Inputs from sensors and other analyzers
        • User Interface: enables the user to view output from the system or control behavior
    • Authentication
      • Any authentication process consists of tow steps:
        • Identification Step: as username
        • Verification Step: as user password

         

      • User Authentication Approaches:
        • Something the individual knows: password
        • Something the individual processes (token): smart cards, physical keys
        • Something the individual is (static biometrics): fingerprint, retina
        • Something the individual (dynamic biometrics): voice, handwriting

Access Control

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s