Re: system call handling

2000-11-01 Thread Jamie Lokier

Richard B. Johnson wrote:
> If you designed it with just one call-gate, with one entry point,
> you would have exactly what we have now except you would execute
> a `call CALL_GATE` instead of `int 0x80`. This turns out to be
> 6 of one and 1/2 dozen of another when it comes to performance.

The final decider is that `int 0x80' is only two bytes long.

-- Jamie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: system call handling

2000-11-01 Thread Richard B. Johnson

On Wed, 1 Nov 2000 [EMAIL PROTECTED] wrote:

> Hi,
> 
> By looking into the structure of GDT as used by linux kernel(file
> include/asm/desc.c, kernel ver 2.4), it appears as if linux kernel does not
> use the "call gate descriptors" for system call handling. Is this correct?
> 

You could use a call-gate to get from one priv level to another but
Linux uses a software trap (int 0x80). It provides good locality
of the kernel entry code which helps keep caches warm. If you used
call-gates, their entry points would be scattered all over kernel
space. Further, you'd  have a lot of them (as many as there are
kernel functions).

If you designed it with just one call-gate, with one entry point,
you would have exactly what we have now except you would execute
a `call CALL_GATE` instead of `int 0x80`. This turns out to be
6 of one and 1/2 dozen of another when it comes to performance.

Cheers,
Dick Johnson

Penguin : Linux version 2.2.17 on an i686 machine (801.18 BogoMips).

"Memory is like gasoline. You use it up when you are running. Of
course you get it all back when you reboot..."; Actual explanation
obtained from the Micro$oft help desk.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: system call handling

2000-11-01 Thread Petko Manolov

[EMAIL PROTECTED] wrote:
> 
> Hi,
> 
> By looking into the structure of GDT as used by linux kernel(file
> include/asm/desc.c, kernel ver 2.4), it appears as if linux kernel does not
> use the "call gate descriptors" for system call handling. Is this correct?

You're looking at wrong place. Look at linux/arch/i386/kernel/traps.c
 
> If it is correct then how does the system calls are handled by the kernel
> (basically how does the control gets transferred to kernel)? Does the CS of
> linux kernel handles the system calls? what are the advantages of using
> this scheme?

System calls in Linux are performed as an interrupt gate (0x80). It is
not
necessary to use call gate. On i386 arch both are almost identical.


Petkan
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



system call handling

2000-11-01 Thread mdaljeet

Hi,

By looking into the structure of GDT as used by linux kernel(file
include/asm/desc.c, kernel ver 2.4), it appears as if linux kernel does not
use the "call gate descriptors" for system call handling. Is this correct?

If it is correct then how does the system calls are handled by the kernel
(basically how does the control gets transferred to kernel)? Does the CS of
linux kernel handles the system calls? what are the advantages of using
this scheme?

otherwise can anyone give pointers in the kernel source where i can look
into?

Thanks,
daljeet.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: system call handling

2000-11-01 Thread Richard B. Johnson

On Wed, 1 Nov 2000 [EMAIL PROTECTED] wrote:

 Hi,
 
 By looking into the structure of GDT as used by linux kernel(file
 include/asm/desc.c, kernel ver 2.4), it appears as if linux kernel does not
 use the "call gate descriptors" for system call handling. Is this correct?
 

You could use a call-gate to get from one priv level to another but
Linux uses a software trap (int 0x80). It provides good locality
of the kernel entry code which helps keep caches warm. If you used
call-gates, their entry points would be scattered all over kernel
space. Further, you'd  have a lot of them (as many as there are
kernel functions).

If you designed it with just one call-gate, with one entry point,
you would have exactly what we have now except you would execute
a `call CALL_GATE` instead of `int 0x80`. This turns out to be
6 of one and 1/2 dozen of another when it comes to performance.

Cheers,
Dick Johnson

Penguin : Linux version 2.2.17 on an i686 machine (801.18 BogoMips).

"Memory is like gasoline. You use it up when you are running. Of
course you get it all back when you reboot..."; Actual explanation
obtained from the Micro$oft help desk.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: system call handling

2000-11-01 Thread Jamie Lokier

Richard B. Johnson wrote:
 If you designed it with just one call-gate, with one entry point,
 you would have exactly what we have now except you would execute
 a `call CALL_GATE` instead of `int 0x80`. This turns out to be
 6 of one and 1/2 dozen of another when it comes to performance.

The final decider is that `int 0x80' is only two bytes long.

-- Jamie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/