README.TXT 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. Build & Run Instructions:
  2. -------------------------
  3. The MONO sample is composed of a simple monolithic export driver
  4. and a Win32 test application. The Win32 app retrieves a handle to
  5. the driver/device by calling CreateFile("\\.\MONO", ...), where MONO
  6. is a Win32 alias (or "symbolic link") for \Device\Mono, and
  7. subsequently sends it I/O requests (IOCTLs) to have it perform I/O
  8. on it's behalf.
  9. NOTE: MONO is intended to be a generic monolithic driver sample;
  10. it just happens that it was coded to support a monochrome
  11. video adapter.
  12. Microsoft does not recommend the use this sample as a
  13. template for video driver development. We encourage developers
  14. to code within the stated video model; doing so will insure
  15. compatibility & portability, lessen development time,
  16. and produce smaller and more supportable code.
  17. As mentioned above, MONO is an export driver; it provides a
  18. MonoDbgPrint() API which may be called by other kernel mode drivers
  19. that include a prototype & link with MONO.LIB, e.g. by adding
  20. "TARGETLIBS=$(BASEDIR)\lib\*\mono.lib" to the sources file.
  21. (This can make single machine driver debugging a little more bearable.
  22. Note that the load order of the driver can be varied by changing
  23. the Start value in the registry, 0 being the earliest starting
  24. value. See Chapter 16 of the Kernel-mode Driver Design Guide for
  25. mode information on driver load ordering.)
  26. There are currently three export drivers that ship with NT (i.e.
  27. VIDEOPRT.SYS and SCSIPORT.SYS); these represent the port side of
  28. the port/miniport driver model. The idea of this model is to split
  29. the OS-specific functionality into a common port driver, while the
  30. H/W specific functionality resides in the miniport driver. This
  31. way, miniports remain portable across various platforms & systems,
  32. and a single port driver can service several miniports on a particular
  33. platform.
  34. The Win32 portion contains a file, MONOTEST.C, which attempts to
  35. obtain a handle to MONO & send it IOCTLs. The executable is built
  36. using the Windows NT SDK. First update the environment and path
  37. by running <mstools>\setenv.bat. Then change to the directory
  38. where you have the C source code and the makefile. Type
  39. "nmake /f monotest.mak" to compile the Win32 program, MONOTEST.EXE.
  40. The kernel driver portion contains the driver source code, MONO.C
  41. and a text file used to configure your registry so that the driver
  42. can be loaded. The driver is built using the Windows NT DDK.
  43. To build the driver:
  44. 1. Assuming you have run <sdk_root>\setenv.bat and
  45. <ddk_root>\setenv.bat, build the driver by typing:
  46. build -cef
  47. (If there are any errors have a look at the build.log, build.err,
  48. and build.wrn files to get an idea of what went wrong.)
  49. 2. Copy the newly built driver, <ddk_root>\lib\*\MONO.SYS to the
  50. <nt_root>\system32\drivers\ directory, i.e.:
  51. copy \ntddk\lib\i386\free\mono.sys c:\winnt\system32\drivers\
  52. 3. Update the registry by running regini.exe on the mapmem.ini
  53. file, i.e.:
  54. regini mono.ini
  55. This adds a MONO driver key under the HKEY_LOCAL_MACHINE\
  56. SYSTEM\CurrentControlSet\Services tree in the registry. You
  57. can verify this by starting REGEDIT.EXE and looking in the
  58. appropriate place.
  59. 4. Reboot.
  60. 5. Type:
  61. net start mono
  62. ...and then execute MONOTEST.EXE.