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

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!boulder!ophelia!drew
  3. From: drew@ophelia.cs.colorado.edu (Drew Eckhardt)
  4. Subject: Re: Stabilizing Linux
  5. Message-ID: <1992Aug13.195406.23296@colorado.edu>
  6. Sender: news@colorado.edu (The Daily Planet)
  7. Nntp-Posting-Host: ophelia.cs.colorado.edu
  8. Organization: University of Colorado at Boulder
  9. References: <1992Aug11.203828.11554@crd.ge.com> <1992Aug12.173012.17552@colorado.edu> <1992Aug13.133313.15221@crd.ge.com>
  10. Date: Thu, 13 Aug 1992 19:54:06 GMT
  11. Lines: 130
  12.  
  13. In article <1992Aug13.133313.15221@crd.ge.com> davidsen@crd.ge.com (bill davidsen) writes:
  14. >In article <1992Aug12.173012.17552@colorado.edu>, drew@kinglear.cs.colorado.edu (Drew Eckhardt) writes:
  15. >
  16. >And the person trying to install on a new machine can't rebuild the
  17. >kernel, so s/he needs another working system to get going. Bleh.
  18. >Relocation at load time might take 1-2 sec of cpu. Big deal. Without
  19. >loadable device drivers you must have a working system to generate a new
  20. >kernel.
  21.  
  22. Most Unices distribute the distribution kernel as a generic kernel,
  23. ie one with support for all device drivers compiled in.  It gets a little
  24. bloated, but if you can boot it, you can run anything.
  25.  
  26. The Linux kernel is distributed the same way - for instance, .97
  27. incorporates support for Adaptec 154x, Future Domain 16 bit, 
  28. Seagate, Ultrastor 14F, and Western Digital 7000FASST SCSI 
  29. boards.
  30.  
  31. >As for generating a new kernel in 30 sec, some Linux users don't have
  32. >the disk to keep the kernel sources and objects online all the time (or
  33. >even any of the time).
  34.  
  35. Currently, my Linux source tree weighs in at 1.5-2M.  That's 
  36. for one copy of "checked out" sources under RCS, another copy 
  37. still under RCS, plus intermediate .o files for everything else. 
  38.  
  39. A minimal system, with only driver ".o" files, Makefile template, 
  40. automatically generated Makefile and ioconf.c, plus room for 
  41. the kernel, should fit in under 1M.  
  42.  
  43. >For those without a 486-800 to recompile the kernal in 30 sec, here's
  44.  
  45. Linking is significantly faster than recompiling the kernel.
  46.  
  47. >how loadable dd's work. If you want to install on a new dipthong50 disk
  48. >controller, you boot the floppy kernel, and then add the device driver
  49. >for your HD controller by reading it off a floppy. Then install as
  50. >usual, and write the enhanced kernel on the hard disk. No sources, no
  51.  
  52. So?  The kernel configuration method takes another 500K of disk to
  53. hold all of the .o files.  With a minimal system having 40M of disk 
  54. these days, that's insignificant.  Using a kernel configuration program 
  55. instead means we don't need hooks for character devices, block devices,
  56. and any pseudo-devices, like the low-level SCSI drivers and 
  57. perhaps the ethernet drivers (like under BSD - I haven't looked 
  58. at the Linux TCP/IP code yet, so I won't make a definate comment on
  59. this).
  60.  
  61. >compile time, just snuggle some position independent code up to the
  62. >kernel and adjust the vectors in the kernel to use it.
  63.  
  64. You also have to allocate a contiguous piece of physical memory large 
  65. enough to hold the device driver, since drivers using DMA expect that 
  66. kernel memory is identity mapped.
  67.  
  68. Furthurmore, you have to patch the Linux kernel so that it doesn't 
  69. try to swap the newly allocated memory  - you can't swap kernel 
  70. memory.  Swapping kernel memory doesn't work because you may 
  71. get a page fault from within an interrupt handler.  This will 
  72. get passed to a device driver, which will try to sleep - but 
  73. you can't sleep from within an interrupt handler.
  74.  
  75. Other things that have to change include the initiation code 
  76. for all of the subsystems (character device, block device, 
  77. SCSI low level driver) so that new drivers can be added later, 
  78. the memory allocation code so that the buffer cache and user 
  79. memory pool can shrink and kmem can grow, etc.  
  80.  
  81. The changes would be non-trivial.
  82.  
  83. >Same ease of testing new device drivers, load them with the kernel in
  84. >memory, and if the drive panics the kernel, as might ahppen now and
  85. >again, you can just reboot. Beats rebuild kernels, booting from floppy,
  86. >etc.
  87.  
  88. Since shoelace was ported to work with Linux .012, I have never booted 
  89. a new kernel from floppy.  I can just spacebar it when it tries 
  90. to load /vmunix, and substitute /usr/src/linux/Image.
  91.  
  92. If you eliminate fsck's (When I *know* I'm going to reboot, I 
  93. touch /fastboot, which is checked by /etc/rc on startup.  If it's 
  94. there, it assumes the system went down cleanly, and doesn't
  95. fsck anything), reboots are quite tolerable.
  96.  
  97.  
  98. >You may be able to rebuild your kernel in 30 seconds, but I doubt that
  99. >many other linux users can. Besides, this o/s is breaking a lot of new
  100.  
  101. That's not a complete rebuild - that's essentially running gcc on 
  102. one file, a couple of make processes, and running ld and 
  103. tools/build on the whole mess.  If the device drivers are available 
  104. in .o form, the only changes made to config generated ioconf.c and 
  105. Makefiles deciding what gets linked in, ANY ONE should be able 
  106. to relink a custom kernel, on a 386, in under a minute if it 
  107. isn't thrashing heavily (ie, 4M of RAM, which is the Defacto Standard
  108. for new PC's.  If not, RAM wholesales for ~$25 a meg, and you should 
  109. be able to buy it for ~$30).
  110.  
  111. >ground, and the kernel needs virtually no extra code, since the memory
  112. >allocator and disk io is there already. Just a bit of code to actually
  113.  
  114. Have you ever used the kernel memory allocators, either the 
  115. get_page() function, or the kernel malloc()?  The former can 
  116. allocate single pages, and they will be non-contigous (which 
  117. will break things assuming that kernel memory is 
  118. identity mapped, and use DMA), and kernel malloc() is a bucket 
  119. allocator that is limited to  memory pieces smaller than 
  120. page sized.
  121.  
  122. >add the driver to that vectors. If the system was limited to only what
  123.  
  124. It's not that simple - if it was, some one would have done it already.
  125. It involves significant modifications to the Linux memory allocation 
  126. code, device driver code, and initialization code.  Also, you'll
  127. have to hack a user level ld program that performs the necessary 
  128. relocations and resolves references to symbols listed in the 
  129. kernel nlist.  Finally, if you want to dump the new kernel do disk,
  130. you'll need to figure out some way to dump it, with the 
  131. INITIAL values of all variables, not what they currently are.
  132.  
  133.  
  134. >every single user needed, it wouldn't be very righ (or open).
  135.  
  136. You can make your own version of the kernel that has whatever options 
  137. you want in it, dynamically loaded device drivers won't change that.
  138.  
  139. -- 
  140. Microsoft is responsible for propogating the evils it calls DOS and Windows, 
  141. 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. 
  142.  
  143.