Re: Need help in understanding x86 syscall

Zwane Mwaikambo
2005-08-11T20:33:23Z

On Thu, 11 Aug 2005, Steven Rostedt wrote:

> On Thu, 2005-08-11 at 13:46 -0400, linux-os (Dick Johnson) wrote:
>
> >
> > I was talking about the one who had the glibc support to use
> > the newer system-call entry (who's name can confuse).
> >
> > You are looking at code that uses int 0x80. It's an interrupt,
> > therefore, in the kernel, once the stack is set up, interrupts
> > need to be (re)enabled.
>
> int is a call to either an interrupt or exception procedure. 0x80 is
> setup in Linux to be a trap and not an interrupt vector. So it does
> _not_ turn off interrupts.

It's actually a vector, that's all you can install in the IDT. Also a trap
doesn't advance the instruction pointer, so you resume at the trapping
instruction (e.g. vector 14/page fault), 0x80 is an interrupt gate. One
of the distinguishing differences is that 0x80 may be entered via int
0x80 from all ring levels. The reason why int 0x80 doesn't disable
interrupts is because issuing int 0x80 directly is similar to doing a far
call and therefore doesn't have the same effect as a real interrupt being
issued.