Hi! On Sat, Jun 28, 2008 at 4:02 PM, Peter Teoh <htmldeveloper@xxxxxxxxx> wrote: > Looked the last few lines of this: > > http://lkml.org/lkml/2003/7/10/74 > > > I am trying to trying to understand the control path of IDT in userspace vs > kernelspace: > > 1. The patch mentioned NMI can returned back to userspace.....is that > correct? yes...think like this, interrupt can come anytime...whether you're in user mode or kernel mode. So logically, after you're being interrupted, you come back to the place you were interrupted, right? > How and where in the kernel is this return to userspace > controlled/directed? IIRC, entry.S...but i forgot in which directory the file resides. Check the file...i am sure you get the idea... the label like "ret_from_fork" (kinda OOT, just to give you idea) will ease you to make conclusion.. > 2. When in userspace, the IDT table - which have the return address of the > functions in the kernel...cannot be used. So how is the control path of > "int 3" looked like when processes execute it? Userspace will have > exception handling etc....but I think all these processing comes after the > kernel handle the exception right? And these userspace exception are > therefore controlled by kernel - where is it? you were talking about ptrace-ing, right? it's the parent (the one that issued ptrace command) that will check the ptraced process's stack frame and target process' PID. Specifically, in the context of ptrace, it's not just the instruction that's replaced by INT 3, but kernel also deliver SIGCHLD (if I remember correctly) to the ptracing process. That way, the tracing process know the ptraced process has hit the INT 3.... I hope I clear your doubts. regards, Mulyadi. -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