This is the mail archive of the cygwin-xfree@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

IOPL, physical memory mapping and the likes.



Looking at the current thread of discussion (/dev/iopl and its
implications) made me remind some things about 9x and NT which may be of
interest to some of you - more than a year ago, in fact, I had a contract 
with a college department which involved giving full permissions to DOS
(DPMI) programs under NT.

Access to either I/O ports or physical memory under 9x is not really an 
issue; in the latter case you have to know where VMM maps the requested
area or to do the mapping yourself - and changing the IOPM, should it
really be necessary, is a snap.

NT is quite different: first of all, there is no way to directly modify
your descriptor tables or IOPM - unless, of course, you are running at
kernel level (i.e., unless you are a KMD/WDM)

I know of the following pieces of code which may be of help:

- MapMem.sys (Micro$oft) allows you to map some memory region in your user
  address space 
- PortIO.sys (Micro$oft as well) uses DeviceIOControl calls to do
  non-memory mapped (port) I/O; both MapMem and PortIO come with full
  source in the NT DDK, and they are the recommended (Micro$oft blessed)
  solution to get your job done
- should you really need to perform INs and OUTs, check for a package
  called "DirectNT", published by the German magazine C&T; it includes
  another package published in a DDJ issue called "TotalIO/GiveIO", and
  both are much interesting to read

Side note: the astute reader has already noticed you _MUST_ have
Administrator rights to install all of these programs, since they are
kernel-mode drivers. DirectX, with all its inconsistences and its
kludginess, is probably the way to go if you really need to run smoothly;
an alternative might be getting your hands on the xlib over Win32 sources
(I have them somewhere) and extending it to encompass all the needed
functionality - this would probably be less performant, but might have a
distinct advantage in the better integration with the underlying (Windows)
environment. 

In any case, I would _STRONGLY_ advice you to get both the 98, the NT 4.0
and the NT 5.0rc1 (Win2k) DDKs - they are free and the documentation you
may find in them makes them extremely worthwhile a thorough check.

Best regards to you all and kudos for your (amazing) work.

	 		Federico Bianchi
			Dipartimento di Storia delle Arti
			Universita` degli Studi di Pisa
			p.zza S.Matteo in Soarta, 2 - 56127 Pisa (Italy)
			tel. +39-050-587111 (cent.), +39-050-587224 (uff.)
			fax. +39-050-580128; e-mail: <f.bianchi@arte.unipi.it>
			===================================================
			!DISCLAIMER!: my e-mail reflects _my_own_ opinions!
			===================================================

PS: sorry for my English, but it's not my first language


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]