* sources of linux 'system call'
@ 2007-09-08 16:08 Lukas
2007-09-08 16:40 ` Joshua Roys
0 siblings, 1 reply; 4+ messages in thread
From: Lukas @ 2007-09-08 16:08 UTC (permalink / raw)
To: linux-assembly
Hi.
I'm looking for sources of system calls.
I mean ... what program is exeecute after I call 'int
$0x80' :), for example
movq $125,%rax # call sys_mprotect
movq $smc_address,%rbx
movq $0x1000,%rcx
movq $7,%rdx
int $0x80
?????????????????
?????????????????
i want to ask if enybody knows where can i find it
(they should be somewhere in kernale source, but i
couldn't find it)
Regards
Lukas
____________________________________________________________________________________
Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase.
http://farechase.yahoo.com/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: sources of linux 'system call'
2007-09-08 16:08 sources of linux 'system call' Lukas
@ 2007-09-08 16:40 ` Joshua Roys
2007-09-13 17:52 ` Lukas
0 siblings, 1 reply; 4+ messages in thread
From: Joshua Roys @ 2007-09-08 16:40 UTC (permalink / raw)
To: linux-assembly
Lukas wrote:
> Hi.
> I'm looking for sources of system calls.
> I mean ... what program is exeecute after I call 'int
> $0x80' :), for example
>
> movq $125,%rax # call sys_mprotect
> movq $smc_address,%rbx
> movq $0x1000,%rcx
> movq $7,%rdx
> int $0x80
>
> ?????????????????
> ?????????????????
>
> i want to ask if enybody knows where can i find it
> (they should be somewhere in kernale source, but i
> couldn't find it)
>
> Regards
> Lukas
>
Hi,
Do something like:
~/sources/linux-2.6.22.y> find . -type f -exec grep -H sys_open \{} \;
for the open system call code.. they're all over the place, the system
calls.
sys_open, for example, is in fs/open.c
Good luck,
Joshua Roys
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: sources of linux 'system call'
2007-09-08 16:40 ` Joshua Roys
@ 2007-09-13 17:52 ` Lukas
2007-09-13 18:47 ` Joshua Roys
0 siblings, 1 reply; 4+ messages in thread
From: Lukas @ 2007-09-13 17:52 UTC (permalink / raw)
To: linux-assembly
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
--- Joshua Roys <TheReader06@comcast.net> wrote:
> Lukas wrote:
> > Hi.
> > I'm looking for sources of system calls.
> > I mean ... what program is exeecute after I call
> 'int
> > $0x80' :), for example
> >
> > movq $125,%rax # call sys_mprotect
> > movq $smc_address,%rbx
> > movq $0x1000,%rcx
> > movq $7,%rdx
> > int $0x80
> >
> > ?????????????????
> > ?????????????????
> >
> > i want to ask if enybody knows where can i find it
> > (they should be somewhere in kernale source, but i
> > couldn't find it)
> >
> > Regards
> > Lukas
> >
>
> Hi,
>
> Do something like:
>
> ~/sources/linux-2.6.22.y> find . -type f -exec grep
> -H sys_open \{} \;
>
> for the open system call code.. they're all over
> the place, the system
> calls.
>
> sys_open, for example, is in fs/open.c
>
> Good luck,
>
> Joshua Roys
>
> -
> To unsubscribe from this list: send the line
> "unsubscribe linux-assembly" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at
> http://vger.kernel.org/majordomo-info.html
>
____________________________________________________________________________________
Building a website is a piece of cake. Yahoo! Small Business gives you all the tools to get online.
http://smallbusiness.yahoo.com/webhosting
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: sources of linux 'system call'
2007-09-13 17:52 ` Lukas
@ 2007-09-13 18:47 ` Joshua Roys
0 siblings, 0 replies; 4+ messages in thread
From: Joshua Roys @ 2007-09-13 18:47 UTC (permalink / raw)
To: Lukas; +Cc: linux-assembly
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-09-13 18:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-08 16:08 sources of linux 'system call' Lukas
2007-09-08 16:40 ` Joshua Roys
2007-09-13 17:52 ` Lukas
2007-09-13 18:47 ` Joshua Roys
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).