I am a little confused I read from many different sites but it is not clear to me:

Every segment register has a visible part and an inivisible part. The visible part is referred to as the segment selector and there are direct instructions to load the segment selector.

Requester Privilege Level(RPL): this field identifies the privilegel level to provide protected acces to data.

Ok so, I understand that I can use instructions in assembly, for example, to load a selector, but I cant modify the RPL right? where does it come from? How does the CPU choose it? Thanks

有帮助吗?

解决方案

The RPL is actually just the lowest 2 bits of the segment selector, so you can load any priviledge level you want into it (0-3), but if the requested level is higher (lower numerically) than the DPL of the corresponding segment, you'll get a GP fault. This allows a program to easily access a segment with less priviledge than the OS has granted it, if that is relevant for memory mapped I/O or whatever.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top