* IO-PORTS
@ 2002-05-13 14:15 Qwerty
2002-05-13 14:21 ` IO-PORTS Preben Randhol
2002-05-13 16:47 ` IO-PORTS Stephen Leake
0 siblings, 2 replies; 10+ messages in thread
From: Qwerty @ 2002-05-13 14:15 UTC (permalink / raw)
Hi,
I have to make an ADA-program for school. The program requires to
connect 2 computers and to let them communicate through the COM1-port.
How do you read/write from/to the COM1-port. It must be programmed on a
low level. So we have to read/write directly from/to the IOports with
adresses 16#03F8# to 16#03FD#.
How do you do that in Ada ?
Thanx,
Alexander
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: IO-PORTS
2002-05-13 14:15 IO-PORTS Qwerty
@ 2002-05-13 14:21 ` Preben Randhol
2002-05-13 14:31 ` IO-PORTS Qwerty
2002-05-13 16:47 ` IO-PORTS Stephen Leake
1 sibling, 1 reply; 10+ messages in thread
From: Preben Randhol @ 2002-05-13 14:21 UTC (permalink / raw)
On Mon, 13 May 2002 16:15:19 +0200, Qwerty wrote:
> Hi,
>
> I have to make an ADA-program for school. The program requires to
> connect 2 computers and to let them communicate through the COM1-port.
>
> How do you read/write from/to the COM1-port. It must be programmed on a
> low level. So we have to read/write directly from/to the IOports with
> adresses 16#03F8# to 16#03FD#.
>
> How do you do that in Ada ?
What does your text book say?
Preben
--
"Jeg tror nordmenn har glemt hvordan de tilbreder fisk. De er mest
opptatt av firkantet fisk."
-- Kristian Kristiansen, yrkesfisker, aftenposten.no 19/04/02
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: IO-PORTS
2002-05-13 14:21 ` IO-PORTS Preben Randhol
@ 2002-05-13 14:31 ` Qwerty
0 siblings, 0 replies; 10+ messages in thread
From: Qwerty @ 2002-05-13 14:31 UTC (permalink / raw)
Preben Randhol wrote:
> On Mon, 13 May 2002 16:15:19 +0200, Qwerty wrote:
>
>>Hi,
>>
>>I have to make an ADA-program for school. The program requires to
>>connect 2 computers and to let them communicate through the COM1-port.
>>
>>How do you read/write from/to the COM1-port. It must be programmed on a
>>low level. So we have to read/write directly from/to the IOports with
>>adresses 16#03F8# to 16#03FD#.
>>
>>How do you do that in Ada ?
>
>
> What does your text book say?
>
> Preben
It's not in it :(
Alexander
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: IO-PORTS
2002-05-13 14:15 IO-PORTS Qwerty
2002-05-13 14:21 ` IO-PORTS Preben Randhol
@ 2002-05-13 16:47 ` Stephen Leake
2002-05-13 18:06 ` IO-PORTS Qwerty
` (2 more replies)
1 sibling, 3 replies; 10+ messages in thread
From: Stephen Leake @ 2002-05-13 16:47 UTC (permalink / raw)
Qwerty <alexanderdupont@yahoo.com> writes:
> Hi,
>
> I have to make an ADA-program for school. The program requires to
> connect 2 computers and to let them communicate through the COM1-port.
>
> How do you read/write from/to the COM1-port. It must be programmed on
> a low level. So we have to read/write directly from/to the IOports
> with adresses 16#03F8# to 16#03FD#.
>
> How do you do that in Ada ?
What operating system are you using? Since you say "COM1", it's
probably either DOS or Windows.
If DOS, I have no idea. If Windows, you can use my com ports package,
assuming it's ok for you to reuse stuff off the net:
http://users.erols.com/leakstan/Stephe/Ada/win32_com_ports.zip
But this does not "write directly to the IO port". You can't do that
in Windows!
--
-- Stephe
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: IO-PORTS
2002-05-13 16:47 ` IO-PORTS Stephen Leake
@ 2002-05-13 18:06 ` Qwerty
2002-05-13 18:37 ` IO-PORTS Sergey Koshcheyev
` (2 more replies)
2002-05-13 18:14 ` IO-PORTS Darren New
2002-05-13 18:16 ` IO-PORTS tmoran
2 siblings, 3 replies; 10+ messages in thread
From: Qwerty @ 2002-05-13 18:06 UTC (permalink / raw)
I'm using DOS & Linux (it is not possible in windows to do that
directly, as you 've said). It's not ok to use a package, I really have
to do it myself. But thanks anyway for the help.
Alexander
Stephen Leake wrote:
> Qwerty <alexanderdupont@yahoo.com> writes:
>
>
>>Hi,
>>
>>I have to make an ADA-program for school. The program requires to
>>connect 2 computers and to let them communicate through the COM1-port.
>>
>>How do you read/write from/to the COM1-port. It must be programmed on
>>a low level. So we have to read/write directly from/to the IOports
>>with adresses 16#03F8# to 16#03FD#.
>>
>>How do you do that in Ada ?
>
>
> What operating system are you using? Since you say "COM1", it's
> probably either DOS or Windows.
>
> If DOS, I have no idea. If Windows, you can use my com ports package,
> assuming it's ok for you to reuse stuff off the net:
>
> http://users.erols.com/leakstan/Stephe/Ada/win32_com_ports.zip
>
> But this does not "write directly to the IO port". You can't do that
> in Windows!
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: IO-PORTS
2002-05-13 18:06 ` IO-PORTS Qwerty
@ 2002-05-13 18:37 ` Sergey Koshcheyev
2002-05-13 19:18 ` IO-PORTS Michal Nowak
2002-05-13 19:27 ` IO-PORTS Jeffrey Carter
2 siblings, 0 replies; 10+ messages in thread
From: Sergey Koshcheyev @ 2002-05-13 18:37 UTC (permalink / raw)
"Qwerty" <alexanderdupont@yahoo.com> wrote in message
news:3CE000C0.4020602@yahoo.com...
> I'm using DOS & Linux (it is not possible in windows to do that
> directly, as you 've said). It's not ok to use a package, I really have
> to do it myself. But thanks anyway for the help.
You have to use machine code insertions, the exact syntax depends on what
compiler you use. For GNAT, there was a tutorial somewhere on
http://www.adapower.com/.
Sergey.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: IO-PORTS
2002-05-13 18:06 ` IO-PORTS Qwerty
2002-05-13 18:37 ` IO-PORTS Sergey Koshcheyev
@ 2002-05-13 19:18 ` Michal Nowak
2002-05-13 19:27 ` IO-PORTS Jeffrey Carter
2 siblings, 0 replies; 10+ messages in thread
From: Michal Nowak @ 2002-05-13 19:18 UTC (permalink / raw)
On 2002-05-13 at 20:06 Qwerty wrote:
>I'm using DOS & Linux
Concerning Linux, you should find something interesting at:
http://www.pegasoft.ca/homes/book.html
That's really good resource of Ada Linux information.
Happy Ada programming,
Mike
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: IO-PORTS
2002-05-13 18:06 ` IO-PORTS Qwerty
2002-05-13 18:37 ` IO-PORTS Sergey Koshcheyev
2002-05-13 19:18 ` IO-PORTS Michal Nowak
@ 2002-05-13 19:27 ` Jeffrey Carter
2 siblings, 0 replies; 10+ messages in thread
From: Jeffrey Carter @ 2002-05-13 19:27 UTC (permalink / raw)
Qwerty wrote:
>
> I'm using DOS & Linux (it is not possible in windows to do that
> directly, as you 've said). It's not ok to use a package, I really have
> to do it myself. But thanks anyway for the help.
In DOS, you have a couple of options
1. Use a package supplied by the compiler vendor to access the IO ports.
2. Write a machine code insertion to access the IO ports
You may also be able to open a file named "COM1:", but may have trouble
reading and writing from the same port.
--
Jeff Carter
"Now go away or I shall taunt you a second time."
Monty Python & the Holy Grail
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: IO-PORTS
2002-05-13 16:47 ` IO-PORTS Stephen Leake
2002-05-13 18:06 ` IO-PORTS Qwerty
@ 2002-05-13 18:14 ` Darren New
2002-05-13 18:16 ` IO-PORTS tmoran
2 siblings, 0 replies; 10+ messages in thread
From: Darren New @ 2002-05-13 18:14 UTC (permalink / raw)
Stephen Leake wrote:
> But this does not "write directly to the IO port". You can't do that
> in Windows!
You can do it in Win98, but not the multi-user windows OSes like
Win2000.
--
Darren New
San Diego, CA, USA (PST). Cryptokeys on demand.
** http://home.san.rr.com/dnew/DNResume.html **
The 90/10 rule of toothpaste: the last 10% of
the tube lasts as long as the first 90%.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: IO-PORTS
2002-05-13 16:47 ` IO-PORTS Stephen Leake
2002-05-13 18:06 ` IO-PORTS Qwerty
2002-05-13 18:14 ` IO-PORTS Darren New
@ 2002-05-13 18:16 ` tmoran
2 siblings, 0 replies; 10+ messages in thread
From: tmoran @ 2002-05-13 18:16 UTC (permalink / raw)
> What operating system are you using? Since you say "COM1", it's
> probably either DOS or Windows.
>...
> But this does not "write directly to the IO port". You can't do that
> in Windows!
If you really want to write directly you'll need to use the CPU's IO
instructions. Look at your compiler's docs for their library routines
for that. If your compiler lacks such a library, you'll have to use
Machine Code Insertions. IIRC you can access the COM ports directly in
Windows 95 - from the "DOS box" at the least. Windows may emulate the
IO instructions so speed might be a problem. To get *useful* access
under Windows you need to write a Windows Device Driver.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2002-05-13 19:27 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-13 14:15 IO-PORTS Qwerty
2002-05-13 14:21 ` IO-PORTS Preben Randhol
2002-05-13 14:31 ` IO-PORTS Qwerty
2002-05-13 16:47 ` IO-PORTS Stephen Leake
2002-05-13 18:06 ` IO-PORTS Qwerty
2002-05-13 18:37 ` IO-PORTS Sergey Koshcheyev
2002-05-13 19:18 ` IO-PORTS Michal Nowak
2002-05-13 19:27 ` IO-PORTS Jeffrey Carter
2002-05-13 18:14 ` IO-PORTS Darren New
2002-05-13 18:16 ` IO-PORTS tmoran
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox