Thursday, June 5, 2008

Program execution

An operating system's most basic function is to support the running of programs by the users. On a multiprogramming operating system, running programs are commonly referred to as processes. Process management refers to the facilities provided by the operating system to support the creation, execution, and destruction of processes, and to facilitate various interactions, and limit others.

The operating system's kernel in conjunction with underlying hardware must support this functionality.

Executing a program involves the creation of a process by the operating system. The kernel creates a process by setting aside or allocating some memory, loading program code from a disk or another part of memory into the newly allocated space, and starting it running.

Operating system kernels store various information about running processes. This information might include:

  • A unique identifier, called a process identifier (PID).
  • A list of memory the program is using, or is allowed to access.
  • The PID of the program which requested its execution, or the parent process ID (PPID).
  • The filename and/or path from which the program was loaded.
  • A register file, containing the last values of all CPU registers.
  • A program counter, indicating the position in the program.

No comments: