Re: Switch from User space to Kernel space.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sanjay Kumar, Noida (sanjayku@xxxxxxxxxxxxxxxxx) wrote:
> The inline assembley code is 
> making a system call ( int $0x80)
> passing system call number (__NR_##name) and argument( arg1) it requires.
> The value returned from the system call is obtained in __res variable 
> a and b denotes eax and ebx registers respectively.
> Basically the inline assembly format is like
>     asm ( assembler template
>               : output operands
>               : input operands);

hi,

As I know, to switch from user to kernel land, parameters are push on
stack and eax contains nr_syscall (number of the system call).
Afterwards, an 0x80 int are generated: (int $0x80).
Now you are in : linux/arch/i386/kernel/entry.S and syscall are choiced
by eax register and kernel sys_ function is called.

If I say some awful mistake, please correct me. I am here to learn :-)
-- 
Amicalement/Regards

Christophe Lucas - c.lucas@xxxxxxxxxxx - Registered User #271267

 * GNU/Linux developer/network administrator
 * Membre du RotomaLUG (LUG de la région Rouennaise)
   (http://www.rotomalug.org)
 * http://odie.mcom.fr/~clucas/

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux