Segment Selectors and Segmentation Registers

  • Logical Address is made of two parts
    • Segment Identifier16 bit field called a segment selector points to a segment descriptor (covered next)
      • Index: The index in the GDT or LDT which this segment selector refers to
      • RPL: Represnts either 0 or 3 (kernel or user mode)
      • TI: Whether the table is from a local descriptor table (1) or global descriptor table (0) more on this later
    • Offset: 32 bit field determining offset from the base address of a segment

Segmentation Registers: Stores segment selectors (cs, ss, ds, es, fs, gs)

  • cs: Code segment register, points to a segment which stores program instructions
    • cs makes use of the RPL field marking whether the code is from a kernel/user process
  • ss: Stack segment register, points to a segment which stores a program’s stack
  • ds: Data segment register, points to a segment which contains global/static data
  • es, fs, gs: General purpose registers for arbitrary data segments
Translation from logical to linear address selector points to descriptor

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s