|
-
Mar 18th, 2001, 10:47 AM
#1
Thread Starter
Member
hi, i have very big (for me) problem. i want to write dll in c++ which i can use to acces to hardware in win2000.
in W95/98 i used two functions in delphi - GetPort and SetPort for writing and reading from address. But if i want run this prog in win2000, it appears "Privileg instruction".
function GetPort( P : WORD ) : Byte; assembler;
asm
MOV DX, P;
IN AL, DX;
end;
procedure SetPort( P : WORD; Value : Byte ); assembler;
asm
MOV DX, P;
MOV AL, Value;
OUT DX, AL;
end;
please, do you know how to let my program run correctly ??????
Thanks in advance. Standa
-
Mar 18th, 2001, 12:16 PM
#2
Monday Morning Lunatic
Win2000 is designed for stability, so direct hardware access is forbidden. You'll need to use the API -- see MSDN for details.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Mar 18th, 2001, 12:19 PM
#3
Thread Starter
Member
Access to hardware....
Yes i know about Win2000 stability. But, can yuo say me something more concretly ???
-
Mar 18th, 2001, 12:27 PM
#4
Monday Morning Lunatic
You're using port access, so obviously you need specific hardware access. What hardware is it? NT provides APIs for all the different hardware devices.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Mar 18th, 2001, 12:40 PM
#5
Thread Starter
Member
thank you, but API ??
i need only to send one byte to hardware port and receive very small value. It is old ISA card. Where can i find it in MSDN???
-
Mar 18th, 2001, 12:50 PM
#6
Monday Morning Lunatic
I really can't help much further than point you at MSDN You might want to look at the driver development kit for NT, since drivers are allowed direct hardware access (obviously ). If you wrote a driver for your card then you'd be able to use it. What card is it?
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Mar 19th, 2001, 07:36 AM
#7
Thread Starter
Member
hardware
it is very simple A/D convertor.....
-
Mar 19th, 2001, 01:02 PM
#8
Monday Morning Lunatic
Supplier? Manufacturer? Model number?
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|