In x86, after we set the PE bit CR0, we do a far JMP to ensure that CS/EIP is changed. When I look at the logic flow in x86 programmers manual, corresponding to this far JMP instruction (protected mode), I see something like this:
Set RPL field of CS register to CPL;
I want to ensure that the privilege level is 0. Assume DPL is also 0 in the descriptor and RPL in the selector in the far JMP is also 0. C bit is 0 in descriptor, so it the nonconforming-code-segment case. The manual says CPL is the last two bits in CS. That means, before the far JMP, the CS should contain a value which has the last two bits as 00. So, when I'm in real mode initially, should I make sure that CS has some value that conforms to this condition before I execute the far JMP? If I were to rephrase this, what is the CPL when we switch from real mode to protected mode?