What I would like to know is :
1) how the value of segment register is filled? by who ?

my understanding is when compile generates the segments for a particular processes, it generates the object code and where some instructon might be loading the value...

actually seg,ent selector points to the gdt.....
how does the compiler know that which value to be put in segment selector so it points to the correct entry in GDT ?

please reply..
thanks.