26 Feb 2017

Unix 2.3 Process Sub-system


PROCESS SUB-SYSTEM 




A process is the execution of a program and consists of a pattern of bytes that the CPU interprets as machine instructions, data, and stack. A process executes by following a strict sequence of instructions that is self-contained and does not jump to that of another process. Processes communicate with other processes and with the rest of the world via system calls.

A process in a UNIX system is the entity that is created by the fork system call. Every process except process 0 is created when another process executes the fork system call. The process that invoked the fork system call is the parent process, and the newly created process is the child process. Every process has one parent process, but a process can have many child processes. The kernel identifies each process by its process number, called the process ID (PID). Process 0 is a special process that is created "by hand" when the system boots; after forking a child process (process 1), process 0 becomes the swapper process. Process 1, known as init, is the ancestor of every other process in the system and enjoys a special relationship with them.

A user compiles the source code of a program to create an executable file, which consists of several parts:
• a set of "headers" that describe the attributes of the file,
• the program text,
• a machine language representation of data that has initial values when the program starts execution, and an indication of how much space the kernel should allocate for uninitialized data.
• other sections, such as symbol table information.

Every process has an entry in the kernel process table, and each process is allocated user area that contains private data manipulated only by the kernel. 



The process table contains a per process region table, whose entries point to entries in a region table. 

A region is a contiguous area of a process's address space. Region table entries describe the attributes of the region.  

The u area contains information describing the process that needs to be accessible only when process is executing. The important fields are :
• a pointer to the process table slot of the currently executing process,
• parameters of the current system call, return values and error codes,
• file descriptors for all open files,
• internal I/O parameters,
• current directory and current root,
• process and file size limits.

Friends, if you find this post useful please comment below. If you want quick notes for any topic please mail us at hardikpanchal551@gmail.com, we will try to provide notes if possible. Thanks for reading.

No comments:

Post a Comment