You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
but xv6 uses segments only for the common trick of
implementing per-cpu variables such as
.code proc
that are at a fixed address but have different values
on different CPUs (see
.code-index seginit ).
Implementations of per-CPU (or per-thread) storage on non-segment
architectures would dedicate a register to holding a pointer
to the per-CPU data area, but the x86 has so few general
registers that the extra effort required to use segmentation
is worthwhile.
As far as I understand, all segments in GDT/LDT start from 0 to ffffffff. Thus, they are not used for the described trick. Furthermore, proc is referenced through struct cpu in the cpus[] array (and index in this array is obtained by searching the local APICID).
Therefore, I suggest removing this whole paragraph.
The text was updated successfully, but these errors were encountered:
In mem.t (lines 860-870), it is written:
As far as I understand, all segments in GDT/LDT start from 0 to ffffffff. Thus, they are not used for the described trick. Furthermore, proc is referenced through
struct cpu
in thecpus[]
array (and index in this array is obtained by searching the local APICID).Therefore, I suggest removing this whole paragraph.
The text was updated successfully, but these errors were encountered: