Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Linux never used 286 style segmentation for separating processes, or otherwise making the virtual memory interestingly segmented, but rather used 386 style paging from the beginning. Transfer to kernel mode (syscall) used to be a simple <code>int</code> instruction which transfered execution according to the interrupt table and caused the CPU to enter the kernel mode (protection level 0). However, the CPU still had to reload segment descriptors to "learn" the new protection level and where the new segment is (although it was always the same dummy kernel mode segment which the CPU just "didn't know".).</p> <p>AMD and Intel came forward with <a href="http://www.codeguru.com/cpp/misc/misc/system/article.php/c8223/System-Call-Optimization-with-the-SYSENTER-Instruction.htm" rel="nofollow">optimized instructions</a> to make this process faster and this is what all operating systems on this platform use in reality.</p> <p>Kernel code then has to do even more work to save registers on the stack and initialize them to new values, and this has not changed. But this is normally not understood to be a part of the system call process.</p> <blockquote> <p>When system call is made, is previlege level checked using code segment registers or control register are used?</p> </blockquote> <p>The privilege level is <em>obtained</em>, not checked, from the <em>new</em> code segment as referenced through the interrupt table - or, in the optimized case, as pre-loaded into a MSR (a CPU register not accessible by non-kernel code).</p> <p>Another way of saying the same is that the switch to level 0 happens automatically on CPU level, but the segment descriptors and/or MSRs need to be prearranged by the kernel in a way that really results in kernel executing the trap handler and not just a general protection fault.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload