🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.os.os2.programmer
4 messages
4 total messages Started by Jan Gittelman Wed, 22 Jul 1992 18:08
IOPL or Accessing hardware ports
#413
Author: Jan Gittelman
Date: Wed, 22 Jul 1992 18:08
21 lines
1285 bytes
Hi,

Has anyone managed to use IOPL to access hardware ports? I'm having trouble 
with it. I get an access violation (SYS3175) whenever the code tries to call 
a subroutine in the IOPL'd (ring 2) segment.

I'm currently using a 16 bit compiler (Microsoft 6.00A) and assembler 
(Microsoft 5.1). There are 6 assembler subroutines that do the actual 
i/o and the rest of the code is written in C. I have a .DEF file to define the
assembler routines segment as IOPL and list the exported subroutines. In fact,
it follows the examples in both Duncan's "Advanced OS/2 Programming" and 
Steven Mastrianni's "Writing OS2 2.0 Device Drivers in C".

If anyone has any suggestions, ideas, or information please mail me 
jan@dukehrl.mc.duke.edu. 

Thank you very much,
Jan Gittelman

PS. If this can be done in 32 bits (C SET/2) I'd like to know that too, since
I'm not having any luck with that either. Thanks.
Re: IOPL or Accessing hardware ports
#427
Author: David Feustel
Date: Wed, 22 Jul 1992 23:39
9 lines
730 bytes
I gave up on trying to solve this problem and went back to writing
code to run in the dos box where i/o isn't restricted.

(See my posting on major Borland C++ bugs in this group).
-- 
Dave Feustel N9MYI <feustel@netcom.com>
---
What's the different between a Salem Witch Hunter and a modern day
Drug Warrior? - 3 centuries.
Re: IOPL or Accessing hardware ports
#439
Author: Kai-Uwe Rommel
Date: Thu, 23 Jul 1992 18:44
32 lines
2063 bytes
In article <4012@news.duke.edu> jan@acpub.duke.edu (Jan Gittelman) writes:
>Hi,
>
>Has anyone managed to use IOPL to access hardware ports? I'm having trouble 
>with it. I get an access violation (SYS3175) whenever the code tries to call 
>a subroutine in the IOPL'd (ring 2) segment.
>
>I'm currently using a 16 bit compiler (Microsoft 6.00A) and assembler 
>(Microsoft 5.1). There are 6 assembler subroutines that do the actual 
>i/o and the rest of the code is written in C. I have a .DEF file to define the
>assembler routines segment as IOPL and list the exported subroutines. In fact,
>it follows the examples in both Duncan's "Advanced OS/2 Programming" and 
>Steven Mastrianni's "Writing OS2 2.0 Device Drivers in C".

I have used IOPL code in my SCRUTIL screen saver. This is a 16-bit
program, and I have not yet tried such things in a 32-bit app. You need
to follow the following steps:

- isolate the code with I/O instructions in one segment (use MS C -NT
  option to give this module a special name instead of _TEXT)
- mark this segment name as IOPL in the module definition file
- use the DosPortAccess call before doing actual port I/O
- set IOPL=YES in config.sys or add the module name to the IOPL list

This is what I did in SCRUTIL and it works under 1.x and 2.0.

Kai Uwe Rommel

/* Kai Uwe Rommel --- rommel@informatik.tu-muenchen.de */

DOS ... is still a real mode only non-reentrant interrupt
handler, and always will be.                -Russell Williams
Re: IOPL or Accessing hardware ports
#447
Author: Brian Taber
Date: Fri, 24 Jul 1992 04:52
17 lines
1069 bytes
feustel@netcom.com (David Feustel) writes:

>I gave up on trying to solve this problem and went back to writing
>code to run in the dos box where i/o isn't restricted.

There is an example program (code) in "Advanced Programmer's Guide to OS/2"
by Thuyen Nguyen and Robert Moskal which shows how to program ports.
The program writes to the timer and speaker ports to play the speaker
at notes of increasing frequency (not using DosBeep). I've tried it
and it seems to work well under 2.0.

I am wondering if anyone has successfully reprogrammed the VGA in a
fullscreen OS/2 session.
Anyone?

Brian Taber
btaber@netcom.com
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads