Question about segmentation in x80-86
Posted: Thu Jul 06, 2023 1:46 am
I'm actually reading “Understanding the Linux Kernel” by Daniel P Bovet as an introduction to Linux Kernel Development.
As far as I've read, the book focuses on the x80-86 architecture, so segmentation is treated as its part of this architecture.
I'ts said that the Segment Descriptor relative address inside the GDT or LDT is obtained by multiplying the 13-bit index field of the Segment Selector by 8.
The example that's shown is: “if the GDT is at 0×00020000 (the value stored in the gdtr register) and the index specified by the Segment Selector is 2, the address of the corresponding Segment Descriptor is 0×00020000 + (2 × , or 0×00020010.”
If the value of the GDT entry is 0×00020000, how can I get the Segment Selector from that?.
As I understand, 8byte Segment Descriptors are the ones stored in the GDT or LDT.
Other thing that I don't quite understand is the size of the logical address. As I've read, they are composed of a Segment Selector or Segment Number (16 bits) and the 32 bits offset. Is this total address 48 bits in size? Or just 16 bits of Segment Number and 16 bits of Offset.
Thanks in advance for your help, devs.
Asientador.
As far as I've read, the book focuses on the x80-86 architecture, so segmentation is treated as its part of this architecture.
I'ts said that the Segment Descriptor relative address inside the GDT or LDT is obtained by multiplying the 13-bit index field of the Segment Selector by 8.
The example that's shown is: “if the GDT is at 0×00020000 (the value stored in the gdtr register) and the index specified by the Segment Selector is 2, the address of the corresponding Segment Descriptor is 0×00020000 + (2 × , or 0×00020010.”
If the value of the GDT entry is 0×00020000, how can I get the Segment Selector from that?.
As I understand, 8byte Segment Descriptors are the ones stored in the GDT or LDT.
Other thing that I don't quite understand is the size of the logical address. As I've read, they are composed of a Segment Selector or Segment Number (16 bits) and the 32 bits offset. Is this total address 48 bits in size? Or just 16 bits of Segment Number and 16 bits of Offset.
Thanks in advance for your help, devs.
Asientador.