home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / x / xntp3.zip / kernel / README.streams < prev    next >
Text File  |  1991-07-20  |  3KB  |  87 lines

  1. Some kernels don't support additional user defined line disciplines.
  2. Especially notable in this regard is SunOS and System V. They
  3. provide similar support in the form of "Streams". Accordingly,
  4. included in this directory is a pair of STREAMS modules to
  5. replace the line disciplines that provide clock support for
  6. xntpd. Notice that the "clkdefs.h" file is not used in the
  7. original line discipline, but the "chudefs.h" file is the
  8. same one used in the original line discipline.
  9.  
  10. TO INSTALL A NEW STREAMS DRIVER:
  11.  
  12. 1. Copy your choice to /sys/os, removing the "_STREAMS" in the
  13. filename.
  14.  
  15. 2. Copy the appropriate *defs.h file to /usr/include/sys,
  16. then link it (with ln) to /sys/sys.
  17.  
  18. In the following steps, substitute "clk" for "chu" if you're
  19. installing the clk driver.
  20.  
  21. 3. Append to /sys/conf.common/files.cmn:
  22.  
  23. os/tty_chu.c    optional chu
  24.  
  25. 4. Edit /sys/sun/str_conf.c. You'll want to add lines in three
  26. places. It'll be sort of clear where when you see the file.
  27.  
  28. .
  29. .
  30. .
  31. #include "chu.h"
  32. .
  33. .
  34. .
  35. #if NCHU > 0
  36. extern struct streamtab chuinfo;
  37. #endif
  38. .
  39. .
  40. .
  41. #if NCHU > 0
  42.     { "chu", &chuinfo },
  43. #endif
  44. .
  45. .
  46. .
  47.  
  48. At this point, the kernel-making "config [k-name] ; cd ../[k-name] ; make"
  49. should produce a kernel just as it did before. If it fouls up,
  50. something's wrong.
  51.  
  52. 5. Edit /sys/[arch]/conf/[k-name] (substituting the architecture and
  53. kernel name) to stick in:
  54.  
  55. pseudo-device    chu4        # CHU clock support
  56.  
  57. You can change 4 to anything you like. It will limit the number
  58. of instantiations of the chu driver you can use at the same time.
  59.  
  60. 6. Make a new kernel and boot it.
  61.  
  62. HOW TO USE THE CHU STREAMS DRIVER:
  63.  
  64. The driver should act exactly like the line discipline.
  65. After setting the raw mode, and exclusive access (if you want),
  66. pop off all the extra streams, then push the chu module
  67. on. From then on, any reads from the file in question
  68. will return chucode structures as defined in chudefs.h.
  69. Depending on the settings of PEDANTIC and ANAL_RETENTIVE
  70. used when compiling the kernel, some checking of the
  71. data may or may not be necessary.
  72.  
  73. HOW TO USE THE CLK STREAMS DRIVER:
  74.  
  75. First, it should be noted that a new ioctl() has been defined.
  76. The CLK_SETSTR ioctl takes a pointer to a string of no more
  77. than CLK_MAXSTRSIZE characters. Until the first CLK_SETSTR
  78. is performed, the driver will simply pass through characters.
  79. Once it is passed a string, then any character in that string
  80. will be immediately followed by a struct timeval. You can
  81. change the string whenever you want by doing another
  82. CLK_SETSTR. The character must be an exact, 8 bit match.
  83. The character '\000' cannot, unfortunately, be stamped.
  84. Passing an empty string to CLK_SETSTR turns off stamping.
  85. Passing NULL will produce undefined results.
  86.  
  87.