|
From: Nicholas N. <nj...@ca...> - 2004-02-25 11:30:10
|
Hi,
I just learnt about segment registers properly for the first time. Now I
see what the fuss is all about. I have some questions about them, I would
appreciate answers from any kind soul...
- Who uses them? Some ordinary apps, I guess... does glibc, or other
relevant libraries?
- AFAICT, we virtualise the LDT, but not the GDT(?) Linux has the
modify_ldt() syscall, does it not use the GDT at all so we don't have to
worry about it, or is there something else happening?
- if segment registers are in use, if I print a pointer, I'm really only
printing the offset within the current segment, rather than the true
virtual address, right? (Which is why V must convert it, for the skin's
sake.)
- AFAICT, the following is true
- %cs is implicit operand to every instruction fetch?
- %ss is implicit operand to every stack instruction?
- %ds is implicit operand to all non-stack, non-string ops?
- %es is implicit operand to string ops?
- segment overrides are required to use %fs, %gs
When segment overrides are used, the GETSEG/USESEG pair is used to
convert far pointers to flat addresses. That's fine. But what happens
when there is no segment override? Eg. if we set %ds, which affects
most ops, are GETSEG/USESEG pairs introduced then?
Thanks.
N
|