delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/03/18/04:55:53

Date: Thu, 18 Mar 1999 11:53:58 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: "Clark L. Coleman" <clc5q AT cobra DOT cs DOT Virginia DOT EDU>
cc: djgpp AT delorie DOT com
Subject: Re: Inline Assembler/CWSDPR0 (Privileged instructions)
In-Reply-To: <7copjd$mp6$1@murdoch.acc.Virginia.EDU>
Message-ID: <Pine.SUN.3.91.990318115341.22105G-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On 17 Mar 1999, Clark L. Coleman wrote:

> 1) Do I need to compile without debug info?

It shouldn't matter.  The debug info is a special portion of the
executable file, and it only gets accessed by a debugger or `symify'.
So it has no effect on how the program runs (or how it crashes ;-).

> 2) Can you really execute instructions like WRMSR in your own code
> just by using stubedit to force use of CWSDPR0.EXE, or is there more
> to it than that?

CWSDPR0 runs your program at ring 0.  I don't know much about WRMSR
and its constraints, but if all it requires is a ring-0 program, then
CWSDPR0 should be enough.

Note that you need to stubedit your program each time you link it,
since the linking prepends the default stub.  The easiest way to do
this is to make the stubedit step part of your Makefile (assuming you
have one).

> Instead, it raises a fault, which is
> what I would expect when you try to execute a privileged instruction
> (WRMSR) in User Mode, leading me to think that the stubedit was not
> sufficient to permit executing this inline assembly.

Please always post the full symified traceback and the register dump
printed when the program crashes.  There's some valuable info there
that people here could use to help you.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019