From: Tauno Voipio on
peter wrote:
> take a look http://peter-bochs.googlecode.com , It is a debugger, I
> made it for my operating system development. I want it to support /
> proc.
> In my debugger, I can read anywhere in memory, I can also read the CPU
> status. But I don't know where to find the /proc information in memory
> (perhaps it doesn't exist in memory).
>
> For operating system development, only reading the memory for debug is
> not enough. I need to read the data-structure(data structure for
> paging information, segmentation information, process information or
> etc... ) of kernel. But for linux, I don't know where is those
> structures in memory.
>
> If the /proc is not hold in memory or unable to decode it. I am going
> to write a small standard about "how to put and decode kernel debug
> information in memory/harddisk". If your operating system is follow
> this small-standard, then you can use my peter-bochs debugger to debug
> your operating system in high-level way. "high-level way" mean not
> just reading some bytes in memory, it means allows us to read the data
> structure of your kernel in real time (forgive my bad English).
>
> Also, I am applying a mPhil degree. If I use this as a research topic,
> is it too naive?
>
> Nice guys, thanks. Here is a good forum.


The structure of /proc is in linked lists in memory.
The contents of the leaf nodes are manufactured in
the code when read.

Please get the book 'Linux Device Drivers', and read
and understand it. There are perfectly good instructions
how nodes and leaves of the /proc 'file' tree are made.

The book also handles sysfs which is another 'file' system
which is actually a peek into the kernel data structures.

--

Tauno Voipio