i386 registers during a syscall

Divacky Roman xdivac02 at stud.fit.vutbr.cz
Mon Jul 24 08:04:30 UTC 2006


On Sun, Jul 23, 2006 at 11:18:56PM +0200, Attilio Rao wrote:
> 2006/7/23, Divacky Roman <xdivac02 at stud.fit.vutbr.cz>:
> >hi,
> >
> >I need to get content of %esi register as it was during a syscall. Should 
> >I get
> >this info from td->td_pcb->pcb_esi or td->td_frame->tf_esi?
> >
> >Is it so that trapframe is "content of registers when entering a kernel" 
> >and
> >pcb is "when leaving a kernel" ?
> >
> >thnx for info
> 
> pcb and trapframe are used for very different purposes.
> 
> The trapframe is built into the exception handler and it is used as
> 'registers gate' from userspace/kernelspace.
> 
> The pcb (process control block) is used to handle registers saving
> during a context switch, so it seems completely ortogonal to your
> problem.
> 
> BTW, it's unclear to me what do you need...

mov $123, %esi
int $0x80		; syscall

I need the value of %esi (ie. 123)

is td->td_frame->tf_esi what I need?

thnx

roman


More information about the freebsd-hackers mailing list