when I read some book about linux kernel , it says before linux
enter protected mode,linux set the gdt,and after page was enabled,gdt was set again.why to do this.as I known ,gdt point to the physical address,is there any difference between the two gdt?
thanks for reply!
gdt problem
Re:gdt problem
When paging is set the addresses in the GDT are virtual.
Only the pages contain the physical addresses, the addresses in the GDT refer to virtual addresses.
Only the pages contain the physical addresses, the addresses in the GDT refer to virtual addresses.
Re:gdt problem
but as I known,there is only one gdt.and the cr1 is in the
gdt table,can gdt be virtual address
gdt table,can gdt be virtual address
Re:gdt problem
Yes, there's only one GDT, the GDT is rebuilt, and they then change the GDTR, GDTR is physical.ocean390 wrote: but as I known,there is only one gdt.and the cr1 is in the
gdt table,can gdt be virtual address
Re:gdt problem
The GDTR base, and all base addresses in descriptors, are linear, not physical. So if you have paging enabled, and you use the LGDT instruction, you will need to use a virtual address. If you do not have paging enabled, you will need to use a physical address.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:gdt problem
another thing: even if modifying GDT registers or contents could have been avoided when activating paging, it's common to replace the GDT while initializing the kernel, in order to offer more space in the GDT, or to get rid of a bootloader-installed GDT, or whatever ...