>Xiangfei Jia wrote:
>On 8086 microprocessors, there are three types of addresses: Logical address, Linear address (or Virtual address), and Physical address. >Logical addresse contains of a segment (segment identifier) and a offset. Each segment is represented by a segment descriptor. All these descriptors are stored either in GDT or LDT. > The Linux kernel only has limited support of semgnets. I also looked at the GDT inside. It seems that all the segments in the table has the access of the full range of the memory. > BUT, the segments are only useful to allow different section of memory in a single process. >My question is (1) does the kernel still use logical address and has to convert from logcial to linear addresses? (2) why the kernel still use the GDT, which is not very useful in the kernel? As u said correctly that linux uses segmentation in a very limited way and it prefers paging to segmentation as memory management is simpler when they share the same set of linear addreses. >(1) does the kernel still use logical address and has to convert from logcial to linear addresses? kernel still uses logical address and need to convert it to linear address. to speed up the translation the 80x86 architechture provides some non programmable registers for each of the six programmable segmentation registers.Each non-programmable register contains the segemnt descriptor specified by segment selector contained in the corresponding sementation register.so when the segment selector is loaded ina segmentation register its segemnt descriptor gets loaded from memory into a non-programmable register.From here we can perform the translation without using GDT or LDT , processor can directly refer to the CPU register containing the descriptor. >(2) why the kernel still use the GDT, which is not very useful in the kernel? Access to the GDT or LDT are necessary only when the contents of the segmentation register change. Thanks & Regards lk
|