[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] /kern documentation



Hi all!

I would like to know what all the values in /kern/<pid>/meminfo mean.

Also, I think there is a bug there. Look at this line:

0000018D-00002000 397 ---- 0000002D 6356992:00 0

After the 397 the next two characters are wrong!

If I look in the source in kernget.c I am totally confused:

crs += ksprintf (crs, len - (crs - info->buf),
                "%08x-%08x %3u %c%c%c%c%c%c %08x %02lu:%02lu %lu\n",
                (ulong) p->p_mem->addr[i],
                (ulong) p->p_mem->addr[i] + m->len + 1,
                (unsigned) m->links,
                m->mflags & M_KEEP ? 'k' : '-',
                m->mflags & M_SHARED ? 's' : '-',
                m->mflags & M_FSAVED ? 'f' : '-',
                m->mflags & M_SHTEXT_T ? 't' : '-',
                m->mflags & M_SHTEXT ? 's' : '-',
                m->mflags & M_CORE ? 'c' :
                m->mflags & M_ALT ? 'a' :
                m->mflags & M_SWAP ? 's' :
                m->mflags & M_KER ? 'k' : '-',
                0UL,
                0UL,
                0UL);

I am not a good C coder, but to me it seems, that in the format
string, 13 arguments are present, while only 12 get passed in the end.

Does this maybe cause the weird behaviour? Or is everything correct
and I am missing something?

And last but not least:

What is the use of meminfo anyway? Which programs are using this? Or
is it meant to be read by humans, just to have something nice to look
at?  ;-)

Same applies to all the other things in /kern/<pid>/
What do I find in status? statm?

I know, writing docs is a horrible and time consuming task, but if
there was at least a little bit in the source. At least a few
comments, would be nice.


Cheers, Ingo =;->