TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Alessandro Poppi
from: Andrew Grillet
date: 1998-10-22 08:01:44
subject: GCC

Hi Alessandro,

-=> On 19 Oct 98  23:53:15 Alessandro Poppi said to Paul Hildebrandt <=-

 AP> Hello Paul.


 AP> A simple question: is there any possibility to access directly ad
 AP> hardware I/O port, with or without an (in-line?) assembly instruction? 

It is possible, but not trivial. The point of protected mode software
is that the hardware is protected from people doing this!

The technique is to create a 'ring 2' DLL which accesses the port, and call 
it from the main program. AFAICR, the instructions for doing this are on 
Hobbes. You can write your ring 2 DLL in C. 

The other alternative is to write a device driver, which can also be done 
in C. This is necessary if you are handing interrupts or DMA. It is a good
idea if you do anything which needs to turn interrupts off. 

Generally, if you have a hardware I/O port to write to, you should have
some software that came with it to do this for you. 

If you are building hardware, or providing OS/2 support for someone else's 
it may be that writing a DD is the right answer.

Andrew

... Sanity not found.  Abort, Ignore, Retry, Fail?
--- Blue Wave/Max v2.30 [NR]
* Origin: Me/2 (2:254/259)
SEEN-BY: 396/1 632/0 371 633/210 260 267 270 371 635/506 728 639/252 670/218
@PATH: 254/259 255/1 251/25 396/1 633/260 635/506 728 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.