Re: Doubts in System call mechanism in linux

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

 



2010/5/11 Balachandar <bala1486@xxxxxxxxx>:
> Hello,
>   We transit from ring3 to ring0 using 'int' or the new 'syscall/sysenter'
> instruction. Does that mean that the page tables and other stuffs that needs
> to be modified for the kernel is automatically done by the 'int' instruction
> or the interrupt handler for the 'int 0x80' will do the required stuff and
> jump to the respective system call.
>
> Also when returning from a system call, we again need to go to user space.
> For this we need to know the instruction address in the user space to
> continue the user application. Where is that address stored. Does the 'ret'
> instruction automatically changes the ring from ring3 to ring0 or where/how
> this ring changing mechanism takes place?

AFAIK, all the relevant registers will be saved on the stack before
you enter kernel mode. Therefore, when returning to user space the
registers will be refetched from the stack so that the program can
jump to the next instruction address.

>
> Then, i read that changing from ring3 to ring0 is not as costly as changing
> from ring0 to ring3. Why is this so??
>
> Thanks,
>
> Bala



-- 
motzblog.wordpress.com

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[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