0

I have my idtr addressing defined as

gdt_pointer:
    DW 0;size_of_gdt
    DD 0;start_of_gdt

and I can load it with LGDT [gdt_pointer]. But how can I change the contents of gdt later if I have to? Can I use the LGDT instruction again after setting the proper values?

EDIT: I'm planning to keep my gdt_pointer start address same all the time, but I'll be changing the size parameter. Also I'm loading and changing the gdt from 32 bit protected mode.

The amateur programmer
  • 1,238
  • 3
  • 18
  • 38

1 Answers1

2

If you change the contents of the GDT (but leave it at the same address), then you only have to load segment registers that would be effected by the changes (if any).

If you change the (virtual) address of the GDT (but leave its contents the same), then you only have to do lgdt again.

If you change both the (virtual) address of the GDT and its contents, then you'd need to do lgdt and also load any effected segment registers.

Brendan
  • 35,656
  • 2
  • 39
  • 66