🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.os2.programmer
Article #91

Re: I/O access problems!

#91
From: Jerry Penner
Date: Sat, 31 Oct 1992 10:04
35 lines
2556 bytes
vess@Cadence.COM (Vess Kavalov) writes:

>I've been trying for some time to access specific I/O ports from my os/2
>application, but every time I have 'access violation' error from the system.

>Well, there are neither inp() nor outp() functions into the standart libraries
>as far as all applications, if not particularly specified, run in run in ring3
>privilege level and have no I/O access rights. So I wrote the twe functions
>in assembly langugae specifying a unique segment name and in the .DEF file
>for the linker I specified this segment as IOPL type and both functions' names
[...]

The problem is you are trying to access the I/O ports from 32-bit
mode.  In the Physical Device Driver Reference (which is at work and
I'm at home so I can't give you the page number) it says you are not
able to do direct I/O from 32-bit protected mode.  You must perform
such I/O in 16-bit protected mode.  Sounds arbitrary?  Tell me about
it.  I spent a good deal of time doing what you were doing before  we
received our manuals late this week and I read that.

IBM, why did you put this restriction in?  And why don't you provide
inp() and outp() functions in a library?  It seems to me that there
are always going to be applications like ours (at work) which need to
access data acquisition boards or some unusual hardware devices which
don't fit into the model of a Physical Device Driver (character/block
mode).  And so it would be nice to write a DLL for these things so
they could be accessed in a way most convenient for the application
software.  Another example is our video overlay board.  There are a
few functions it can provide via IN and OUT operations but it's total
overkill to write a PDD for it.  A small DLL would be just the thing.
(It's also too bad the manufacturers for these boards haven't seen fit
to try to write these things for OS/2, but most of them don't care
about OS/2 at this time).
-- 
Jerry Penner   jpenne@ee.ualberta.ca   Try a 1-line .sig today.
Technical Details
Message-ID: <jpenne.720525871@ee.ualberta.ca>
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!sdd.hp.com!caen!destroyer!cs.ubc.ca!unixg.ubc.ca!kakwa.ucs.ualberta.ca!ee.ualberta.ca!jpenne
References: <1992Oct29.065125.27375@Cadence.COM>

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.os2.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!sdd.hp.com!caen!destroyer!cs.ubc.ca!unixg.ubc.ca!kakwa.ucs.ualberta.ca!ee.ualberta.ca!jpenne
From: jpenne@ee.ualberta.ca (Jerry Penner)
Subject: Re: I/O access problems!
Message-ID: <jpenne.720525871@ee.ualberta.ca>
Keywords: I/O IOPL
Sender: news@kakwa.ucs.ualberta.ca
Nntp-Posting-Host: eigen.ee.ualberta.ca
Organization: University Of Alberta, Edmonton Canada
References: <1992Oct29.065125.27375@Cadence.COM>
Date: Sat, 31 Oct 1992 10:04:31 GMT
Lines: 35