lgdt from real mode

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
lg

lgdt from real mode

Post by lg »

Hi,
one question about GDT's, hope it's not too stupid
but couldn't really find the answer in intel's documentation.
If i execute lgdt [addr] from real mode, addr specifies the 16 bit offset of the descriptor-like
thingy that points to the GDT, right?
But it's an offset relative to WHICH segment register?
Is it safe to assume DS?

lg
Guest

RE:lgdt from real mode

Post by Guest »

>On 2001-06-18 16:22:08, lg wrote:
>Hi,
>one question about GDT's, hope it's not too stupid
>but couldn't really find the answer in intel's documentation.
>If i execute lgdt [addr] from real mode, addr specifies the 16 bit offset of the descriptor-like
>thingy that points to the GDT, right?
>But it's an offset relative to WHICH segment register?
>Is it safe to assume DS?

LGDT operates the same in real mode and pmode:
lgdt m16&32

From my blue book:
LGDT: loads a linear base address and limit
value from a six-byte data oeprand in memory
into GDTR.

Hope that helps
j.weeks
Chris Giese

RE:lgdt from real mode

Post by Chris Giese »

>On 2001-06-18 16:22:08, lg wrote:
>If i execute lgdt [addr] from real mode, addr specifies the 16 bit offset of the descriptor-like
>thingy that points to the GDT, right?

Correct.

>But it's an offset relative to WHICH segment register?
>Is it safe to assume DS?

Yes, it's DS.

--
geezer@ | pmode tutorial, homebrew OS:
execpc.com | http://www.execpc.com/~geezer/os
Guest

RE:lgdt from real mode

Post by Guest »

Thank you everybody :^)
Crystalline

RE:lgdt from real mode

Post by Crystalline »

>On 2001-06-18 16:22:08, lg wrote:
>Hi,
>one question about GDT's, hope it's not too stupid
>but couldn't really find the answer in intel's documentation.
>If i execute lgdt [addr] from real mode, addr specifies the 16 bit offset of the descriptor-like
>thingy that points to the GDT, right?
>But it's an offset relative to WHICH segment register?
>Is it safe to assume DS?
>
>lg

In my experience its not safe to assume anything, you should always use overrides, but
if you dont override it will usually assume DS
Post Reply