home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / linux / 8272 < prev    next >
Encoding:
Text File  |  1992-08-14  |  7.6 KB  |  165 lines

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!boulder!kinglear!drew
  3. From: drew@kinglear.cs.colorado.edu (Drew Eckhardt)
  4. Subject: Re: Stabilizing Linux
  5. Message-ID: <1992Aug14.230015.6824@colorado.edu>
  6. Sender: news@colorado.edu (The Daily Planet)
  7. Nntp-Posting-Host: kinglear.cs.colorado.edu
  8. Organization: University of Colorado at Boulder
  9. References: <1992Aug13.133313.15221@crd.ge.com> <1992Aug13.195406.23296@colorado.edu> <1992Aug14.132232.22899@crd.ge.com>
  10. Date: Fri, 14 Aug 1992 23:00:15 GMT
  11. Lines: 152
  12.  
  13. In article <1992Aug14.132232.22899@crd.ge.com> davidsen@crd.ge.com (bill davidsen) writes:
  14. >In article <1992Aug13.195406.23296@colorado.edu>, drew@ophelia.cs.colorado.edu (Drew Eckhardt) writes:
  15. >| In article <1992Aug13.133313.15221@crd.ge.com> davidsen@crd.ge.com (bill davidsen) writes:
  16. >| >In article <1992Aug12.173012.17552@colorado.edu>, drew@kinglear.cs.colorado.edu (Drew Eckhardt) writes:
  17. >| >
  18. >| >And the person trying to install on a new machine can't rebuild the
  19. >| >kernel, so s/he needs another working system to get going. Bleh.
  20. >| >Relocation at load time might take 1-2 sec of cpu. Big deal. Without
  21. >| >loadable device drivers you must have a working system to generate a new
  22. >| >kernel.
  23. >| 
  24. >| Most Unices distribute the distribution kernel as a generic kernel,
  25. >| ie one with support for all device drivers compiled in.  It gets a little
  26. >| bloated, but if you can boot it, you can run anything.
  27. >
  28. >  Sounds to me like you think the Linux kernel as distributed contains
  29. >all the devices anyone would ever want to use, so there's no need for
  30. >being able to support new devices.
  31.  
  32. The assumption is that as new devices get added (such as Ross's 
  33. ethernet drivers), that they will eventually make it into the 
  34. distribution kernel, both in the sources and the generic binary.  
  35.  
  36. You can recompile (now), or relink (when a working config 
  37. program is implemented) the kernel to add anything you need
  38. before then - propriety GPIB driver, intelligent serial
  39. driver, Ross's ethernet drivers, etc.
  40.  
  41. >  It also sounds like you're trying to say that you think it's too
  42. >hard, and you personally don't need it, so you want to convince
  43. >everyone it's a bad idea.
  44.  
  45. My opinion is that the percieved benefits (being able to add drivers at run 
  46. time, saving a relink, rather than regenerating the kernel Makefile and 
  47. relinking), are outweighed by the increased complexity 
  48. of the device driver initialization, and memory allocation code.
  49.  
  50. - You add a new device driver, when one becomes available, or you
  51.     install new hardware.  Neither is a frequent event. 
  52.  
  53. - Configuring a system, where you recompile ioconf.c or table.c, 
  54.     and simply link in already compiled .o files for 
  55.     everything else will take less than a minute on 
  56.     anything that isn't thrashing - ie, a minimal 
  57.     386 with ~4M of memory.  A reboot without fsck's 
  58.     (ie, after a clean shutdown) about the same.
  59.  
  60.     So, you save two minutes everytime you add a new
  61.     device driver.  I added a SCSI disk driver when I 
  62.     finished the code, and will add a SLIP or CSLIP driver
  63.     when one becomes stable.
  64.  
  65.     That's two drivers since last November.  
  66.  
  67. - Loadable device drivers let you shrink kernel size by leaving 
  68.     out drivers you don't need.  You get the same effect 
  69.     from a config program, only the kernel is even smaller because
  70.     it doesn't need any of the hacks needed to accomodate 
  71.     loadable drivers.  
  72.  
  73. I don't see any real benefits there.  
  74.  
  75. You can argue that loadable device drivers would make debugging 
  76. easier for developers.  What's ideal for developers isn't necessarily 
  77. ideal for users - ask any one who used the early, non-interrupt 
  78. driven versions of the SCSI drivers.  They'll tell you about the 
  79. wonderful interactive performance, and that the system would 
  80. never hang for ~30 seconds while the disk(s) synced.  
  81.  
  82. When I did the SCSI code, I put in support for both interrupt, and 
  83. non-interrupt driven SCSI drivers, thinking that "It would be 
  84. much easier to debug the non-interrupt driven version."  It was
  85. marginally easier, and all of the initial SCSI efforts ended up 
  86. being of the non-interrupt driven variety that were the bane 
  87. of SCSI users. It took us some time to debug the interrupt code (
  88. one line needed moving in scsi.c), modify all of the 
  89. lowlevel drivers, and get it back into the "stock" Linux distribution.
  90.  
  91. Interrupt driven SCSI drivers didn't make the stock distribution until
  92. .97, and we've had SCSI versions since .12, support in the 
  93. stock distribution since .95.
  94.  
  95. It's easier to do it right the first time, and avoid things of 
  96. questionable value that may come back to haunt you.
  97.  
  98. I don't know that loadable device drivers would help that much 
  99. during code development.  Much of the time is spent in design
  100. and coding.  With device drivers, there are good chances of a 
  101. bad device driver (ie wild pointer) corrupting the rest of the 
  102. system.  Even if you can unload the driver, recompile, and load a 
  103. new one, you may not want to, because something may have 
  104. become corrupt in the rest of the system.  If you are booting 
  105. from harddisk, the reboot-test cycle is not that bad.
  106.  
  107. I wouldn't say that loadable device drivers are "too hard" to implement - 
  108. just that the added mess in the Linux code, and time it would take 
  109. to do so aren't worth the benefits.
  110.  
  111. Linux is not a completely clean design.  Isolation between the 
  112. various parts is not absolute.  Especially in the cases of 
  113. pseudo-devices, like the lowlevel SCSI drivers, there is an
  114. incestuous relationship between the driver code and the surrounding 
  115. kernel.  The hard disk and SCSI drivers have special consideration 
  116. given to them in ll_rw_block.c so they can get multi-block 
  117. requests as one device driver request.  All of this would 
  118. have to change, and in some cases, you may get nicer (but 
  119. less tight) code.  
  120.  
  121. Like BSD, Linux uses certain "pseudo-devices."  These have 
  122. a different interface than the normal block/character devices,
  123. and will need special handling code.  Examples would include 
  124. SYSV STREAMS, BSD network drivers, the Linux low level 
  125. SCSI code.
  126.  
  127. Different parts of Linux are very dependant on eachother - for 
  128. instance, some of the device drivers assume that kernel memory
  129. is identity mapped.  malloc() preserves this assumption, but can 
  130. only allocate 1 page at a time.  The same is true for get_page().
  131.  
  132. Current Linux devices have no way to "dettach" from the system,
  133. necessary if you use loadable drivers for debugging, the only 
  134. real reason you would want them. You need that, a way to track
  135. what's mounted on block devices, etc.  
  136.  
  137. Current Linux code initializes all devices before the move to 
  138. user mode, and most of it happens before buffercache, etc, is 
  139. allocated.  (Well, sys_setup() is called from user mode, but that
  140. just handles the partition tables on disk devices).  You'll need
  141. to add all of the code to keep Linux happy when a new device 
  142. is added.
  143.  
  144. It shouldn't be difficult, but I'd rather see people dedicate their
  145. time to useful projects, like a SLIP driver for the TCP/IP package, 
  146. a new VM using one page table per process to ease VM386 support,
  147. remove the 64 process limit, increase the address space size, and 
  148. support SYSV sghared memory semantics.  
  149.  
  150. Personally, I'll finish the SCSI driver rewrite (Experiments show that 
  151. we can expect 3X current performance on unbuffered disks with 1K block file 
  152. systems, 2 block read ahead, 12X if we move to 4K block sizes on the 
  153. new file systems.  Buffered devices will see SOME improvement, I don';t
  154. have one and can't say how much.) before playing with something useless.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161. -- 
  162. Microsoft is responsible for propogating the evils it calls DOS and Windows, 
  163. IBM for AIX (appropriately called Aches by those having to administer it), but neither is as bad as AT&T.  Boycott AT&T, and let them know how you feel. 
  164.  
  165.