9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Ronald G Minnich <rminnich@lanl.gov>
To: <9fans@cse.psu.edu>
Subject: Re: [9fans] calculating the gdt pointer in 32 bit (protected) mode
Date: Wed, 23 Jan 2002 20:14:56 -0700	[thread overview]
Message-ID: <Pine.LNX.4.33.0201232010570.14130-100000@snaresland.acl.lanl.gov> (raw)
In-Reply-To: <20020124022401.879EE199E4@mail.cse.psu.edu>

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



  reply	other threads:[~2002-01-24  3:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-24  2:23 Russ Cox
2002-01-24  3:14 ` Ronald G Minnich [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-01-24  3:32 jmk
2002-01-24  1:16 andrey mirtchovski
2002-01-24  0:42 jmk
2002-01-24  0:21 andrey mirtchovski
2002-01-23 23:51 Russ Cox
2002-01-23 23:43 andrey mirtchovski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.33.0201232010570.14130-100000@snaresland.acl.lanl.gov \
    --to=rminnich@lanl.gov \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).