home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 1 / Meeting Pearls Vol 1 (1994).iso / installed_progs / text / faqs / 386bsd-faq.part5 < prev    next >
Encoding:
Internet Message Format  |  1994-04-02  |  16.7 KB

  1. Subject: [comp.os.386bsd] BNR/2 derived BSD for PCs FAQ (Part 5 of 10)
  2. Newsgroups: comp.os.386bsd.announce,comp.answers,news.answers
  3. From: burgess@hrd769.brooks.af.mil (Dave Burgess)
  4. Date: 31 Mar 1994 21:37:41 -0000
  5.  
  6. Posted-By: auto-faq 2.4
  7. Archive-name: 386bsd-faq/part5
  8.  
  9. Section 4.    (Kernel Additions)
  10.  
  11.   Thanks go to  Marc Wandschneider (storm@cs.mcgill.ca) for putting this
  12.   section of the FAQ together..
  13.  
  14. 4.0    Introduction
  15.  
  16.     If you have written some addition to the kernel, or know of
  17.     one that feel should be mentioned, send mail to Dave Burgess 
  18.     (burgess@hrd769.brooks.af.mil) with all the relevant information, 
  19.     and it will be added for the next release.
  20.  
  21.  
  22.  
  23. 4.1    Common Kernel-related problems
  24.  
  25. 4.1.1    Where are the commands "rpcinfo" and "rpcgen"?
  26.  
  27.     Chris Flatters (cflatter@nrao.edu) informs us in the following
  28.     posting excerpt where we can find them:
  29.  
  30.     --------------------------------------------------------------------
  31.     The sources for the Sun OS 4.0 RPC are on titan.rice.edu (I don't 
  32.     have the inet number handy) in directory sun-sources.  You will have 
  33.     to pick up all the shell archives and unpack them to get at rpcgen.
  34.     --------------------------------------------------------------------
  35.  
  36.     These sources are also included in NetBSD and FreeBSD as part of the
  37.     normal installation.
  38.  
  39. 4.1.2    Where can I get a working "netstat"?
  40.  
  41.     netstat was released as a binary patch and source patch 
  42.     in the patchkit.  Netstat will be a part of the FreeBSD 
  43.     distribution currently under construction, and is already
  44.     part of NetBSD.
  45.  
  46.  
  47. 4.1.3    How can I fix NFS to work with my NE2000 board?
  48.  
  49.     Ken Raeburn (raeburn@cambridge.cygnus.com) has both identified the
  50.     problem and provided us with a work around:
  51.  
  52.     --------------------------------------------------------------------
  53.     I reported previously that I was seeing problems reading files over
  54.     NFS using the ne2000 driver; timeouts would eventually be reported, no
  55.     data would be read.  Listing files and directories (small ones
  56.     anyways) were not a problem.
  57.  
  58.     After playing with etherfind and kernel printfs, I've come to this
  59.     conclusion: Fragmented 8K UDP packets from the NFS server are not
  60.     reaching the UDP layer in 386bsd.  The Sun is sending them (according
  61.     to another Sun spying on the network), but the UDP input routine is
  62.     never called.  I don't know if the bug here is on the 386bsd or Sun
  63.     side, and won't have time to look into it in the next couple of days.
  64.  
  65.     In the meantime, mounting NFS file systems with "rsize=1024" does get
  66.     rid of this problem.
  67.  
  68.     (It does nothing about TCP being slow, though.)
  69.     Ken
  70.     --------------------------------------------------------------------
  71.  
  72.     Hopefully, the real solution (a UDP fix) will be forthcoming so
  73.     that the slow TCP problem is fixed as well.
  74.  
  75.     See also:  Section 2.6.3.3c "I am getting lousy performance 
  76.            out of my network card.  What are some of the other 
  77.            possibilities?"
  78.  
  79.     Recent work in FreeBSD and NetBSD may have deprecated this problem.
  80.     There is a new network card driver called the ed0 driver.  This
  81.     replaces the original NE1000/NE2000 drivers, as well as replacing
  82.     the we0 driver.  By combining the two, a more flexible driver has
  83.     been developed and most of these types of problems have been fixed.
  84.     Once again, upgrading to FreeBSD or NetBSD seems to be the answer.
  85.  
  86.  
  87. 4.1.4    How can I get "ps" and "w" to work?
  88.  
  89.     The patch-kit contains a fix for /src/lib/libutil/kvm.c, which,
  90.     last we heard, was due to the work of Jim Paradis 
  91.     (paradis@sousa.ltn.dec.com).  New versions of the kernel should
  92.     have this problem fixed.
  93.  
  94.     In order for users to be able to use certain flags with ps and
  95.     the w/uptime commands, the kernel must have permissions 755.
  96.  
  97.     Also, in order to save space on the distribution, the kernel is 
  98.     'stripped' of all its labels.  Programs that rely on those labels
  99.     will not work.  There are several in this category, including ps, 
  100.     w, and uptime.  Either ftp an un-stripped kernel, or recompile.
  101.  
  102.  
  103. 4.1.5    Where are re_comp and re_exec?
  104.  
  105.     These two functions are currently not in libc.a.  However, there
  106.     are two related functions that seem to work exactly the same in
  107.     all cases we've heard of---These are regcomp() and regexec().
  108.  
  109.     Thus, a pretty ugly fix for the problem would be to always compile
  110.     as follows:
  111.  
  112.     $(CC) -Dre_comp=regcomp -Dre_exec=regexec ....
  113.  
  114.     There is a slightly nicer fix available for this, listed in 4.2
  115.  
  116.  
  117. 4.1.6    Where are stty() and gtty()?
  118.  
  119.     These functions are missing from libc.a.  To fix, add the following
  120.     #defines to your program:
  121.  
  122.     #define stty(f, m)    ioctl((f), TIOCSETP, (m))
  123.     #define gtty(f, m)    ioctl((f), TIOCGETP, (m))
  124.  
  125.     A more elegant solution is to apply the patchkit.  These routines
  126.     are included in there.
  127.  
  128. 4.1.7    The system hangs with the HD light on after intense disk usage.
  129.     The system hangs when trying to fsck -p both of my IDE hard drives
  130.     at boot-up.
  131.  
  132.     Brett Lymn (blymn@mulga.awadi.com.AU)  Provides us with a
  133.     description of the problem and the steps that he had to take
  134.     to fix it:
  135.  
  136.         It seems that, on some disk subsystems, the controller and the
  137.     hard disk get out of synchronization when they are being used 
  138.     intensively.  The result of this is that the disk completes a 
  139.     command but the controller still believes the disk not to have 
  140.     completed the command, so the controller status register 
  141.     indicates the disk is busy when it is not really.  The standard 
  142.     wd drivers are too trusting of the hardware and expect it to do 
  143.     the right thing all the time.  There are a few while loops in 
  144.     the wd drivers that loop on a status change from the disk 
  145.     controller, however; if the problem I have described takes place 
  146.     then the wd driver will be stuck looping waiting for the disk to 
  147.     not be busy - which never happens, so you lock the machine because 
  148.     this is a kernel level wait.  To fix this problem I put a timeout 
  149.     into the while loops so that after a specified time the wd driver 
  150.     will give up waiting for the drive to become ready, reset the 
  151.     controller and retry the command.  In my experience the retry 
  152.     always succeeds.
  153.  
  154.     Ed.Note:  The retry doesn't ALWAYS work, but it IS better than 
  155.     just waiting for the drive to wake back up (which it never does).
  156.  
  157.     Dan Yergeau (yergeau@gloworm.Stanford.EDU) provides us with more 
  158.     insight into this problem.  The README accompanying the original 
  159.     sources used as a base for the NetBSD driver indicates that
  160.  
  161.     > There's also another problem still bothering me: There's some 
  162.     sort of timing/reentrancy error still lurking in here, that was 
  163.     there in the original 0.1 wd driver as well.  The symptom is that, 
  164.     on *some* controllers, doing the initial wdopen() (which will 
  165.     then call the readdisklabel() function) for two or more disks at 
  166.     the same time (so that wdopen() gets called again while it's 
  167.     already being executed), the controller gets hung.  I'm still 
  168.     looking for this, meanwhile I specify in my config file that I 
  169.     have swap on all disks.  This causes the kernel to wdopen() the 
  170.     drives nicely in order -- and once it's been done for each disk, 
  171.     the problem will, of course, not occur.  Without the "swap on ... 
  172.     and ... and ..." stuff, my wd1, wd2 and wd3 would be opened 
  173.     simultaneously by "fsck -p" forks, which would nicely hang up 
  174.     everything...  I note a "sleep(10)" in fsck, but it obviously 
  175.     doesn't do that.
  176.  
  177.     So, changing the appropriate config line to
  178.  
  179.     config        "386bsd"    root on wd0 swap on wd0 and wd1
  180.                                                             ^^^^^^^
  181.     may get around the problem.  I don't run NetBSD, but I do use a
  182.     variation of the barsoom/NetBSD driver.  This works for me.  
  183.     Please let the NetBSD people know if it works for you.
  184.  
  185.     (Note: the sleep(10) in fsck is misplaced.  It does not keep fsck 
  186.     from opening multiple disks simultaneously.  A properly placed 
  187.     sleep() should also work around the wdopen problem.)
  188.  
  189. #include <std.disclaimer>
  190.  
  191.     [Ed. again] Other methods for fixing this problem include doing a 
  192.     dd if=/dev/wd1d of=/dev/null count=1 before the initial 'fsck -p'.
  193.     This method is considered brute force.  It works by making sure
  194.     that the drive is properly initialized before the disklabel is
  195.     read in the fsck.
  196.  
  197.     Another method involves using the '-l1' (little L) flag to make sure
  198.     that the fsck doesn't try to open both unopened hard drives at the
  199.     same time.  This method is a little better (from a purely brute
  200.     viewpoint) but does caused your startup to run longer, since the
  201.     purpose of this option is to have each of your fsck passes run
  202.     one after another.
  203.  
  204.  
  205. 4.1.8    How do you implement quotas on Net/2 derived BSD systems?
  206.  
  207.     From: tinguely@plains.NoDak.edu (Mark Tinguely)
  208.  
  209.      maybe you did not complete the setup, here is a step-by-step 
  210.      instructions to get them to work:
  211.  
  212.     1)  make a kernel with "options quota" installed
  213.  
  214.     2)  edit /etc/fstab and include the kinds of quotas you want, 
  215.         below I used "userquota", you could also add "groupquota".
  216.  
  217.     /dev/wd0h        /usr        ufs    rw,userquota 1 2
  218.  
  219.     3)  for each filesystem that is in /etc/fstab that uses quota,
  220.         create the file "quota.user" (and "quota.group if appropriate).
  221.         Above I have user quotas in the /usr filesystem, so I would:
  222.  
  223.         # touch /usr/quota.user
  224.  
  225.     4)  scan filesystem for files ownership (and/or group ownership).
  226.  
  227.         # quotacheck -a
  228.  
  229.     5)  now you can add individual quota limits, if you want to add 
  230.         the same quotas to the many people, then make a template and 
  231.         replicate the template.  If they change for each user, then 
  232.         edit seperately.
  233.  
  234.         # edquota tinguely
  235.  
  236.      (an editor is kicked up and says something like:
  237.  
  238.     Quotas for user tinguely:
  239.       /usr: blocks in use: 11876, limits (soft = 0, hard = 0)
  240.             inodes in use: 891, limits (soft = 0, hard = 0)
  241.  
  242.      a limit of 0 means "unlimited".  Change these to the appropriate 
  243.      number of blocks.  A soft limit generates a warning, and can be 
  244.      exceed for period of time (7 days?), after which time a soft limit 
  245.      is treated like a hard limit.  A hard limit denies new writes.
  246.  
  247.      to replicate a template (for this example let us assume "tinguely" 
  248.      is the template):
  249.  
  250.         # edquota -p tinguely user1 user2 user3 ... userN
  251.  
  252.     6)  turn quotas on (usually done in the /etc/rc file, but turn it 
  253.         on manually so you do not have to reboot right now:
  254.  
  255.         # quotaon
  256.  
  257.     that should take care of setting up quotas.  You can look at the 
  258.     status of use of files with repquota, the -a option lists all 
  259.     filesystems with quotas.
  260.  
  261.  
  262. 4.2    Available kernel add-ons
  263.  
  264.  
  265. 4.2.1    The Patch-Kit
  266.  
  267.     Perhaps the most famous of all additions to the kernel, the Patch-Kit,
  268.     currently coordinated by Rodney Grimes (rgrimes@agora.rain.com)
  269.     contains numerous bug fixes, Julian's SCSI drivers, as well as fixes
  270.     for other parts of the system.
  271.  
  272.     The patch-kit, as well as all relevant information, is available on
  273.     agate.berkeley.edu (and mirrors) in unofficial/patch-kit, as well
  274.     as bsd.co.montana.edu in /pub/patch-kit. (archie will likely list
  275.     other sites as well)
  276.  
  277.     It is highly recommended that all users with space for the source code
  278.     apply the patch-kits as many things that seem broken in 0.1 suddenly
  279.     start working with the patch-kits.
  280.  
  281. 4.2.2    Shared Libraries
  282.  
  283.     A basic and experimental implementation of shared libraries exists
  284.     for 386bsd.  According to the author (Dr. Joerg Lohse, 
  285.     lohse@tech7.informatik.uni-hamburg.de), features are as follows:
  286.  
  287.     -No kernel extension is necessary
  288.     -Shared libraries use the approach used in SysV.
  289.  
  290.     Others are also working on different implementations of shared
  291.     libraries.
  292.  
  293.     Bill and Lynne have adopted a shared-library implementation based
  294.     on Dr. Lohse's original work.  It will be included in Version 0.2
  295.     of 386bsd.
  296.  
  297.     For NetBSD and FreeBSD users, Paul Kranenberg has created a 
  298.     seperate and different shared library system based on the style
  299.     of the 'Sun' shared library system.  The feature is included in
  300.     the '-current' tree of both systems, and may be included in the
  301.     next major release of eiter or both.
  302.  
  303.  
  304. 4.2.3    Sound Blaster Drivers
  305.  
  306.     A driver for the Sound Blaster card has been written by Steve
  307.     Haehnichen (steveh@ucsd.edu) for BSD.  Steve Gerakines has
  308.     provided us with the information necessary to get this driver 
  309.     working under 386bsd.
  310.  
  311.     Most features of the SB family of cards are supported save some
  312.     stereo portions of the SBPro cards.
  313.  
  314.     The driver is available on agate.berkeley.edu in 
  315.     unofficial/drivers/misc/soundblaster-1.4
  316.  
  317.     NetBSD and FreeBSD have also adapted soundblaster drivers.  They
  318.     are included in either the -current tree or in the most recent 
  319.     release (depending on when you read this).
  320.  
  321.     For a fact, the following sound cards are supported in FreeBSD:
  322.  
  323.         1    Yamaha FM Synth
  324.         2    Soundblaster/Soundblaster Pro DSP
  325.         3    PAS PCM and Midi
  326.         4    Gravis UltraSound
  327.         5    MPU-401
  328.  
  329.     In the release notes I have, there is some doubt as to the 
  330.     operational status of the MPU-401 sound card driver.  If you have 
  331.     one of these cards and want to try the driver out, you should 
  332.     contact Jordan Hubbard (jkh@freefall.cdrom.com) when you are 
  333.     finished installing it and let him know how it is working.
  334.  
  335.     The docs for the driver is in /usr/src/sys/i386/doc/sound.doc.
  336.     
  337.  
  338. 4.2.4    Bus Mouse Drivers
  339.  
  340.     Fred Cawthorne (fcawth@delphi.umd.edu) wrote a busmouse
  341.     driver for 386bsd.  He recently wrote a short letter with this
  342.     update:
  343.  
  344.     My busmouse driver is mentioned in the FAQ, but it is quite out of 
  345.     date.  I use Gene Stark's driver available from Freebsd.cdrom.com 
  346.     in /pub/XFree86/mice.  (It is well done and I did not have time to 
  347.     finish mine to make it more stable)  It is small, though, so it 
  348.     might be good for people who want to rewrite parts, etc...  
  349.     Several people have written about getting this to work with new
  350.     versions, etc... and I have pointed them to the other driver.  It 
  351.     would seem that people found out about my busmouse driver through 
  352.     the FAQ, so could you please add something like the following to 
  353.     the FAQ??
  354.  
  355.     This is taken from the INDEX in the Freebsd.cdrom.com mice 
  356.     directory:
  357.  
  358.     "We currently have four bus mouse drivers for 386bsd available by
  359.     anonymous ftp on XFree-86.cdrom.com in pub/XFree86/mice:
  360.  
  361.     ms-busmouse.tar.z
  362.  
  363.         Sandi Donno's <sandi@uctcs.cs.uct.ac.za.> port of 
  364.         Erik Forsberg's Microsoft bus mouse driver to 386bsd.
  365.  
  366.     logitech-busmouse-0.2.shar.z
  367.  
  368.         Fred Cawthorne's <fcawth@delphi.umd.edu> second version 
  369.         of a logitech Bus Mouse driver.  
  370.  
  371.     busmouse.tar.z:
  372.  
  373.         Eugene Stark's port of Rick Macklem's driver to the 
  374.         Microsoft bus mouse.  Rick's driver supports the 
  375.         Logitech and ATI Inport Bus mice with 386bsd.  It's also 
  376.         available by e-mail to stark@cs.sunysb.edu and by anon. 
  377.         ftp on cs.sunysb.edu in pub/386BSD/busmouse.tar.Z.
  378.  
  379.     psm.tar.z:
  380.  
  381.         Johan Solhed <Johan.Solhed@lu.erisoft.se> ported the 
  382.         Linux PS/2 mouse driver to 386BSD.  It includes a PS/2 
  383.         to Microsoft protocol converter in the driver so XFree86 
  384.         understands the mouse events.
  385.  
  386.     In addition we have busmouse.v3.z which is Erik Forsberg's original
  387.     post of his device driver for BSDI/386 and Microsoft (and
  388.     compatible) bus mice using the Microsoft InPort chip as well as a
  389.     device driver for Logitech bus mice. "
  390.  
  391.     I prefer busmouse.tar.z, and that seems to be the one that 
  392.     supports the most mice.  It also drops into FreeBSD very easily.
  393.     (all you have to do is copy com.c into /sys/i386/isa and add the
  394.      device mse0 ... line to the system config file.)
  395.  
  396.  
  397. 4.2.5    PPP Support
  398.  
  399.     A package to add PPP support to 386bsd can be found on agate
  400.     in unofficial/drivers/net.  PPP support is included in NetBSD 
  401.     and FreeBSD.
  402.  
  403.  
  404. 4.2.6    re_comp and re_exec library functions
  405.  
  406.     As mentioned in section 4.1, re_comp and related functions, such
  407.     as re_exec, are currently not in the library libc.a.  Apart from
  408.     using the rather crude fix listed above, there is another option.
  409.  
  410.     Kim Anderson (kim@dde.dk) has provided a patch that will add these
  411.     to libc.a.  You can probably obtain this patch from the author, or
  412.     you can ftp it from binkley.cs.mcgill.ca in pub/386bsd.
  413.  
  414.  
  415. 4.2.7    Intel i82586 Ethernet Controller driver
  416.  
  417.     Garrett A. Wollman has written a driver for the Intel i83586 
  418.     Ethernet Controller.  The driver is available from agate
  419.     in unofficial/from-ref/sys.extras.
  420.  
  421.     The authors e-mail address is listed as Garrett.Wollman@uvm.edu,
  422.     attempts to send him mail there have failed.
  423.  
  424.  
  425. 4.2.8    PC Speaker driver for Nethack
  426.  
  427.     Andrew A. Chernov has ported the Nethack PC Speaker driver to
  428.     386bsd.  It allows the speaker to be controlled by applications.
  429.  
  430.     Unfortunately, we are not aware of a site that distributes this,
  431.     but this patch has been posted a couple of times to the various
  432.     comp.os.386bsd groups, and the author can be contacted at
  433.     ache@astral.msk.su
  434.  
  435.     The patch that is included in the NetBSD and FreeBSD source trees
  436.     is one written by Soerne Schmitt.  It appears to use the Sun-style
  437.     /dev/audio interface and is different in goals and implementation
  438.     from Andrew Chernov's speaker driver.  The source for this package
  439.     is included in the source trees for both, but is not included in 
  440.     the distribution kernels.
  441.  
  442.     The speaker drivers are also included in FreeBSD.
  443.  
  444.  
  445.