Privileged ring concept

-1

The privileged ring concept is implemented by intel in its hardware.

In Intel's developers manual there are around 15 instructions that need for sure ring 0 to execute .

In OS-books and other resources you can read that most of kernel code is running at ring 0. But it is difficult to understand that the most of these kernel code, is of these 15 instructions.

Will that say that an operating system implement his own virtual protection rings ? (by example, maybe you can see virtual memory management as an component of this) Or more important, what triggers the RPL register to 0 ?

hope you can understand and eventually help,

Thx in advance

benny d

Posted 2018-01-10T03:38:16.283

Reputation: 21

Question was closed 2018-01-13T22:38:14.283

1You imply the wrong way. It’s not “ring 0 => one of the 15 instructions” but rather “one of the 15 instructions => ring 0”. It does not make any statement about other instructions. – Daniel B – 2018-01-10T06:44:28.870

@DanielB don't think thats what the asker is trying to say. English doesn't seem to be their first language. – jdwolf – 2018-01-10T07:01:32.290

Answers

2

Operating systems usually use software interrupts to implement a system called syscall and sysret(urn). The interrupt descriptor table can set if this handler will be elevated to ring 0. This is how the concept of "kernel space" and "user space" is implemented.

x86 also has more flexible concept called call gates. They work by making a function call except as part of this call the global or local descriptor table can change the ring called a far call. Most modern OSes do not use them for compatibility.

jdwolf

Posted 2018-01-10T03:38:16.283

Reputation: 1 974

1

But it is difficult to understand that the most of these kernel code, is of these 15 instructions.

It isn't. Ring 0 has full access to the same instructions that ring 3 has.

What the manual actually means is that ring 0 can use 15 more instructions than ring 3.

user1686

Posted 2018-01-10T03:38:16.283

Reputation: 283 655