Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uwm.edu!bionet!agate!ucbvax!bloom-beacon!eru!kth.se!cyklop.nada.kth.se!news From: d88-pfo@dront.nada.kth.se (Peter Forsberg) Newsgroups: comp.os.os2.programmer Subject: Re: OS/2 device drivers Message-ID: Date: 11 Apr 91 21:24:54 GMT References: <1991Apr09.151935.19325@lut.fi> <1991Apr10.211127.13982@hpmcaa.mcm.hp.com> Sender: news@nada.kth.se (Mr News) Organization: Royal Institute of Technology, Stockholm, Sweden Lines: 26 In-reply-to: winter@hpmcaa.mcm.hp.com's message of 10 Apr 91 21:11:27 GMT In article <1991Apr10.211127.13982@hpmcaa.mcm.hp.com> winter@hpmcaa.mcm.hp.com (Kirt Alan Winter) writes: cale@lut.fi (Antti Kirmanen) writes: > > I'm currently trying to write a device driver for OS/2. > My problem is, that I should use inp and outp functions to > communicate with a port. OS/2 programmers reference manual > says, that I should use DosPortAccess() function call but then ... > Program crashes allways in the first outp() or inp() call. > I'm using Microsoft C 6.0 with OS/2 1.1 > > Can anyone help me. A simple example would be great. > Thanks in advance.... The reason that you should use the DosPortAccess() API is *portability*. In OS/2 2.0 32-bit programs neither IOPL-segments, nor the C-functions inp() or outp() will be supported. This is because this is very hardware- specific stuff, and will be hard to support in (possible) future versions of OS/2 on hardware platforms other than the i[34]86 ("New Technology"). Just for your info... / Peter Forsberg (RIT & IBM Sweden) -- _______________________________________________________________________________ Peter Forsberg Royal Institute of Technology, Stockholm, Sweden. Internet: d88-pfo@nada.kth.se ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~