gdt

How is a GDT invoked?

血红的双手。 提交于 2021-02-16 21:50:36
问题 I know how a GDT (Global Descriptor Table) is implemented and the use of segment registers and segment descriptors. However how/when is a GDT entry accessed? Is it accessed in basic mov instructions like mov [eax],ebx Does this implicitly invoke ds segment register and then access the GDT segment descriptor or there is some other way via which access to the GDT entry happens? 回答1: TL;DR : The Global Descriptor Table (GDT) or Local Descriptor Table (LDT) is only accessed when a segment

How is a GDT invoked?

北城余情 提交于 2021-02-16 21:49:25
问题 I know how a GDT (Global Descriptor Table) is implemented and the use of segment registers and segment descriptors. However how/when is a GDT entry accessed? Is it accessed in basic mov instructions like mov [eax],ebx Does this implicitly invoke ds segment register and then access the GDT segment descriptor or there is some other way via which access to the GDT entry happens? 回答1: TL;DR : The Global Descriptor Table (GDT) or Local Descriptor Table (LDT) is only accessed when a segment

Can I print the gdtr and gdt descriptor under gdb?

心不动则不痛 提交于 2019-12-30 23:28:23
问题 I want to use gdb to see my GDTR/LDTR/TTR and segment register invisiable part(x86) so in gdb I enter "p/x $gdtr"....etc but the result is "$6 = Value can't be converted to integer" and in gdb I enter "p/x $cs" the only result is the CS, just visiable part can anyone tell me how to view these value?? thanks for your answer 回答1: If GDB had such a function then this function would only work if GDB was able to read the GDTR using the SGDT instruction. This would mean that GDB had to run in ring

Why do ES and DS zero out eventually on 64 bit kernel when set to TLS selectors?

不羁岁月 提交于 2019-12-07 17:33:49
问题 The 32-bit program below calls set_thread_area(2) to create an entry in GDT, which is meant to be used for TLS. Typically the resulting selector is put into FS or GS and successfully used. But if it is put into DS or ES , running on a 64-bit kernel, eventually (after context switch I guess) this selector zeroes out. But if I instead use modify_ldt(2) and put selector of the resulting LDT entry into these segment registers, they appear to hold their values! Also, if I put e.g. selector of 64

Far jump in gdt in bootloader

亡梦爱人 提交于 2019-12-04 10:56:36
问题 flush_gdt: lgdt [gdtr] jmp 0x08:complete_flush complete_flush: mov ax, 0x10 mov ds, ax mov es, ax mov fs, ax mov gs, ax mov ss, ax ret I am unable to understand what this code does . flush_gdt is a label okay , then lgdt [gdtr] loads the 48-bit pointer in gdtr register and after that from jmp 0x08:complet_flush . What does jmp instruction do ? and then why are we moving 0x10 to ax and then subsequently to other registers 回答1: x86 supports two virtual memory schemes (read about it here):

What is the use of defining a Global Descriptor Table?

为君一笑 提交于 2019-12-03 15:03:18
问题 I read a tutorial on GDT (Global Descriptor Table) which defines GDT as " the one that defines base access privileges for certain parts of memory ". That means GDT is used for memory protection. Does it perform any other tasks other than the above? Is it a must to implement a GDT in an Operating System? In short it would be better if anyone could elaborate on GDT in a way easy to understand. Thanks 回答1: All the images have been taken from Intel Manual 3A, §5.1. For further details the OP

Can I print the gdtr and gdt descriptor under gdb?

帅比萌擦擦* 提交于 2019-12-01 19:51:56
I want to use gdb to see my GDTR/LDTR/TTR and segment register invisiable part(x86) so in gdb I enter "p/x $gdtr"....etc but the result is "$6 = Value can't be converted to integer" and in gdb I enter "p/x $cs" the only result is the CS, just visiable part can anyone tell me how to view these value?? thanks for your answer If GDB had such a function then this function would only work if GDB was able to read the GDTR using the SGDT instruction. This would mean that GDB had to run in ring 0. Neither Linux nor Windows nor Mac OS allows running applications (like GDB) in ring 0 so it will not work