The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: Ash on February 02, 2009, 12:55:32 PM

Title: load TSS selector in GS -> GPF
Post by: Ash on February 02, 2009, 12:55:32 PM
Hi,

is it normal that I get a GPF when I load a TSS selector into a normal (ds, gs...) segment register?

I thought it would be handy to have the GS segment register in my OS always point to the current TSS and not waste another entry in the GDT for this purpose.

TIA,
Ash
Title: Re: load TSS selector in GS -> GPF
Post by: japheth on February 02, 2009, 06:17:15 PM
Quote from: Ash on February 02, 2009, 12:55:32 PM
is it normal that I get a GPF when I load a TSS selector into a normal (ds, gs...) segment register?
Yes.
Title: Re: load TSS selector in GS -> GPF
Post by: Ash on February 02, 2009, 06:27:40 PM
Quote from: japheth on February 02, 2009, 06:17:15 PMYes.

Thank you, at least I now know that it's not a bug.  :wink

Ash
Title: Re: load TSS selector in GS -> GPF
Post by: Tedd on February 02, 2009, 07:25:35 PM
The segment registers hold segment selectors, the TSS still requires a descriptor in the GDT.
You then set its selector in the task-register (with LTR) - which caches the address of the TSS using the descriptor.