Re: Help - inline assembly in driver code



Thanks Don. I'll do that! I appreciate the guidance.

"Don Burn" wrote:

I haven't looked at the VMX capability, but in general if you need to muck
at that level, make yourself some simple primatives, that do just the
function involved. For instance, things to read an MSR, and read/write
CR4. Then use C for the code around the primatives, this keeps things
simple enough if you need to move to x64 you can rewrite these small
functions to an assembler file.


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
http://www.windrvr.com
Remove StopSpam from the email to reply


"hypervista@xxxxxxxxxxxxxxxxx"
<hypervistanewsgroupsnospam@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:A2703F92-5DBF-4D6D-8B85-8F20C39CD623@xxxxxxxxxxxxxxxx
Thanks. That explains why call KdPrint doesn't work.

Perhaps I need to provide more explaination ....

I'm experimenting with the VMX features of the new Intel processors. I
have
to check and perhaps set a particular bit in CR4. I also have to check
several MSRs (rdmsr) before finally calling VMXON.

Can you point me in the right direction given inline assembly limits me
to
32-bit drivers and how can I safely perform the necessary steps in
getting to
VMXON?

Thank you for such a quick reply to my first question, Don.

"Don Burn" wrote:

Well it doesn't help that KdPrint is a #define not a routine. Also, of
course you realize that inline assembler only works on 32-bit and so
your
driver is limited. Finally, you mention editing control registers, this
typically results in crashes or security breaches.


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
http://www.windrvr.com
Remove StopSpam from the email to reply



"hypervista@xxxxxxxxxxxxxxxxx"
<hypervistanewsgroupsnospam@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:6BB3CBA5-6B27-4683-A7DF-DCE4FA483EC5@xxxxxxxxxxxxxxxx
I need to perform cpuid, rdmsr, and edit a variety of control
registers.
I'm
writing a software only device driver (my first) beause many of these
actions
require ring 0 privelege.
I have a basic driver working and am in the process of coding the
inline
assembly portions. I've started with the cpuid code. I want to do
some
kernel debug printing to check that all is going well. I'm haivng
difficulty
with "call KdPrint(("blah blah\n")) in my inline assembly code. I'm
getting
build errors when the "call KdPrint" is included. Everything builds
properly
without the call KdPrint.
Any help will be greatly appreciated.






.



Relevant Pages

  • Re: How do you make a WDF driver create .Raw & .Translated resourc
    ... Don Burn (MVP, Windows DDK) ... Windows 2k/XP/2k3 Filesystem and Driver Consulting ... provide you with the resources. ...
    (microsoft.public.development.device.drivers)
  • Re: Help - inline assembly in driver code
    ... Then use C for the code around the primatives, ... Don Burn (MVP, Windows DDK) ... Windows 2k/XP/2k3 Filesystem and Driver Consulting ... course you realize that inline assembler only works on 32-bit and so ...
    (microsoft.public.win32.programmer.kernel)
  • Re: controlling a filter driver
    ... Don Burn (MVP, Windows DDK) ... Windows 2k/XP/2k3 Filesystem and Driver Consulting ... interested IRPs and let the rest of the IRPs slip down to the stack. ...
    (microsoft.public.development.device.drivers)
  • Re: Can kernel mode call Win32 API ?
    ... very similar to the Win32 functions. ... Don Burn (MVP, Windows DDK) ... Windows 2k/XP/2k3 Filesystem and Driver Consulting ...
    (microsoft.public.development.device.drivers)
  • Re: DDK calls from application
    ... Don Burn (MVP, Windows DDK) ... Windows 2k/XP/2k3 Filesystem and Driver Consulting ... have to worry about multiple callbacks and queuing ...
    (microsoft.public.development.device.drivers)