comp.lang.ada
 help / color / mirror / Atom feed
* Accessing I/O Ports in Windows NT/2000
@ 2002-01-16 22:19 Jeffrey Glenn
  2002-01-17  3:41 ` Steve Doiel
  2002-01-17 15:35 ` Ted Dennison
  0 siblings, 2 replies; 9+ messages in thread
From: Jeffrey Glenn @ 2002-01-16 22:19 UTC (permalink / raw)


I've found that accessing the I/O ports on Windows 9x is rather easy, 
but with Windows NT/2000 input and output instructions are privileged 
and the OS just pulls the plug on your program. I found IO.DLL which is 
supposed to provide I/O port access but it causes an illegal page fault 
when called from an Ada task.

Does anyone know of an Ada solution to accessing I/O ports on Windows 
NT/2000?




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Accessing I/O Ports in Windows NT/2000
  2002-01-16 22:19 Accessing I/O Ports in Windows NT/2000 Jeffrey Glenn
@ 2002-01-17  3:41 ` Steve Doiel
  2002-01-17 15:35 ` Ted Dennison
  1 sibling, 0 replies; 9+ messages in thread
From: Steve Doiel @ 2002-01-17  3:41 UTC (permalink / raw)


There solution that sounds promising at:
  http://www.beyondlogic.org/porttalk/porttalk.htm

I haven't tried it.

SteveD

"Jeffrey Glenn" <jeffrey.glenn@mail1.monmouth.army.mil> wrote in message
news:3C45FC6C.2030208@mail1.monmouth.army.mil...
> I've found that accessing the I/O ports on Windows 9x is rather easy,
> but with Windows NT/2000 input and output instructions are privileged
> and the OS just pulls the plug on your program. I found IO.DLL which is
> supposed to provide I/O port access but it causes an illegal page fault
> when called from an Ada task.
>
> Does anyone know of an Ada solution to accessing I/O ports on Windows
> NT/2000?
>





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Accessing I/O Ports in Windows NT/2000
  2002-01-16 22:19 Accessing I/O Ports in Windows NT/2000 Jeffrey Glenn
  2002-01-17  3:41 ` Steve Doiel
@ 2002-01-17 15:35 ` Ted Dennison
  2002-01-17 21:26   ` Jeffrey Glenn
  2002-01-22  7:47   ` Mats Karlssohn
  1 sibling, 2 replies; 9+ messages in thread
From: Ted Dennison @ 2002-01-17 15:35 UTC (permalink / raw)


Jeffrey Glenn <jeffrey.glenn@mail1.monmouth.army.mil> wrote in message news:<3C45FC6C.2030208@mail1.monmouth.army.mil>...
> I've found that accessing the I/O ports on Windows 9x is rather easy, 
> but with Windows NT/2000 input and output instructions are privileged 

That's right. NT doesn't allow direct access to the hardware from a
user-mode program. If you want to do that, you have to write a Windows
device driver.

> Does anyone know of an Ada solution to accessing I/O ports on Windows 
> NT/2000?

This isn't a language issue, its an OS issue. What you need to figure
out is how to write a device driver for NT-class OS's. Anything you
learn about that can be translated into Ada quite easily.

