On Wed, 12 Dec 2007, �ս� TaoJie wrote:
Dear Frank & Dear all:
Thank you.
I'm familiar with this pdf :-)
But I'm not familiar with mdb :-(. And I'm lack of time to study it now.
Not sure - it's the best way to really gain insight into the kernel ...
I'm reading the opensolaris source code now, more precisly, studying the
detail implementation of DTrace (dtrace cmd, libdtrace, kernel modules).
Again, to see the full picture, looking at the very kernel you run, using
mdb and/or dtrace, tells you how these fit together. It's much quicker
than trying to piece it all together from the sourcecode only.
Since I'm not familiar the implemention of solaris' kernel, it is a big
challenge for me to string all the related procedures together.
That's why you should look at the actual running kernel :)
Currently, I want to know how a trap handler is installed and what the
detail control flow is during handling the breakpoint.
In a word, I am eager to
1, know, How is a trap handler installed/registered?
Not at all, they're compile time.
2, find out, The detail control flow (or say function flow) in the kernel
(from triggering "int $3" to return back to the next instruction after "int
$3")
See previous answer
3, know, Solaris' features when a running process is interrupted/trapped.
e.g. interrputed process is pinned on its CPU.
On x86, "interrupts" below int $20h are not interrupts but traps, and the
handlers for these will not do pinning / passivation. The concepts as such
are in the Solaris Internals book, but as said not relevant wrt. to how
the breakpoint trap is handled.
TIA. It seems I'm naive... very...
No, but you might want to consider loosing the fear of looking at the
running system :) I know it's a big step, but a very helpful one !
FrankH.
Kind Regards,
TJ
2007/12/12, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
On Tue, 11 Dec 2007, �սÝ TaoJie wrote:
Dear all:
In DTrace, when a fbt probe is activated, its related point
(instruction)
would be replaced with "int $3"(opcode: cc).
I refer to "Intel Architecuture Manual" and "Solaris Internals (2nd)",
and
find out that "int $3" is used for breakpoint.
Then, when "int $3" is executed, what would happen? I mean, how does the
kernel handle it?
Try:
idt0::array | ::gate_desc
from within "mdb -k" and follow up the flow of code from there, starting
at entry number three.
And... any recommended related articles?
There's that one:
http://www.opensolaris.org/os/project/czosug/events_archive/czosug2_dtrace_x86.pdf
Check that as a starting point, gives you some ideas how to look into
this.
Caveat: That's two years old. The implementation details (how the trap
dispatches into dtrace) might've changed a bit. The strategy for "how to
dtrace dtrace" has not.
In the source code, what are the related functions and what are the
related source files?
See above.
FrankH.
TIA!
Kind Regards,
TJ
------------------------------------------------------------------------------
No good can come from selling your freedom, not for all the gold in the
world,
for the value of this heavenly gift far exceeds that of any fortune on
earth.
------------------------------------------------------------------------------
------------------------------------------------------------------------------
No good can come from selling your freedom, not for all the gold in the world,
for the value of this heavenly gift far exceeds that of any fortune on earth.
------------------------------------------------------------------------------
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code