doubt in GDT values
Posted: Mon Apr 06, 2009 8:37 pm
I am writing my own boot loader and a kernel. I was reading through sample boot loaders, and when I was reading the Set GDT sections, i have found the following values ...
Kernel code and data segment, the base and limit was set to 0 - 0xFFFFFFFF
User code and data segment, the base and limit was set to 0 - 0xFFFFFFFF
I knew and understood the values for Access and Granularity ... but both user and kernel segment having same values is what I don't understand .. If my understanding of GDT is correct, the objective of segmentation is primarily for memory protection ... then when Kernel and User segments share the same base address and limit, then where exactly the segmentation comes into picture ?
Sorry, if i didn't understand the concepts very well ... but I am confused in this ...
Kernel code and data segment, the base and limit was set to 0 - 0xFFFFFFFF
User code and data segment, the base and limit was set to 0 - 0xFFFFFFFF
I knew and understood the values for Access and Granularity ... but both user and kernel segment having same values is what I don't understand .. If my understanding of GDT is correct, the objective of segmentation is primarily for memory protection ... then when Kernel and User segments share the same base address and limit, then where exactly the segmentation comes into picture ?
Sorry, if i didn't understand the concepts very well ... but I am confused in this ...