home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / os / minix / 3735 < prev    next >
Encoding:
Internet Message Format  |  1992-07-21  |  4.4 KB

  1. Path: sparky!uunet!mcsun!sun4nl!phigate!relay.philips.nl!philica!adrie
  2. From: adrie@ica.philips.nl (Adrie Koolen)
  3. Newsgroups: comp.os.minix
  4. Subject: Re: Microkernel discussion
  5. Message-ID: <1992Jul21.093145.328@ica.philips.nl>
  6. Date: 21 Jul 92 09:31:45 GMT
  7. Organization: Philips Consumer Electronics, Eindhoven, The Netherlands
  8. Lines: 81
  9.  
  10. In article <meulenbr.711631843@cstw18> meulenbr@prl.philips.nl (Frans Meulenbroeks) writes:
  11. >I think that accessing the proc struct directly is not very nice
  12. >either. That way, all drivers must know where certain kernel data
  13. >structures are. This also means drivers have knowledge about the
  14. >internals of the kernel. I don't think I like it.
  15.  
  16. I understand your dislike (a little) but I can't help to find it a little
  17. bit ridiculous that a device driver shouldn't know about the location of
  18. some kernel information. I agree that it's nice to have all OS parts
  19. completely separated, but it's a trade between execution speed, code
  20. length, code modularity, source maintainability, etc. I'm not saying that
  21. I know where the optimum is. Because soft- and hardware differs, and
  22. people have their own demands and opinions, the optimal point is quite
  23. subjective.
  24.  
  25. In any case, in order to comunicate with the rest of the system, each
  26. driver (or process) should have some fixed information about the rest
  27. of the system, i.e. tables, addresses and/or interrupt numbers. By
  28. restricting the amount of directly available information, the channels
  29. through which the information, which a driver needs from the kernel or
  30. other parts of the system, travels can be a real bottleneck.
  31.  
  32. Note that I'm not against a clean separation of the drivers and the
  33. kernel, but if it means that I for instance can't code the floppy
  34. driver anymore to read a track in one revolution or have to code the
  35. driver in a very dirty way, I think we should reconsider. Let's wait
  36.  
  37. >>Now the interrupt() function. On Minix-Sparc, a first level interrupt
  38. >>handler calls the interrupt service routine. The ISR can of course also
  39. >>call a function in the `module' where the FLIH resides, e.g.
  40. >>interrupt(). On an Intel processor, this is also possible (with a far
  41. >>call). The interrupt() function should then end with a far return.
  42. >
  43. >How does the ISR know the addresses of the function to call?
  44.  
  45. Use an array of addresses of kernel functions. Some will cosider this
  46. `dirty', but also is the agreement on the message numbers and contents.
  47. Everywhere something is agreed upon, the question remains whether
  48. everyone interprets it the same and will stick to the agreements and
  49. not alter them.
  50.  
  51. >I cannot call interrupt() in my driver directly, since there is no 
  52. >procedure with that name in my namespace. Of course you can work around
  53. >this, but why bother.
  54.  
  55. You could agree on a number of critical kernel functions (like
  56. interrupt(), panic(), umap(), etc., maybe also the address of the
  57. proc[] array), which are `global kernel' functions.
  58.  
  59. >Why not let the ISR return with the number of the
  60. >process which needs to be interrupt()-ed, and call interrupt from the
  61. >FLIH? (of course you'll need a default value to state that you do not
  62. >need a call to interrupt()). The only thing you give up with this is
  63. >the ability to do several interrupt() calls within one ISR call. 
  64. >However, given the fact that an ISR should take as little time as
  65. >possible, I would consider calling interrupt() twice within an ISR
  66. >as bad programming.
  67.  
  68. I agree fully with this proposition. Still I want some kernel globals
  69. to be accessible by all drivers. As far as I know, in SunOS loadable
  70. device drivers can also access kernel functions and data.
  71.  
  72. >I propose to let each process let itself register under a name in the
  73. >kernel, and give processes the ability to inquire what the
  74. >address/message id of a process registered under a certain name is.
  75. >
  76. >e.g. a driver would say
  77. >register("WINI");
  78. >while someone wanting to send a message to the wini driver could ask
  79. >give_address("WINI") 
  80.  
  81. Note that you have to guarantee that the `address' of the driver is
  82. not changed in the meantime (between the give_address() and send()
  83. calls). As drivers might die in the meantime (for whatever reason),
  84. the send() might fail or arrive at the wrong driver. If you want to
  85. send a message to "WINI" then why first ask for its address? Simply
  86. use send("WINI", &msg). If "WINI" doesn't exist (anymore) you'll see
  87. it in the return code.
  88.  
  89. Adrie Koolen (adrie@ica.philips.nl)
  90. Philips Consumer Electronics, Eindhoven, the Netherlands
  91.