home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / vmsnet / internal / 1297 < prev    next >
Encoding:
Internet Message Format  |  1992-09-08  |  7.3 KB

  1. Path: sparky!uunet!usc!news.service.uci.edu!unogate!mvb.saic.com!macro32
  2. From: "(Jon Pinkley, Westinghouse (216)486-8300 x1335)"
  3. Newsgroups: vmsnet.internals
  4. Subject: RE: moving DDT for CDdriver etc.
  5. Message-ID: <9209080509.AA10402@relay2.UU.NET>
  6. Date: Tue, 8 Sep 92 00:10:49 -0400
  7. Organization: Macro32<==>Vmsnet.Internals Gateway
  8. X-Gateway-Source-Info: Mailing List
  9. Lines: 155
  10.  
  11. Glenn Everhart, Everhart@Raxco.com, wrote on 2-Sep-1992, responding
  12. my article "UCB$L_DDT != DDB$L_DDT".
  13.  
  14. >I don't know of anything that would be harmed by moving the DDT for
  15. >the victim disk to the UCB of a CDdriver caching driver. However
  16. >I would like to make a plea for extensibility.
  17.  
  18. That's a good goal.
  19.  
  20. >   The idea of pointing ucb$l_ddt at a DDT that physically resides
  21. >in a UCB of some other device like CDdriver is a wonderful way to
  22. >make finding the corresponding device fast and reliable.
  23. >   It suffers from the disadvantage that it works for ONE driver
  24. >only as proposed. That is, if I come along and try to steal the
  25. >DDT again and happen to use the original driver's UCB$L_DDT
  26. >link, the new DDB winds up in MY UCB, and CDdriver will find the
  27. >DDB in the wrong place.
  28.  
  29. You lost me there with that subtle context switch.  I assume you
  30. meant DDT where you wrote DDB.  I have taken the liberty to change
  31. the DDB's to DDT's in the rest of the article.  I'm sure you will
  32. let me know if you really did mean DDB.  However, my original
  33. article talked about copying the DDT (not the DDB) to the UCB.
  34.  
  35.     NOTE: the following lines preceeded by "!" were edited to what
  36.           I think Glenn meant.
  37.  
  38. !link, the new DDT winds up in MY UCB, and CDdriver will find the
  39. !DDT in the wrong place.
  40.  
  41. Yes, this would indeed cause problems.
  42.  
  43. >   What I would suggest is adoption and publication of some standard
  44. >that is extensible.
  45.  
  46. This is a good idea.  I think we should first state the goals of the
  47. standard, and what it would affect (i.e. what has to change).
  48.  
  49. Perhaps DEC can incorporate something into the new driver spec for
  50. ALPHA.  If you were able to design this from a clean slate, what
  51. goals would you have?
  52.  
  53. >                      It will involve some chaining, but will not
  54. >break the first time a second app tries to use it.
  55. >
  56. >   The notion is to produce a UCB extension that looks like this:
  57. >
  58. >        .long   ident-pattern
  59. !        .long   previous-DDT-address
  60. >ucb$a_victimddt:
  61. >        .blkl   nnnn    ;however long this needs to be, look it up
  62. >
  63. !   With such a standard in force, if I find the DDT from ucb$l_ddt
  64. >of the victim device, I can check ident-pattern against my
  65. >own program's pattern, and if it matches I just go ahead and use
  66. >offsets from there to find my driver's UCB and thus its data
  67. >(e.g. the CDdriver UCB). If it does not match, I chain using
  68. !the previous-DDT-address and keep looking for my pattern, and
  69. >when I find it (in usually one or two tries at most), I have
  70. >found my UCB and can go on from there.
  71.  
  72. This all works fine, as long as everyone plays by the same rules.
  73. Unfortunately, any standard we agree on won't be enforceable.
  74. It's easy to detect that things are ok (with high probability) if
  75. the DDT is in your UCB, but if you don't find your signature (ident
  76. pattern), it isn't as easy to determine that it is safe to follow
  77. the previous-DDT-address.  An access violation in kernel mode at
  78. elevated IPL is not very forgiving.  The other possibility is that
  79. the chain has a loop.  Then we wouldn't crash, but we would be in a
  80. loop running at fork ipl, which in my opinion is even worse than a
  81. crash, since it requires manual intervention to remedy the
  82. situation.  Yes, we could define a max-hop count.  This still
  83. doesn't solve the problem, it just lets us detect loops in
  84. previous-DDT-address chains.  (My original proposal didn't address
  85. these issues at all.)
  86.  
  87. >   The pattern choice is arbitrary, and I have no great objections
  88. >to making it two longs, but I think one is enough by prejudice.
  89.  
  90. If you want it unique per driver, you could put the address of your
  91. intercept driver's DPT there.  The nice thing about using the DPT
  92. address is that this will stand out in SDA listings as the driver
  93. name;  i.e. if you do a show stack it will display something like:
  94.  
  95.                 811d0648  811d0510      CDDRIVER
  96.  
  97. >   It is necessary of course that this chain never be removed
  98. !or broken once established, though the contents of the DDT copy
  99. !in the area labelled "ucb$a_victimddt" above could of course
  100. >be altered if one wanted to turn off a program.
  101.  
  102. I think this restriction is unnecessary.  This restriction would not
  103. allow for deletion or reuse of an intercept driver UCB.  What is
  104. necessary is that everyone synchronize and leave things in a defined
  105. state.  The standard should specify what can and can't be done, how
  106. things will be coordinated, etc.
  107.  
  108. >                                                 However it is
  109. >essential that the original device (e.g. the disk being cached
  110. >by cddriver) NOT just have its' ucb$l_ddt replaced by the
  111. >original value if this is done, since someone else may have
  112. >grabbed the pointer and be using it for other purposes.
  113.  
  114. Agreed.
  115.  
  116. What is needed is a way for intercept drivers to repair things in a
  117. consistent way.  What if all intercept drivers had a predefined
  118. place for other intercept drivers to place their DDT address into,
  119. then it would be possible to remove an intercept driver's UCB from
  120. the DDT chain.
  121.  
  122.         .long   ident-pattern        ; unique to driver that owns this ucb
  123.         .long   intercept-DDT-address; This is modified by another intercept
  124.                                      ; driver that intercepts the victim UCB
  125.                                      ; after we do.  This allows us to find
  126.                                      ; the our interceptor's DDT.
  127.         .long   previous-DDT-address ; where to find the next startio addr
  128.         .long   intercept-signature   ; same for all intercept drivers
  129. ucb$a_victimddt:
  130.         .blkl   ddt$k_length         ; note this changed in V5.5
  131.  
  132. Two things have been added to Glenn's suggestion.
  133.  
  134. First is a signature that would have to be unique to all intercept
  135. drivers.  This would allow intercept drivers to have a better
  136. indication that it is safe to follow the previous-DDT-address.
  137.  
  138. Second is an intercept-DDT-address pointer that is modified by
  139. a by an intercept driver when it intercepts a device that has
  140. already been intercepted.  This allows an intercept driver's UCB to
  141. be removed from the DDT chain, by modifying the previous-DDT-address
  142. of the DDT extension pointed to by intercept-DDT-address, and if the
  143. previous-DDT-address is not the original driver's DDT (as indicated
  144. by the victim UCB's ucb$l_ddb -> ddb$l_ddt chain), then modifying
  145. the intercept-DDT-address of the DDT extension pointed to by
  146. previous-DDT-address.  All of this should be done while holding the
  147. fork lock specified by the victim UCB.
  148.  
  149. What else besides an intercept driver may grab the ucb$l_ddt pointer
  150. and be "using it for other purposes."
  151.  
  152. >   I would suggest a similar strategy be used for stealing
  153. >FDT table bits also. These can be made to coexist rather nicely
  154. >if one has a structure somewhat along these lines for FDT routines
  155. >to be added to a driver's FDT chain.
  156.  
  157. Good idea.  I haven't thought about the ramifications of removing
  158. the DDT block from the chain here.
  159.  
  160. >   What say the rest of the forum?
  161. >Glenn Everhart
  162. >Everhart@Raxco.com
  163. >215 358 5875
  164.  
  165. Jon Pinkley jon@clevax.wec.com  ...uunet!tron!clevax!jon (216)486-8300 x1335
  166.