Return to BSD News archive
Xref: sserve comp.os.386bsd.announce:96 comp.answers:1730 news.answers:11451 Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!agate!howland.reston.ans.net!vixen.cso.uiuc.edu!sdd.hp.com!cs.utexas.edu!natinst.com!hrd769.brooks.af.mil!hrd769.brooks.af.mil!not-for-mail From: burgess@brooks.af.mil (Dave Burgess) Newsgroups: comp.os.386bsd.announce,comp.answers,news.answers Subject: comp.os.386bsd.announce Frequently Asked Questions (Part 5 of 9) Followup-To: comp.os.386bsd.announce Date: 26 Aug 1993 15:20:12 -0000 Organization: Armstrong Laboratory, Brooks AFB, TX Lines: 679 Sender: burgess@hrd769.brooks.af.mil Approved: news-answers-request@MIT.Edu Distribution: world Expires: 09/13/93 Message-ID: <386bsd-faq-5-746378397@brooks.af.mil> References: <386bsd-faq-1-746378397@brooks.af.mil> Reply-To: 386bsd-faq@brooks.af.mil (386bsd FAQ Maintainer) NNTP-Posting-Host: hrd769.brooks.af.mil Posted-By: auto-faq 2.4 Archive-name: 386bsd-faq/part5 Section 5. (Kernel Replacements) 5.0 Introduction This section is supposed to document the unusual or optional kernel add-ons that are available from various places. As they are included in the mainstream of the various Berkeley Net Release systems, they will slowly come out of here. If you know of any replacement parts for the kernel, please send Dave Burgess (burgess@hrd769.brooks.af.mil) a message detailing the package (possibly include a README), where it can be found, and what version of the OS (ie. NetBSD, 386bsd 0.1 + pk 0.2) it was designed to run under. When the exact directory is not listed for a package, the places to look on agate.berkeley.edu are in unofficial/drivers and unofficial/from-ref/sys.extras. Many a goodie can be found in these directories. 5.1 Available Kernel Replacements 5.1.1 keycap/codrv These server as replacements for the generic pccons driver that comes (by default) with 386bsd 0.1. Holger Veit (author of these) writes: "The same type of driver, but keycap has the version number 0.1.1 and codrv has the version number 0.1.2. The latter is much improved and downward compatible. Codrv was developed to provide a universal way of mapping national keyboard layouts during runtime (ie, not by patching the kernel tables) and providing better X11 support. Codrv uses a superset of the pc3 terminal emulation, and a termcap-like database for keymaps (therefore "keycap"). X11 is supported by two dedicated console raw devices /dev/kbd and /dev/vga, which avoids all the existing problems pccons has with X11. The latest version has virtual consoles. Codrv will become part of patchkit 0.2.4" This package is available on agate.berkeley.edu. 5.1.2 pcvt A superset of pccons, this driver supports virtual consoles, and some form of database oriented keyboard mappings. It was also designed to emulate a vt220 terminal as best as possible. Joerg Wunsch, the author of pcvt <joerg_wunsch@tcd-dresden.de> has sent us this update. I've arranged irz301.inf.tu-dresden.de [141.76.4.1] as the `official' ftp server for the pcvt console driver, as long as there are several different drivers. The stuff is under ~ftp/pub/unix/386bsd/pcvt, along with some recent (still unofficial) patches to be compatible with XFree86. Everything is scheduled with the author, Hellmuth Michaelis. I'm not the official maintainer of that ftp site, so I must ask the folks there to help me. This might delay recent changes; before they're merged into the official server tree, they can be found in ~ftp/pub/incoming/unix/386bsd. The Dresden University has only a thin wire to outside. Any mirroring site, especially in US, would be appreciated. The space requirements are less, only 2 or 3 Meg. Maybe I'll upload a `generic' kernel configured with pcvt there some day. all the best, J"org <joerg_wunsch@uriah.sax.de> 5.1.3 syscons Another superset of pccons that was designed to emulate SCO as well as possible. Many of the ioctls from SysV have been implemented. XFree86 requires special patches to be run with kernels using this console driver. Available on agate. 5.1.4 Fast Symbolic Links The following is taken from the README for the fast sym-links patch: "This cruddy but complete hack answers one of the objections to symlinks: that they are slow, and cost an entire frag. Symlinks of less than length 60 are stored in the inode itself. Symlinks longer than this are still in the inode. To make the illusion of normality complete, dump and fsck also need changing. Additionally, I made dumpfs verbose to excess." Available on agate. 5.1.5 npx fixes There are problems with the floating point error handling routines, and there are fixes available for this problem provided by Bruce Evans (of Minix-386 fame) The code for these fixes is available on agate.berkeley.edu in unofficial/from-ref/sys.extras/bde-npx. Note the most of the code is applicable to floating point hardware as opposed to emulation. The newest version (and now official) fixes to this are in patchkit-0.2.4. 5.1.6 CGD's COM drivers Chris G. Demetriou (cgd@blah blah blah) has written some COM drivers for 386bsd. These, among other things, support multi-port serial packages. The latest (and last) version is 0.2, and is available on agate in unofficial/from-ref/sys.extras/cgd-com-ports. Please note that this is not going be developed any further by the author, and no new versions will appear. Users who do not absolutely need the features this provides are encouraged to use the newest drivers that come with the patch-kits. 5.1.7 Tom Ivar Helbekkmo's wd.c replacement Tom Ivar Helbekkmo (tih@barsoom.nhh.no) has rewritten much of the wd.c file that handles common hard disks, and added many new features to the code. The patches to use these can be obtained from barsoom.nhh.no in pub/386bsd. Users should consult the README file for more information. Also, it should be noted that NetBSD uses these drivers as their stock drivers. 5.1.8 Interruptless LPT Driver Kit An Interruptless lpr driver kit is available from agate.berkeley.edu in unofficial/drivers/lpt. This driver was designed with faster performance and lower system load in mind. See the INSTALL-NOTES that come with the package for more details and installation information. 5.2 Floppy Disk problems. One of the most common problems in 386BSD involves working with new boot sector and/or reformatting a floppy. Dave Silvia provided this section on using floppy disks. 5.2.1 How do I get a bootable floppy? Several ways, ranging from brain-dead-but-works to simplest. Classification into categories is left to the reader (is there really a difference between 'brain-dead' and 'simple'?:') 1) rawrite (or dd) dist.fs (or fixit.fs) to a disk, mount it, cd to the mount point, and execute: rm -rf . you now have a bootable floppy!;^} 2) Take your existing dist.fs or fixit.fs boot disk and diskcopy it on a DOS machine. Mount and rm as in 1) above. Again, you have a bootable floppy!;^} 3) Run disklabel on the floppy, e.g.: disklabel -w -r fd0a floppy5 where 'floppy5' is a 'name' for an entry in the disktab file in /etc. You'll get a couple of ioctl errors because writing a label to a floppy isn't supported (yet?), but the boot blocks have indeed been written. 4) Write the boot blocks to the floppy: cat /usr/mdec/fdboot /usr/mdec/bootfd | dd of=/dev/rfd0a or, more simply: cat /usr/mdec/fdboot /usr/mdec/bootfd > /dev/rfd0a Methods 3) and 4) require you to run newfs on the floppy, e.g.: newfs /dev/rfd0a floppy5 If you have a floppy that was originally bootable, but the boot blocks were somehow damaged, you can use method 3) or 4) to restore boot-ability (do _NOT_ run newfs). You _could_, through the convolutions of copying a floppy whose boot blocks are damaged to a temporary location and then re-copying to a bootable floppy, use method 1) or 2) (if you really want to!;^}) 5) If the disk is already newfs'ed and is otherwise ready to use, disklabel will write the boot blocks on the disk. Read the man page for disklabel. 5.3 Unit Record These devices are also often referred to as character devices. 5.3.1 Printers Configuring a parallel printer for 386bsd requires a working printer driver to be installed in the kernel. 386bsd 0.1 and NetBSD 0.8 both lack this driver in their stock manifestations. It is possible to connect a serial printer to either. This brief tutorial is provided by Daryl Berryhill (djberry2@b25info.b25.ingr.com) The way I got mine printer to work. 1) connect a 25 pin to 9 pin null modem cable to printer and computer. 2) set printer to 9600 baud, 7 data bits, even parity. 3) configure /dev/com1 (DOS COM2) port the same way as the printer 4) add a line to /etc/printcap that says: lp|local line printer:\ :lp=/dev/com2:wq:sd=/var/spool/lpd:lf=/var/log/lpd-errs:\ :br#9600 5) type "lpr <add filename here>" 6) type "lpd" and it should start printing. An obvious point, but make sure that you do NOT start a getty on on the com port. Check the /etc/ttys file and make sure that the com port you select is not active. 5.3.2 Terminals/Keyboards 5.3.3 Modems How to add a modem to 386BSD: The first part that confused me was assuming that /dev/com1 is the same as DOS com1, they're not. /dev/com0 is connected to COM1 and (I think) /dev/com1 is connected to COM2. The switch settings for my modem were the same as what I had under DOS, CTS CD RTS et al were set to follow the actual line (i.e. my modem can force them high, which I turn off) Ok that's not too bad. Now you need to edit the /etc/remote file to include a reference to the com port. I have only used NetBSD-0.8, so I'm not sure what the default files are like that come with the other rev's of 386BSD. I added the last line (with com0). -------------------------------------------------------- # @(#)remote 5.2 (Berkeley) 6/30/90 # ...stuff deleted... # UNIX system definitions unix1200|1200 Baud dial-out to another UNIX system:\ :el=^U^C^R^O^D^S^Q:ie=%$:oe=^D:tc=dial1200: unix300|300 Baud dial-out to another UNIX system:\ :el=^U^C^R^O^D^S^Q:ie=%$:oe=^D:tc=dial300: ...stuff deleted... dial2400|2400 Baud Hayes attributes:\ :dv=/dev/tty19:br#2400:cu=/dev/tty19:at=hayes:du: dial1200|1200 Baud Hayes attributes:\ :dv=/dev/tty19:br#1200:cu=/dev/tty19:at=hayes:du: # Hardwired line com1c|com1:dv=/dev/com1:br#9600: com1b:dv=/dev/com1:br#2400: com0:com0:dv=/dev/com0:br#9600:at=hayes: ------------------------------------------------ Ok, now if you are running as root you can use type 'tip com0' and you should then be talking to your modem. I use kermit to transfer files, and it wants to create a lock file in (not sure about the exact path) /var/spool/uucp/lock or something along those lines. I made the directory world writeable so I could run kermit with my own uid, rather than root. Also, you may need to add an entry in /etc/remote for com0. Thanks also to thombsr@liciren.li.co.uk for information on how to do this. 5.4 Tape Drives This section should help out for those of you that have either never used tape drives before, or only have experience with them as non-Unix devices. 5.4.1 Does the tape need to be formatted? It depends, but I think usually not. And when it is necessary, I don't know how it would be done. One thing is for certain, though, first.... NEVER use the block devices.. erase them and forget you ever saw them. All operations on tape should be to the character device (rst0). 5.4.2 If I execute the command 'st -f /dev/st0 status', I get: Archive/Tandberg? tape drive, residual=0, blocksize=512 Density: high = 16 (0x10), medium = 15 (0xf), low = 5 (0x5) ds=0 er=0 so to write to tape at high-density (QIC-150), presumably I want to use a device with minor number +4 (in st.c, density is computed as minor >> 2 & 0x03, where low density == 3 and high == 1): You have the idea.. density is controlled by bits 2 and 3 00 = default 01 = hi density 10 = medium density 11 = low density, Unless the driver knows about you kind of drive the density values may need to be set by hand before they make any sense. 5.4.3 When is erst0 used? e stands for 'eject' and is bit 1 of the minor.. e.g. eject on close.. many devices can't actually do this. There is actually a method to this whole thing: r = raw (rst0) e = eject (erst0) n = No rewind (nrst0 or maybe nerst0) 5.4.4 How is density (bpi) computed? I am using 3M DC 6250 cassettes which have a 250MB capacity on the Viper 150. But computing the bits/inch based on 250MB/tape-length (1020 ft.), I get a density of 171335 bpi, which is nowhere near the 10000 bpi associated with QIC-150 in the st(1) man page. Why the discrepancy? These cartridge tapes are right onto the tape in narrow tracks, which begin at opposite ends of the tape. Track 0 starts at the beginning of the tape, and Track 1 starts at the other end, etc. So, how many times does the tape go backwards and forwards? If there are 17 tracks, your density is 170000 bpi if it is 10000 bpi per track. 5.4.5 How is an appropriate block size determined (and in what units are they specified in the st(1) command)? QIC 150 and below should stick to 512 byte blocks a write of 1024 bytes from the program will be written as 2 512 byte blocks with no speed penalty. dd will think it's writing a 1024 byte block but on tape it's 2 x 512. Stick to 512 on QIC 150 or less if you ever hope to swap data with anyone else. 5.4.6 From the 4.3BSD mtio(4) man page, it sounds like data is typically (traditionally?) stored on tape in eof-terminated sequences of 1K records. 5.4.6.1 Is st's notion of "file" the record sequence between two eof marks? 5.4.6.2 What about a "record"? 5.4.6.3 Is a "record" one "block", as determined by st's "blocksize" command? If not, what is the connection between them? 5.4.6.4 Can I change the "record" size? 5.4.6.5 When would I want a block size that is different from the default? 1KB is the size of writes used by dd or whatever. QIC specifies 512 byte records (well at least its what people use..) Whatever you write in will be broken into 512 byte sections. They must be multiples of 512 though. If you have written to a tape, a close will automatically append a filemark (eof mark). You may read the 512 byte blocks back as 512 byte records or as 1024 byte records (in which case you'll get 2 at once). The bigger the unit, the more efficient. 5.4.7a How do I write several archives to a single tape? I tried without success: $ st -f /dev/rst4 rewind $ tar cf /dev/nst4 archive1 $ st -f /dev/nrst4 weof $ tar cf /dev/nst4 archive2 $ st -f /dev/nrst4 weof First: throw away the block devices. 'n' stands for 'No-Rewind-on-close' and will leave the tape positioned ready for another file e.g. tar -cf /dev/nrst0 archive1 tar -cf /dev/nrst0 archive2 5.4.8b Later I would expect to be able to access, say, archive3 via the fsf directive to skip over the first two archives. What is the correct sequence? st -f /dev/nrst0 rewind st -f /dev/nrst0 fsf 2 tar -xf /dev/rst0 {files} 5.4.9 Since the Viper 150 writes on QIC-150/120, I guess I don't need to worry about writing variable-length records? How about reading a tape written with variable-length records. Is this possible with the Viper? If so, what's involved? Who would have written it? :-) Presently you can't. You`re right. Don't worry about it. The new 'st' changes will change this somewhat, though. 5.4.10 The very scant documentation that came with my drive mentions a "selectable buffer disconnect size," whose default is 16K. This is evidently the "maximum number of bytes that can be sent over the SCSI bus during a single data transfer phase." What's that? How is it connected st's "blocksize" command? Do I want to use 16K blocks, or might I even want to set the disconnect size to a higher value? This suggests that 32 512 blocks will be written at a time. This jives with the tape format for some of the lower density cartridges (QIC-40 and 80, for example). The tape is written in blocks of 32 512-byte blocks, with the last three being used for Error Correction Codes. Use dd or tar with 16 k blocks and 32 x 512 byte blocks will be written. 5.4.11 What is "streaming"? When I tar a directory of files to tape, I notice that the tape often stops. Streaming means it doesn't stop? How would I get the viper 150 to stream using tar or cpio or dump? Use a bigger write size... (more efficient) Try 16k blocks. 5.4.12 Where are all the answers to the above and related questions written down? Neither on the net nor in the 4.3BSD manuals nor Administration text which I have could I find this stuff covered! They are in the FAQ :-)... 5.4.13 What else should I know? For example, it seems that a new tape must stretched. How is this done? Use a blowtorce and a pair of pliers. Or you can run the tape through a complete fast forward/rewind cycle to get it tight on the spindles. 5.5 Network 5.6 Marc Mengel's <mengel@fnal.gov> driver list Well, since replies to my request for information on drivers dried up a few weeks ago; here is the list. I got more replies from folks wanting drivers than from folks who'd done them. Hopefully this posting will inspire folks whose drivers aren't on the list to send me information on their stuff, and I'll add it in. If there is continued interest I'd be willing to turn this over to the FAQ folks, or maintain it as a separate FAQ posting for comp.os.386bsd.announce or some such. Here is the form to submit new entries to the list: Driver Name: Author's Name: Author's Email: Devices Supported: Number Supported: Interrupt driven: External Symbols: Size info: Availability: Sites: Stability: Restrictions: Comments: Here is the list received to date: ----- Driver Name: fdc Author's Name: Jesus Monroy Jr. Author's Email: jmonroy@netcom.com, et al. (to follow) Devices Supported: NEC765, Intel8272 Number Supported: 8 projected (1 works now) Interrupt driven: Y External Symbols: (fdopen, fdclose, TBA) Size info: (N/A (projected to add 1k to kernel)) Availability: (TBA) Sites: (TBA) Stability: (in BETAS) Restrictions: (UCB Copyright) Delivery Date: June '93 ----- Driver Name: rtc (CMOS clock) Author's Name: Jesus Monroy Jr. Author's Email: jmonroy@netcom.com, et al. (to follow) Devices Supported: Motorola CMOS 16458? (must double check) Number Supported: 1 Interrupt driven: (Y) External Symbols: (TBA) Size info: (N/A) Availability: (TBA) Sites: (TBA) Stability: (starts 5-17-93) Restrictions: (UCB Copyright) Delivery Date: July '93 ----- Driver Name: QIC-40/80 Author's Name: Jesus Monroy Jr. (to follow(6+)) Author's Email: jmonroy@netcom.com, et al. (to follow(6+)) Devices Supported: QIC-117 (standard) via NEC765, Intel8272 Number Supported: (TBA) Interrupt driven: (Y (sometimes)) External Symbols: (TBA) Size info: (N/A) Availability: (TBA) Sites: (TBA) Stability: (starts 5-7-93; design in progress) Restrictions: (UCB Copyright) Delivery Date: (TBA (I project Aug. '93)) ----- Driver Name: com Author's Name: Serge V.Vakulenko Author's Email: vak@kiae.su Devices Supported: multiport UART adapters Number Supported: up to 5 Interrupt driven: Yes, with lost interrupts recovery External Symbols: comopen, comclose,... Size info: text data bss dec hex 5204 264 0 5468 155c Availability: mail Sites: from the author Stability: Solid Restrictions: Free Copyright Comments: during autoconfiguration makes full testing of hardware (algorithm taken from sas) ----- Driver Name: co ("codrv") console driver Author's Name: Holger Veit Author's Email: Holger.Veit@gmd.de Devices Supported: Keyboard, CGA/MDA/EGA/VGA/SVGA Number Supported: 1 Interrupt driven: Keyboard INT 1 External Symbols: coopen,coclose,coread,coselect,coioctl,comap, pcopen,pcclose,pcread,pcwrite,pcioctl,pcmmap, crtat, sput, getchar,putchar, and many more Size info: large, several modules Availability: ftp Sites: latest version is codrv-0.1.2-030593.tar.z (gzip) ftp.uni-duisburg.de:/pub/unix/386bsd-0.1/unofficial/codrv bsd386.first.gmd.de:~veit/codrv (login with 'guest', passwd 'guest') bsd.coe.montana.edu:/pub/codrv agate.berkeley.edu:/pub/incoming/codrv-0.1.2-030593.tar.z Stability: quite stable Restrictions: BSD Copyright ----- Package Name: patchkit Editor's Name: Rodney Grimes Editor's Email: rgrimes@agora.rain.com Availability: ftp Sites: agate.berkeley.edu, bsd.coe.montana.edu, etc.(ask archie) Stability: Excellent Restrictions: Comments: ----- Driver Name: shlib Author's Name: Joerg Lohse Author's Email: lohse@tech7.informatik.uni-hamburg.de Devices Supported: - Number Supported: - Interrupt driven: - External Symbols: - Size info: Availability: Sites: agate.berkeley.edu:unofficial/fromref/sys.extras Stability: ? Restrictions: ? ----- Driver Name: "mse" Author's Name: Rick Macklem (patches by Eugene W. Stark) Author's Email: rick@snowhite.cis.uoguelph.ca, stark@cs.sunysb.edu Devices Supported: Bus mouse Number Supported: "n", where n >= 0 (but I have only 1) Interrupt driven: Y External Symbols: mseopen, mseclose, mseread, mseselect Size info: text data bss dec hex 1484 72 0 1556 614 Availability: E-mail to stark@cs.sunysb.edu, FTP to cs.sunysb.edu Sites: cs.sunysb.edu, in pub/386BSD Stability: Sometimes generates phantom events when system is under load. Restrictions: "Do anything, but preserve this notice" copyright. ----- Driver Name: "tw" Author's Name: Eugene W. Stark Author's Email: stark@cs.sunysb.edu Devices Supported: TW-523 X-10 carrier current modem for home control Number Supported: "n", where n >= 0 (but I have only 1) Interrupt driven: Y External Symbols: twopen, twclose, twread, twwrite, twselect Size info: text data bss dec hex 2944 560 0 3504 db0 Availability: E-mail to author for most recent version + s/w, FTP not updated too frequently Sites: cs.sunysb.edu, in pub/386BSD (older version on agate.berkeley.edu in "from-ref") Stability: Solid Restrictions: BSD-style copyright. ----- Driver Name: js, Joystick Author's Name: Juha Nurmela Author's Email: junki@lut.fi Devices Supported: Standard PC joysticks, LDResistors,... Number Supported: 2, more with "tweaked" cards Interrupt driven: No, polled with configurable timeouts, dflt 1/5 sec. External Symbols: jsopen, jsclose, ... Size info: ??? (very small) Availability: mail Sites: None Stability: Solid (no guarantees though) Restrictions: None whatsoever Blah: select()able, nonblocking/blocking io. ----- Driver Name: pcvt - VT220 virtual console driver Author's Name: Hellmuth Michaelis (and many others!) Author's Email: hm@hcshh.hcs.de Devices Supported: MDA / CGA / EGA / VGA Number Supported: 1 Interrupt driven: Keyboard=YES/Video=NO External Symbols: Size info: ca. 64k (4 .o modules) Availability: alt.sources, ftp from agate and others Sites: i.e. agate.berkeley.edu Stability: stable Restrictions: BSD Copyright -- ------ TSgt Dave Burgess NCOIC AL/Management Information Systems Office Brooks AFB, TX