Hi,
I am posting this article on behalf of a friend. Please
=========== Start of article ==========
Hi,
I was using adb to 'look' around in the solaris 2.4 kernel and
developed a few quesion. Hope someone could answer/explain
them for me.
1) I noticed that the adb macro 'setproc' uses 'pidhash'
to get to the desired proc structure. Does anyone knows what is
pidhash and how I can make use of it.
I also noticed that in the 'setproc' macro, the process number
is 'and'ed with 7f and multiply by 4 before accessing pidhash.
Anybody knows why you need to do that.
2) Does anyone knows how the proc structure is maintained by
the kernel. Is there a head pointer which
points to the begining/first proc structure. How does one proc
structure links to the other proc structure.
3) I came across the 'proc' adb macro and am not sure with
how it calculates and prints the 'cid', 'exec, uid' etc.
Below is the line include from the macro which is suppose
to do that.
.>D;<D/n"cid"16t"exec"16t"as"16t"uid"n4+3Xu2+n"lock"
+$<<mutex ^^
Does anyone knows why the macro has to add 2 bytes after it
prints the 'uid' variable. According to /usr/include/sys/proc.h,
uid is actually typed o_uid_t which is unsigned short and
2 bytes. Immediately after it is supposed to be p_lock of
type kmutex_t. Why does it has to add 2 bytes before accessing
p_lock??
If I don't add the 2 bytes, all the address for the rest of
the structure are not correct.
4) I noticed that 'dmesg' will print system messages from previous
reboots. I thought that system messages are lost after the
system reboots and dmesg only reports system messages after
system reboots, not before. Does anyone knows how the kernel
keeps saves those system messages from previous reboots??
Thanks for any response. Please send replies to
Anyone knows if there is a email-to-usenet facilities for
this newsgroup.
Thanks.
-- Lee, Fook Heng