home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / os / os2 / programm / 3756 < prev    next >
Encoding:
Text File  |  1992-07-24  |  1.6 KB  |  55 lines

  1. Path: sparky!uunet!munnari.oz.au!mips!decwrl!concert!duke!news.duke.edu!acpub.duke.edu!jan
  2. From: jan@acpub.duke.edu (Jan Gittelman)
  3. Newsgroups: comp.os.os2.programmer
  4. Subject: IOPL summary
  5. Keywords: IOPL Ring 2 I/O ports
  6. Message-ID: <4063@news.duke.edu>
  7. Date: 24 Jul 92 14:43:16 GMT
  8. Sender: news@news.duke.edu
  9. Lines: 43
  10. Nntp-Posting-Host: north1.acpub.duke.edu
  11.  
  12.  
  13. Summary on IOPL
  14.  
  15. 1. IOPL'd code has to be 16 bit, can't be 32 bit. So for that matter do device
  16.    drivers. All 2.0 device drivers according to IBM are 16 bits.
  17.  
  18. 2. To run a 16 bit IOPL routine with 32 bit programs, the user needs to make
  19.    the IOPL routines into a DLL. I haven't tried it yet (just using all 16 
  20.    bits), but no doubt I will soon.
  21.  
  22. 3. IBM does have plans to include inp and outp routines in their next release
  23.    of CSET/2.
  24.  
  25. 4. I have managed to get 16 bit versions of inp and outp to run properly using
  26.    the following sample from Barry King, who cribbed it from an issue of OS/2
  27.    Monthly Magazine. - THANKS MUCHO!
  28.  
  29.    Sample code:
  30.  
  31.    #include <conio.h>      // for outp()
  32.    int main()
  33.    {
  34.        outp( 0x60, 0xE9 );
  35.        return 0;
  36.    }
  37.  
  38.    The .DEF looks like this:
  39.  
  40.    NAME ....
  41.    DESCRIPTION ....
  42.    PROTMODE
  43.    SEGMENTS  _IOSEG CLASS 'IOSEG_CODE' iopl
  44.  
  45.  
  46. 5. I have NOT managed to get my own assembler routines to run in Ring 2. Any
  47.    further information would be welcome.
  48.  
  49. 5. There is some documentation and users stating that the DosPortAccess 
  50.    routine is necessary to actually perform i/o. I've run my code with and 
  51.    without it and haven't seen a difference.
  52.  
  53. Thanks to everyone to gave me information. 
  54. Jan
  55.