Good places to get started are the Microsoft DDK website
(http://www.microsoft.com/ddk/ ) , and the newsgroups
comp.os.ms-windows.programmer.drivers
(http://groups.google.com/groups?group=comp.os.ms-windows.programmer.drivers)
and comp.os.ms-windows-programmer.nt.kernel-mode
(http://groups.google.com/groups?group=comp.os.ms-windows.programmer.nt.kernel-mode
).



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Accessing I/O Ports in Windows NT/2000
  2002-01-17 15:35 ` Ted Dennison
@ 2002-01-17 21:26   ` Jeffrey Glenn
  2002-01-18  7:09     ` Michael Bode
                       ` (2 more replies)
  2002-01-22  7:47   ` Mats Karlssohn
  1 sibling, 3 replies; 9+ messages in thread
From: Jeffrey Glenn @ 2002-01-17 21:26 UTC (permalink / raw)



Ted Dennison wrote:

> Jeffrey Glenn <jeffrey.glenn@mail1.monmouth.army.mil> wrote in message news:<3C45FC6C.2030208@mail1.monmouth.army.mil>...
> 
>>I've found that accessing the I/O ports on Windows 9x is rather easy, 
>>but with Windows NT/2000 input and output instructions are privileged 
> 
> That's right. NT doesn't allow direct access to the hardware from a
> user-mode program. If you want to do that, you have to write a Windows
> device driver.
> 
>>Does anyone know of an Ada solution to accessing I/O ports on Windows 
>>NT/2000?
> 
> This isn't a language issue, its an OS issue. What you need to figure
> out is how to write a device driver for NT-class OS's. Anything you
> learn about that can be translated into Ada quite easily.
> 
> Good places to get started are the Microsoft DDK website
> (http://www.microsoft.com/ddk/ ) , and the newsgroups
> comp.os.ms-windows.programmer.drivers
> (http://groups.google.com/groups?group=comp.os.ms-windows.programmer.drivers)
> and comp.os.ms-windows-programmer.nt.kernel-mode
> (http://groups.google.com/groups?group=comp.os.ms-windows.programmer.nt.kernel-mode
> ).

I was (am) hoping that I would not have to learn about writing device 
drivers for Windows NT. I realize that Ada doesn't provide these 
facilities, but I hoped to find that someone had already written such an 
interface/wrapper package. Ada also doesn't support ODBC, TCP/IP, nor 
Windows for that matter, but a lot has been written to bind with them.

Oh well, I guess I have to to be the first one sometimes.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Accessing I/O Ports in Windows NT/2000
  2002-01-17 21:26   ` Jeffrey Glenn
@ 2002-01-18  7:09     ` Michael Bode
  2002-01-18  8:29     ` Dmitry A. Kazakov
  2002-01-18 15:03     ` Ted Dennison
  2 siblings, 0 replies; 9+ messages in thread
From: Michael Bode @ 2002-01-18  7:09 UTC (permalink / raw)


Jeffrey Glenn <jeffrey.glenn@mail1.monmouth.army.mil> writes:

> I was (am) hoping that I would not have to learn about writing device
> drivers for Windows NT. I realize that Ada doesn't provide these
> facilities, but I hoped to find that someone had already written such
> an interface/wrapper package. Ada also doesn't support ODBC, TCP/IP,
> nor Windows for that matter, but a lot has been written to bind with
> them.
> 
> Oh well, I guess I have to to be the first one sometimes.

Maybe sometimes but not this time. You are looking for this:

ftp://ftp.heise.de/pub/ct/ctsi/directnt.zip

This is a generic IO device driver written for NT4. It also works with
NT5/W2k. I've used it only from C/C++ programs yet, but since it is a
driver it is used through Win32 API calls, for which the Ada bindings
exist. I'm not sure if it can be used in commercial software.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Accessing I/O Ports in Windows NT/2000
  2002-01-17 21:26   ` Jeffrey Glenn
  2002-01-18  7:09     ` Michael Bode
@ 2002-01-18  8:29     ` Dmitry A. Kazakov
  2002-01-18 17:22       ` Stephen Leake
  2002-01-18 15:03     ` Ted Dennison
  2 siblings, 1 reply; 9+ messages in thread
From: Dmitry A. Kazakov @ 2002-01-18  8:29 UTC (permalink / raw)


On Thu, 17 Jan 2002 16:26:24 -0500, Jeffrey Glenn
<jeffrey.glenn@mail1.monmouth.army.mil> wrote:

>
>Ted Dennison wrote:
>
>> Jeffrey Glenn <jeffrey.glenn@mail1.monmouth.army.mil> wrote in message news:<3C45FC6C.2030208@mail1.monmouth.army.mil>...
>> 
>>>I've found that accessing the I/O ports on Windows 9x is rather easy, 
>>>but with Windows NT/2000 input and output instructions are privileged 
>> 
>> That's right. NT doesn't allow direct access to the hardware from a
>> user-mode program. If you want to do that, you have to write a Windows
>> device driver.
>> 
>>>Does anyone know of an Ada solution to accessing I/O ports on Windows 
>>>NT/2000?
>> 
>> This isn't a language issue, its an OS issue. What you need to figure
>> out is how to write a device driver for NT-class OS's. Anything you
>> learn about that can be translated into Ada quite easily.
>> 
>> Good places to get started are the Microsoft DDK website
>> (http://www.microsoft.com/ddk/ ) , and the newsgroups
>> comp.os.ms-windows.programmer.drivers
>> (http://groups.google.com/groups?group=comp.os.ms-windows.programmer.drivers)
>> and comp.os.ms-windows-programmer.nt.kernel-mode
>> (http://groups.google.com/groups?group=comp.os.ms-windows.programmer.nt.kernel-mode
>> ).
>
>I was (am) hoping that I would not have to learn about writing device 
>drivers for Windows NT. I realize that Ada doesn't provide these 
>facilities, but I hoped to find that someone had already written such an 
>interface/wrapper package. Ada also doesn't support ODBC, TCP/IP, nor 
>Windows for that matter, but a lot has been written to bind with them.

There was a product by Blue Wave, I believe, called WinRT. It
contained a primitive Windows driver, which allowed you to read/write
arbitrary physical memory locations [= your I/O ports]. I think all
that you will need then is standard Win32 bindings and here you are.

Regards,
Dmitry Kazakov



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Accessing I/O Ports in Windows NT/2000
  2002-01-17 21:26   ` Jeffrey Glenn
  2002-01-18  7:09     ` Michael Bode
  2002-01-18  8:29     ` Dmitry A. Kazakov
@ 2002-01-18 15:03     ` Ted Dennison
  2 siblings, 0 replies; 9+ messages in thread
From: Ted Dennison @ 2002-01-18 15:03 UTC (permalink / raw)


Jeffrey Glenn <jeffrey.glenn@mail1.monmouth.army.mil> wrote in message news:<3C474180.8060306@mail1.monmouth.army.mil>...
> drivers for Windows NT. I realize that Ada doesn't provide these 
> facilities, but I hoped to find that someone had already written such an 
> interface/wrapper package. Ada also doesn't support ODBC, TCP/IP, nor 
> Windows for that matter, but a lot has been written to bind with them.

"Doesn't support" is certinaly not the way I'd put it. Ada was *made*
for doing stuff like this. Sure, device drivers are not part of the
language. But you could say the same for C. In both cases the
facilities for writing them, including interfacing to the OS, are
there. So it would be equally (un)true to say that C does not support
any of that stuff.

> Oh well, I guess I have to to be the first one sometimes.

Someone always has to go first. However, I doubt you are indeed in
that situation. I was only trying to point out that this is not the
place to gather that kind of information. A couple of us here might
happen to know a lot about Windows device drivers, but then a couple
of us here might happen to know a lot about Geneology too. That
wouldn't make this the best place to go for Geneology questions.

If you find out what you need to do (what OS and/or 3-rd party API
routines you need to call), but don't know how to call that stuff from
Ada, this is the place to come to.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Accessing I/O Ports in Windows NT/2000
  2002-01-18  8:29     ` Dmitry A. Kazakov
@ 2002-01-18 17:22       ` Stephen Leake
  0 siblings, 0 replies; 9+ messages in thread
From: Stephen Leake @ 2002-01-18 17:22 UTC (permalink / raw)


dmitry@elros.cbb-automation.de (Dmitry A. Kazakov) writes:

> There was a product by Blue Wave, I believe, called WinRT. 

That's Blue Water, and I have a simple Ada binding to part of WinRT
2.0. You can have it if you'd like; drop me an email.

> It contained a primitive Windows driver, which allowed you to
> read/write arbitrary physical memory locations [= your I/O ports]. I
> think all that you will need then is standard Win32 bindings and
> here you are.

Worked nicely for me. Supports interrupts via some bizarre script
language; didn't look like a good idea, so I didn't play with it.

-- 
-- Stephe



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Accessing I/O Ports in Windows NT/2000
  2002-01-17 15:35 ` Ted Dennison
  2002-01-17 21:26   ` Jeffrey Glenn
@ 2002-01-22  7:47   ` Mats Karlssohn
  1 sibling, 0 replies; 9+ messages in thread
From: Mats Karlssohn @ 2002-01-22  7:47 UTC (permalink / raw)


Ted Dennison wrote:
> 
> Jeffrey Glenn <jeffrey.glenn@mail1.monmouth.army.mil> wrote in message news:<3C45FC6C.2030208@mail1.monmouth.army.mil>...
%<
> > Does anyone know of an Ada solution to accessing I/O ports on Windows
> > NT/2000?
> 
> This isn't a language issue, its an OS issue. What you need to figure
> out is how to write a device driver for NT-class OS's. Anything you
> learn about that can be translated into Ada quite easily.
> 
> Good places to get started are the Microsoft DDK website
%<

I'd add:

ISBN 0-201-69590-1
"Edward N. Dekker, Joseph M. Newcomer
 Developing Windows NT Device Drivers"

to the list... it has proven to be a very good starting point. 

-- 
Mats Karlssohn, developer                         mailto:mats@mida.se  
Mida Systemutveckling AB                          http://www.mida.se
Box 64, S-732 22 ARBOGA, SWEDEN
Phone: +46-(0)589-89808   Fax: +46-(0)589-89809



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2002-01-22  7:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-16 22:19 Accessing I/O Ports in Windows NT/2000 Jeffrey Glenn
2002-01-17  3:41 ` Steve Doiel
2002-01-17 15:35 ` Ted Dennison
2002-01-17 21:26   ` Jeffrey Glenn
2002-01-18  7:09     ` Michael Bode
2002-01-18  8:29     ` Dmitry A. Kazakov
2002-01-18 17:22       ` Stephen Leake
2002-01-18 15:03     ` Ted Dennison
2002-01-22  7:47   ` Mats Karlssohn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox