Virtual address

If you are new to OS Development, plan on spending some time here first before going into the other forums.

Moderator:Moderators

Post Reply
Johnblack
Posts:1
Joined:Sat Dec 05, 2009 10:32 am
Virtual address

Post by Johnblack » Sat Dec 05, 2009 10:37 am

Which virtual addresses uses an OS when called by a task ? How can the OS reach the GDT in different virtual addresses space ? What happe to the contents of the segment registers when in a GDT or LDT a descriptor i cancelled changing the the selector index ?

Andyhhp
Moderator
Posts:387
Joined:Tue Oct 23, 2007 10:05 am
Location:127.0.0.1
Contact:

Re: Virtual address

Post by Andyhhp » Sat Dec 05, 2009 10:54 am

Which virtual addresses uses an OS when called by a task ?
Not so simple. The kernel has its own Virtual Address Space. Typically this is an identity map memory which means that Virtual Address is the same value as Physical Address, allowing the kernel to write to anything, even "in" other VASs
How can the OS reach the GDT in different virtual addresses space ?
There is only 1 GDT. That is why its name is the Global Descriptor Table. Typically it is kept in the kernels Virtual Address Space. However, as the GDTR register uses the physical memory address, the concept of the GDT being in a VAS is somewhat pointless.
What happe to the contents of the segment registers when in a GDT or LDT a descriptor i cancelled changing the the selector index ?
The contents of the registers stay the same when you fiddle with the GDT or LDT - the segment caches are only updated when you write a value to a segment register. If however you try to use a segment register where the entry in the GDT/LDT has been fiddled with, you get Exception 11, Segment Not Present, or a GPF if it contains valid, wrong information

~Andrew
Image

Post Reply