microZEUS
The whole stack, hand-drawn.

◄ Wiki / OS

code-segment selector

An x86 register value that identifies which block of executable memory the CPU is currently running code from.

On x86, segment registers hold selectors that point into tables describing memory regions and their privileges; the code-segment selector designates the region the processor is executing. Its value also encodes the privilege level, so it distinguishes user code from kernel code. When a fault carries a nonsensical code-segment selector, it is a strong hint the CPU jumped somewhere it should never have.

See also

  • CPU exception / trapThe CPU automatically jumping into special handler code when something like a fault or error occurs.
  • calling conventionThe agreed rulebook for how one function passes arguments to another and gets a result back.
  • context switchThe kernel saving one thread's full state and loading another's, so a single CPU can juggle many tasks.

Referenced by

calling convention · CPU exception / trap