Re: sources of linux 'system call'

Joshua Roys <[email protected]> Thu, 13 Sep 2007 14:47:37 -0400
Newsgroups org.kernel.vger.linux-assembly
Message-ID <[email protected]>
Lukas wrote:
> Thank You for answer ... i'll read this sources ...
> but actualy i want to know what instructions processor
> recive after int. My goal is to understand better GDT,
> IDT, LDT in Linux, i want to know what's going on when
> i call for example 125 system call (sys_mprotect)
> whitch allow me change acces rights to given memory
> area. Theory i know ( almost everything is writen in
> Intel guides ) but i need practice. By the way if
> smoebody knoe how to change acces rigts to memory
> without system calls, please help :)
> 
> regards
> Lukas

Hello,

Take a look at (for i386): arch/i386/kernel/entry.S
Then find a line like: ENTRY(system_call)
That gets set in the IDT in: arch/i386/kernel/traps.c, near the end of
function trap_init()
Specifically: set_system_gate(SYSCALL_VECTOR, &systen_call), where
SYSCALL_VECTOR is defined to be 0x80
And: include/asm-i386/desc.h has some items that may be of interest to you.

Good luck,

Joshua Roys