Re: Kernel mode programming in VC++



Forget it. This is not possible. There is no "easy solution" of the kind you are hoping
for. You will need to write a device driver, which has to be written in pure C, and which
follows complex rules unrelated to what applications do. You will have to rewrite your
code to open the device driver.

Note that you can't "encapsulate the code" as you think you might be able to; a device
driver follows a massive number of very specific and critical rules and you can't just
throw code at it.

By the way, a device driver does not issue IN and OUT instructions either; it calls the
Hal functions READ_PORT_xxx and WRITE_PORT_xxx where xxx is UCHAR, USHORT, or ULONG.
joe

On Thu, 6 Jul 2006 20:34:41 +0530, "Arun" <arunkumar.v2@xxxxxxxxxxxx> wrote:

Hello Experts,

I have an asm routine which uses privileged instructions like in, out,
cli, etc., I need to execute this as a Win32 application under VC++.
Since the instructions are privileged, I can't execute the same under User
mode as a normal Win32 application, so I have to execute this routine in
kernel mode.

One solution is to encapsulte the routine as a Device driver for Windows &
call the same from the application, but, I am looking out for a easy
solution. Please help...

Thank you.

Regards,
Arun


Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • vgone() calling VOP_CLOSE() -> blocked threads?
    ... In my current TTY design, I hold a count of the amount of ... threads that are sleeping in the line discipline. ... routine, expecting that the device is completely unused. ... The device driver should have a seperate routine to wake ...
    (freebsd-arch)
  • Re: Executing a console program during the startup process like CHKDSK
    ... I suppose a few of those spyware remover were using MoveFileEx to ... >>> annoy spyware program who installs itself as a device driver. ... >>> execute ... >>> it during the startup process, ...
    (microsoft.public.vc.language)
  • Re: [Linux-ATM-General] Kernel 2.6.10 and 2.4.29 Oops fore200e (fwd)
    ... to the fact that device driver send routines ... At any rate someone who has access to the golden code ... > its calling a routine that might sleep while in the transmit routine. ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: kernel module: beginner
    ... to create a device driver for mouse for which I am required to ... understand Kernel module programming..I tried to execute this small ... I am still not able to execute it.. ... Ian Collins. ...
    (comp.lang.c)
  • Re: A question about Serial Port
    ... There is no specific routine in vxWorks to accomplish what you are ... It sounds like something your device driver should ...
    (comp.os.vxworks)