home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 4 Drivers / 04-Drivers.zip / peek.zip / README < prev   
Text File  |  1996-01-05  |  3KB  |  74 lines

  1. readme for peek!
  2. ----------------
  3.  
  4. What is peek?
  5. -------------
  6.  
  7. peek is an OS/2 Physical Device Driver that allows it's user to read/write from IO ports,
  8. map physical memory into the processes address space and to reboot programmatically.
  9.  
  10. It works under OS/2 2.x or Warp.
  11.  
  12. It is intended for all of us who sometimes need to interface to a bit of (possibly self-built) hardware 
  13. from OS/2, and don't want to write an OS/2 pdd for that purpose.
  14.  
  15. It thus violates OS/2 protection mechanism on purpose and should be used with caution.
  16.  
  17. How is it installed?
  18. --------------------
  19.  
  20. add the line:
  21.  
  22. DEVICE=x:\anypath\peek.sys
  23.  
  24. to your config.sys and reboot.
  25.  
  26. How can I use it?
  27. -----------------
  28. The interface of peek can be found in ioctls.h. For an example, look at peek.c, the code for an
  29. interface dll. Basically, open the driver (DosOpen("poke$", <tons of flags>)) and do DosDevIOCTls.
  30. The Category is 0x90 and the function codes range from IOCTL_INBYTE to IOCTL_REBOOT.
  31. For parameters, use the PEEKPARAMETER union. It should be obvious which variant to use.
  32.  
  33. There is a dll called peek.dll which you can use instead of opening the driver and doing 
  34. DosDevIOCtls. A look at peek.h should give you the idea. It comes in source. 
  35. There is also a small test program in source.
  36. The dll can be compiled with the IBM C/Set++, if you want to use another compiler, you will at least
  37. have to modify the dll-initialization/termination. 
  38. The example should compile under any OS/2 32bit compiler.
  39.  
  40. peek! does more or less exactly what is stated above with one noteable exception:
  41.  
  42. peek! unmaps any mappings to physical memory on the process' death, so you don't have to worry
  43. about your page tables getting fu-bared over time when you forget to remove the mapping yourself
  44. (or are prevented from doing so by your process' sudden death).
  45.  
  46. I am not really sure if it is necessary to undo the mapping - it is possible OS/2 would anyway do this
  47. for us, but I wanted to be on the save side. If you positively know it is not necessary, please let me
  48. know. My email address is below.
  49.  
  50. To remember the mapping, the driver uses a fixed (64) sized table. Thus the maximum number of mappings is 64.
  51. If it is exceeded, PeekMapPhysicalAddress will return ERROR_OUT_OF_MAPPINGS (0x42).
  52.  
  53. Warning!
  54. --------
  55.  
  56. If it is not obvious to you that peek! allows you to crash your system seriously in no time at all, 
  57. don't use it! You have been warned!
  58.  
  59. This software is under the GNU Public Library License. See the file COPYING.LIB.
  60.  
  61. The general idea is that you can use peek, modify peek, redistribute peek
  62. (as long as you don't charge more than media costs) and generally do everything you want except
  63. removing the copyright license an blaming me if you totally screwed up your system using peek.
  64.  
  65. Source code fo the driver is available upon request. You will need Watcom 10.5 to compile it.
  66.  
  67. Enjoy,
  68.  
  69. Lars Immisch
  70. lars@ibp.de
  71.  
  72. Tel.: +49 (40) 432565-0
  73. Fax:  +49 (40) 432565-3
  74.