[pso] Tema 1 Linux - Invocare de mana system call
Luis Cazacu
lewisparma at gmail.com
Tue Mar 20 22:15:41 EET 2007
Poti folosi si functia "syscall" pt a invoca un anumit apel de sistem.
syscall(nr_apel,....+lista param.......)
On 3/16/07, Andrei Popa <ca at i-neo.ro> wrote:
>
> On Fri, 2007-03-16 at 00:11 +0200, Alexandru Tudose wrote:
> > Am incercat sa chem de mana un system call (20 - getpid) pentru teste,
> > si am folosit urmatorul cod:
> >
> > --------------------------
> > int pid;
> >
> > __asm__(
> > "movl $20, %eax \n"
> > "int 0x80 \n"
> > "movl %eax, pid \n"
> > );
> > ---------------------------
> >
> >
> > Totusi codul nu compileaza din cauza ca nu as fi invocat corect
> > intreruperea 80 pentru a porni syscall-ul pus in eax.
> >
> > Ma poate ajuta cineva cu un sfat unde gresesc?
>
> __asm__(
> "movl $20, %%eax \n"
> "int $0x80 \n"
> "movl %%eax, %0 \n"
> :"=r"(pid)
> );
>
> vezi: http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html
>
> >
> > Multumesc frumos,
> > Alexandru Tudose.
> >
> > _______________________________________________
> > pso mailing list
> > pso at cursuri.cs.pub.ro
> > http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/pso
> --
> Andrei Popa - 341C3
>
> _______________________________________________
> pso mailing list
> pso at cursuri.cs.pub.ro
> http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/pso
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cursuri.cs.pub.ro/pipermail/pso/attachments/20070320/c976a4fa/attachment-0001.html
More information about the pso
mailing list