home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!munnari.oz.au!mips!decwrl!concert!duke!news.duke.edu!acpub.duke.edu!jan
- From: jan@acpub.duke.edu (Jan Gittelman)
- Newsgroups: comp.os.os2.programmer
- Subject: IOPL summary
- Keywords: IOPL Ring 2 I/O ports
- Message-ID: <4063@news.duke.edu>
- Date: 24 Jul 92 14:43:16 GMT
- Sender: news@news.duke.edu
- Lines: 43
- Nntp-Posting-Host: north1.acpub.duke.edu
-
-
- 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
-