home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / linux / 9800 < prev    next >
Encoding:
Internet Message Format  |  1992-09-03  |  4.8 KB

  1. Path: sparky!uunet!wupost!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!cbnewsm!cbnewsl!att-out!rutgers!psinntp!psinntp!pool!ujlh
  2. From: ujlh@pool.info.sunyit.edu (James Henrickson)
  3. Newsgroups: comp.os.linux
  4. Subject: Loadable device drivers for Linux [Was: Re: GNU kids on the block?]
  5. Keywords: Linux, Mach, CISC, RISC
  6. Message-ID: <1992Sep2.172802.10396@pool.info.sunyit.edu>
  7. Date: 2 Sep 92 17:28:02 GMT
  8. References: <17m6sbINN64o@darkstar.UCSC.EDU> <1992Aug29.115034.17334@hacker.UUCP> <1992Aug31.180438.34997@watson.ibm.com>
  9. Organization: State University of New York -- Institute of Technology
  10. Lines: 96
  11.  
  12. In article <1992Aug31.180438.34997@watson.ibm.com> rajat@watson.ibm.com (Rajat Datta) writes:
  13. >
  14. >Actually, AIX has loadable device-drivers and loadable kernel
  15. >extensions.  And AIX is certainly not anything like a micro-kernel.
  16. >
  17. >I think you're absolutely right about loadable device-drivers, and in
  18. >fact, they make more sense on the PC class machines than on ones that
  19. >run VMS.  There is a far greater variety of devices available for PCs
  20. >and the resources available (memory) is usually much less.  A fat
  21. >kernel with every likely device driver can be tolerated better on
  22. >systems with 64Mbyte plus systems than on our "poor" machines with
  23. >8Mbytes and often less.
  24.  
  25. We often discuss the idea of loadable device drivers, and they
  26. usually end up showing that loadable device drivers are wanted.
  27. I think it would be productive to discuss the implementation
  28. of loadable device drivers, so I'll start with what I think is
  29. a relatively simple implementation.  Note that I am not as familiar
  30. with Linux internals as some other people, so please correct any
  31. areas where my idea is weak.  I feel that an open discussion could 
  32. result in a reasonable implementation, with fewer trial-and-error 
  33. pains than are usually encountered when one or a few people attempt 
  34. such a feat.
  35.  
  36. PHASE 1:
  37. --------
  38.  
  39. What if we just started with a dynamic boundary for the real memory
  40. used by the kernel?  Device drivers could be located at the end of
  41. the kernel where they would be easier to locate and add/remove.
  42. Adding a driver would involve moving this "boundary" and remapping
  43. a few pages for the user processes that were using this area
  44. of memory.  Adding such a feature shouldn't be difficult to debug,
  45. after which we could work a little more on loadable drivers.  
  46.  
  47. The code for the various file systems could reside in this area,
  48. and always exist at boot time to facilitate mounting the root
  49. file system (which ever type it may happen to be).
  50.  
  51. Phase 1 would only involve the relocation of drivers and 
  52. implementation of dynamic boundaries, so we can attempt to
  53. isolate any bugs before we get very far.
  54.  
  55. PHASE 2:
  56. --------
  57.  
  58. A system call could be added to add/remove a device driver.
  59. Two programs can be written to dynamically load/unload drivers by
  60. using this system call.  Lines could be added to /etc/rc to load
  61. frequently-used drivers and to unload rarely-used drivers.  Perhaps
  62. these frequently-used drivers should be tagged with a "lock in 
  63. memory" bit?  This "lock in memory" bit could prevent automatic
  64. unloading of unused drivers (like when unmounting a file system)
  65. but still allow them to be manually unloaded using the "unload"
  66. program.  This gives the system administrator the ability to
  67. maximize performance by eliminating the overhead involved in having 
  68. to reload a device driver each time a file system is mounted.
  69.  
  70. Loading a new driver would involve shifting the boundary, remapping
  71. a few pages for the user processes, and then loading the driver.
  72. Tiny test drivers could be added to test the "load" and "unload"
  73. routines, as well as setting the "lock in memory" bit.
  74.  
  75. Loading/unloading device drivers involves quite a bit of overhead 
  76. and may affect ongoing processes like TCP/IP, so care should be
  77. excercised in determining when to load or unload a driver.
  78.  
  79. PHASE 3:
  80. --------
  81.  
  82. Full implementation of dynamic device drivers.  By this time,
  83. all known bugs have been fixed and the driver format has been
  84. determined to facillitate the writing of additional drivers.
  85. In this phase, the only bugs should be in the drivers themselves
  86. and not in the kernel.
  87.  
  88. ----------------------------------------------------------------
  89.  
  90. Ideas?  Suggestions?  Please reply to comp.os.linux, for further
  91. discussion.  I would prefer that even flames be posted instead
  92. of mailed to me, as any such flames would refer more to my lack of
  93. understanding of Linux internals than anything else, and may help
  94. others to better understand Linux.  :-)
  95.  
  96. This is not a complete plan, but merely a rough outline.  I have
  97. left out specific details of the implementation due to my lack
  98. of familiarity with Linux internals.  I also know that there are
  99. a lot of weak areas in my idea, but it is a good starting point
  100. for a serious discussion.
  101.  
  102.  
  103. -- 
  104. Jim H.
  105. *
  106. * James L. Henrickson
  107. * ujlh@sunyit.edu        "Some day I might have a real .signature!"
  108.