assemblyx86protected-modegdt

What will happen if the GDT is changed as the program is executing?


What will happen if the GDT is changed as the program is executing? Is there any physical register or anything else that monitors whether the GDT is changed when executing program?


Solution

  • Nothing will change until something tries to fetch from the GDT. This could be a load to segment register, an interrupt, far call/return, etc..

    Between these occasions the segment register's shadow part keeps the descriptor that was referenced by the selector last loaded into this register.