From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ronald G Minnich To: <9fans@cse.psu.edu> Subject: Re: [9fans] calculating the gdt pointer in 32 bit (protected) mode In-Reply-To: <20020124022401.879EE199E4@mail.cse.psu.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Date: Wed, 23 Jan 2002 20:14:56 -0700 Topicbox-Message-UUID: 42edcc12-eaca-11e9-9e20-41e7f4b1d025 On Wed, 23 Jan 2002, Russ Cox wrote: > The lgdt function in l.s is known to work > in 32-bit mode. Have you tried that? Are you sure? I've done lgdt instructions in 32-bit mode before and the l.s version has a few problems: The tgdtptr is not right. For 16-bit mode, a gdtptr looks like this: struct gdtp {unsigned short size; unsigned long base} (PACKED); for 32-bit mode the base becomes a 16:32 type thing, and since 48-bit things are not well handled in C, most people code it as: struct gdtp {unsigned short size; unsigned long long base} (PACKED); The tgdtptr in l.s only reservers a short for the size and a long for the base, and that's too small for 32-bit mode. (see two kernel monte or LOBOS) Anyway, we're tracing the lgdt in l.s with an american arium ICE and it blows the processor out of the water every time we hit it. What I'm doing now is going back and figuring how I ever got this working with LOBOS. I hate Pentiums :-) ron