4
votes

I wanted to know where the PCB ( Process Control Block ) is stored in memory in Linux OS.. When the interrupt happens or scheduler is called, context switching code will replace the current process PCB and put it some where and load the new process PCB into memory.

I totally agree it is stored in RAM. But what is the name of such area in RAM.

What is the difference between address space and PCB . Are both same.

1
so it is stored on /proc file system which in turn is in RAM memorymd.jamal
see also stackoverflow.com/questions/20979011/… and Google query site:stackoverflow.com linux process control blockxmojmr
I have seen that, but it doesn't clearly specify where in RAM it stored. Consider for example malloc, we can say that it stores in heapmd.jamal
the above linked question states that the task_structs are allocated using the slab allocator. I would have to dive into the linux source code to find out more. sorryxmojmr

1 Answers

-1
votes

On most systems there is no process control block (I think it is safe to say that Linux has no such "PCB"). Process control block is a pedagogical concept used in some poorly written operating systems textbooks. What these books refer to is actually multiple data structures that can be stored in different locations.

The initialism PCB normally refers to the Process Context Block that is the area where the process context (ie registers) are stored.