Thread View: comp.os.os2.programmer
2 messages
2 total messages
Started by Jan Gittelman
Fri, 24 Jul 1992 14:43
IOPL summary
Author: Jan Gittelman
Date: Fri, 24 Jul 1992 14:43
Date: Fri, 24 Jul 1992 14:43
43 lines
1670 bytes
1670 bytes
Summary on IOPL
1. IOPL'd code has to be 16 bit, can't be 32 bit. So for that matter do device
drivers. All 2.0 device drivers according to IBM are 16 bits.
2. To run a 16 bit IOPL routine with 32 bit programs, the user needs to make
the IOPL routines into a DLL. I haven't tried it yet (just using all 16
bits), but no doubt I will soon.
3. IBM does have plans to include inp and outp routines in their next release
of CSET/2.
4. I have managed to get 16 bit versions of inp and outp to run properly using
the following sample from Barry King, who cribbed it from an issue of OS/2
Monthly Magazine. - THANKS MUCHO!
Sample code:
#include <conio.h> // for outp()
int main()
{
outp( 0x60, 0xE9 );
return 0;
}
The .DEF looks like this:
NAME ....
DESCRIPTION ....
PROTMODE
SEGMENTS _IOSEG CLASS 'IOSEG_CODE' iopl
5. I have NOT managed to get my own assembler routines to run in Ring 2. Any
further information would be welcome.
5. There is some documentation and users stating that the DosPortAccess
routine is necessary to actually perform i/o. I've run my code with and
without it and haven't seen a difference.
Thanks to everyone to gave me information.
Jan
Re: IOPL summary
Author: joe2
Date: Fri, 24 Jul 1992 18:43
Date: Fri, 24 Jul 1992 18:43
33 lines
1180 bytes
1180 bytes
In <4063@news.duke.edu> Jan Gittelman writes:
>Summary on IOPL
>
>1. IOPL'd code has to be 16 bit, can't be 32 bit. So for that matter do device
> drivers. All 2.0 device drivers according to IBM are 16 bits.
>
There is another undocumented (yet?) way on OS/2 2.0 : provided
that TESTCFG.SYS is installed, you can use this driver for simple
I/O : use DosDevIOCtl, Category 80h
1) FOr an IN instruction : function 41h
Parameter packet:
USHORT io_address
USHORT data_width (1 for byte, 2 for word, 4 for dword)
Data packet:
ULONG value(value read)
2) For an OUT instruction: function 42h
Parameter packet:
USHORT io_address
USHORT data_width
ULONG value
No data packet
Hope this helps!
-Joel Armengaud
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