Doubts in System call mechanism in linux

Posted by bala1486 on Stack Overflow See other posts from Stack Overflow or by bala1486
Published on 2010-05-11T01:34:40Z Indexed on 2010/05/11 1:44 UTC
Read the original article Hit count: 344

Filed under:
|
|

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?

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

© Stack Overflow or respective owner

Related posts about system-call

Related posts about linux