From: rhaar@gmr.com (Bob Haar) Newsgroups: comp.sys.3b1 Subject: 3.5" floppy FAQ Date: 11 May 1994 17:13:30 GMT Organization: G.M. R&D Center Lines: 982 It has been a while since I last posted this. There have been no significant changes. Adding a 3.5 " floppy drive to a UNIXpc by Robert Haar (rhaar@gmr.com) last revised - 7/13/93 0. Introduction Adding a 3.5 inch floppy disk drive to an AT&T UNIXPC (7300 or 3b1) is a popular upgrade for very good reasons. The drives are reliable and readily available at modest prices. The diskettes physically easier to deal with than the 5 1/4" ones and hold about twice the amount of data. And adding a 720K 3.5" floppy drive does not require any hardware modifications to the circuitry of the UNIXpc. At the same time, there are some details of successfully installing a 3.5 floppy drive in a UNIXpc that present potential difficulties - primarily because of lack of information. The documentation that comes with many of the drives only describes installation in an IBM PC and often does not specify what all the jumpers and switches do. Also, there needs to be some changes in the system software to use the new drive. Fortunately, a number of kind souls have successfully done this upgrade and have shared what they learned in the Usenet group comp.sys.3b1 . This article is based primarily on my personal collection of these postings. I have shameless taken parts of these posting to compile this article. I will attempt to list all these good people in the credits section. I apologize to anyone that I might have missed. Where I have re-used large sections, I will try to credit the author directly. I have decided to directly include the source for some of the format descriptors and utilities directly in this article since they are small and several people commented that they don't get comp.sources. This makes some sections hard to read, but I don't see a better approach. Please note that is this a work in progress. I am posting a draft version because several people have sent me desperate e-mail messages asking for help as soon as possible. If you have any suggestions for improving this or additional information to be included, please mail me you comments. I would especially like detailed information on drive set ups for models that are missing from section 3. Several people have said they are having trouble installing some Sony drives that were purchased from California Digital without documentation. If anyone has discovered a setup for these that works, please post or mail a description. Bob Haar Internet address: rhaar@gmr.com ================================================================== 1. General Comments A number of people have successfully installed several different brands of 3.5 inch floppy drives. These drives (mostly) use an electrical interface that is identical with the stock 5 1/4" floppy drive, except that it can be stepped through 80 tracks. If you use a MS-DOS compatible format, that gives 720K bytes capacity. If you use a 10 sector per track format, you get 800K bytes. The 720K format is useful for exchangin information with MS-DOS systems and many UNIX workstations with 3.5 inch drives. I use it this way to transfer files between my UNIXpc and the Sun Sparc 1+ that I use at work. The 800K format is similar to the 10 sector (System Format) for 5 1/4" diskettes that many people use for backups. Using the 800K micro floppies greatly reduces the number of disks needed to do backups. This is a significant improvement when typical systems that would need 100 320K floppies uses only 40 800K floppies. There are two types of installations - a one-for-one replacement of the stock drive, or installing the 3.5" drive in addition to the existing 5 1/4" drive. There was one report of a system that had three floppy disk drives [360K 5 1/4", 720K 5 1/4" & 720K 3.5"] In either case, the trickiest part is getting the jumpers/switches set properly to configure the drive. If you are planning to do this upgrade and haven't bought a drive yet, you are advised to pick one that others have had success with. If you replace the 5 1/4" drive with a 3.5" unit, you should be aware that you won't be able use you diagnostic and installation floppy disk sets unless you either copy them to th 3.5" format or put the 5 1/4" drive back. The multiple drive installation has a "gotcha". The UNIXpc hardware generates only one drive signal (DS0). In order to use two (or three) drives, you have to come up with a way to switch the drive select line between them. See Section 2 for more details. There has been some discussion of using 1.44M drives, but I haven't heard of any successes. The problem is that the controller IC would require a different clock frequency and modified VCO filter circuit to work with the higher data rates of the 1.44M drives. The installation of a 3.5" drive is unlikely to physically damage your machine. But Murphy's Law still holds. So I strongly suggest that you do a complete backup of your hard disk before you start. And all the information in this article is provided AS IS. Use at your own risk. ================================================================== 2. Electrical Interface and Cabling If the drive is configured properly (see section 3), the power and control/data interface of the 3.5" floppy drive will be compatible with the UNIXpc's floppy interface. But the physical connections are different. The easiest method to deal with this is to buy a 3.5" to 5 1/4" adaptor kit that includes connector adaptors as well as mounting hardware. This will include a short adaptor cable for the power connection and a pin/socket to edge connector adaptor board. If you are replacing the stock floppy drive with a 3.5 inch unit and use one of these adaptor kits, you can then use the existing cables. However, if you want to keep the the 5 1/4" drive as well as adding the 3.5" one, then you have to do some more work on the cabling. The specifics of this depend on how and where you decide to mount the drives, but some general comments apply. See section 4 for more discussion of mounting options. Besides providing power to both drives, you will need to connect the data/control cable. You will need a 34 wire cable to go from the motherboard floppy disk interface connector to the two drives. You can either construct your own using ribbon cable and IDC connectors (available Radio Shack and other fine stores) or you can but ready made cables for IBM PC's. Note that many IBM PC cables have a twist between the drive connectors that flips the drive select lines around. You can still use these, but it makes the drive configuration a bit trickier. The UNIXpc (hardware and software) generates only one drive select siganl (ds0 on pin 10). It is theoretically possible to change this, but I haven't heard of anyone actually doing so. Instead, most people wire in a manual switch which connects the DS0 (pin 10) line to either DS1 (pin 12) or DS2 (pin 14) and then installs this switch in an externally accessable position. The UNIXpc itself can only access one of the drives at a time but that doesn't cause any real problems. If you want to copy files between the two floppy drives, you have to copy them first to the hard drive, then flip the switch and copy them from the hard drive to the target floppy. ----------------- tom@astro.as.arizona.edu (Thomas J. Trebisky) reported that he had encountered a 3b1 that required hardware modifications to access all 80 tracks on a 3.5" floppy. the section below is extracted from his post: I got the jumpers set right (more on this, probably in another post), bolted it in, and fired it up -- used fdfmt10.nl to format it as a 400K drive and all was well. So I copy fdfmt10.nl to be fdfmt3.nl and create a new parameter file with 80 tracks instead of 40, and start getting CRC errors around track 44 (or maybe 46). Had me baffled for about 2 weeks, but now all is well, and here is the story. To let the cat right out of the bag, the whole thing centers around the issue of write precompensation. There is a signal from the 2797 Floppy controller chip that is called TG43 (track greater than 43). (pretty suggestive, eh?). It is connected on *most* (well some) 3b1 motherboards to the ENP pin on the same chip (namely "enable precomp"), so precomp happens at tracks greater than 43 (amazingly enough). Now the rub is that on the versions (like mine) with the signal thusly connected, the trimpot that should be hooked to pin 33 (write precomp width) is just plain not there. (My tech manual has 3 different versions shown in schematics, and the one that has the trimpot for WPW has the ENP pin just grounded, hmmmmmm). One fix would be to add the appropriate trimpot to the WPW pin and use a scope to adjust it in the way the datasheet says. What I opted to do was to lift pin 1 (ENP) of the 2797 chip and ground it to do away with precomp altogether. Anyway, here is how to fix your board (try it first without doing this, maybe your version doesn't need it). One way to check would be to use an ohmeter once the 2797 is removed (and safely stowed in some static foam). (I use a low-current fluke 77 multimeter -- no hazard to the chips) Check from pin 1 to ground -- if connected, put the chip back in and you are OK, If not connected, check from pin 1 to pin 29 (if this isn't connected you have a case I don't know about or your ohmeter is broken). If pin 1 and pin 29 are connected, apply the following fix. Open the rascal up to get access to the motherboard (see the FAQ list). Find the 2797 chip (near the left rear). Ground yourself (to discharge static) then remove the chip from the socket. use a screwdriver and pry one end, then the other end a little. go from one end to the other till it comes out easily. Bend pin 1 out to the side so it wont go back in its hole (don't bust it off of course). I then used a wire-wrap tool to wrap a wire-wrap wire about 2 inches long or so around pin 1 as tho it were a wire-wrap pin. Put the chip back in the socket with pin 1 and attached wire dangling. Find a place to connect the dangling wire to ground nearby (probably best if this is as short as possible). I attached it to the ground side of a bypass capacitor nearby. -------------------[end included text] ================================================================== 3. Drive Selection and Setup. It appears that most or all 720K 3.5 inch floppy drives that are PC-XT compatible can be used in an AT&T UNIXpc. Also, some 1.44M drives may be configured to look like 720K units. But you will most likely have to re-configure the drive for the Drive Ready signal and (depending on your cabling) the drive select line. If you don't have the documentation on the drive this may be difficult. But you will almost certainly need to modify the default drive configuration. Some drives are sold with a fixed configuration that cannot be easily changed. WHen you are buying a drive, try to pick one that has configuration jumpers/switches and comes with enough documentation to understand what they do. There are two specific interface signals that you must be concerned about - drive ready and drive select. FDREADY (pin 34) is required by the UNIXpc to determine that the drive door is closed and a floppy is inserted. But some drives are configured to put a DISK CHANGE signal on pin 34. Drives that are PC-XT compatible should have a way to generate the DRIVE READY signal on pin 34. Drive Select is the signal that the computer generates to tell the drives which one it wants to access. [ nomemclature - I will use DS0 thru DS3, but some drives use the terms DS1 thru DS4.] The UNIXpc can generate only one drive select signal - DS0, which is on pin 10. If you are setting up a signgle floppy system, the drive must be configured to look at DS0. For multi-drive installations, you must set up one drive for DS1 and another for DS2, and switch the DS0 line between these two. [See section 2 for more details.] Sony MP-F11W-50D (may be in a 5.25 kit labelled MP-F11W-52D): [from wen@monolith.bellcore.com (Wen Lee)] [There is] a little switch on hiding on the side with 4 positions (0,1,2,3) and it was set to 1. Change this to 0 for DS0 . TEAC FD-235F: [from andy@scp.caltech.edu (Andy Fyfe)] It has 6 jumpers at the back, next to the power connector. From the front of the drive to the back they are MS IR RY this has a jumper DC D1 D0 this has a jumper On the PCB board that converts the 3.5" connector to what's needed for a 5.25" drive (the drive itself is mounted in a frame that's the size required for a 5.25" drive) there is a jumper with 3 posts. One end is labelled ST, and the other OP. There is a jumper between the ST end and the centre post. It came with a cable that convertes the power connector to what's needed for the 3.5" drive. This cable is just long enough to connect to the 3b1's power connector, since it has to go fully around the drive frame. A bit of strategic routining might give some slack. TEAC FD-235HF-3240-U: [from tom@astro.as.arizona.edu (Thomas J. Trebisky)] First of all, there are umpteen versions of a TEAC 3.5 inch. I suppose you could get a 720K only job. (But why would you want to? Maybe you already have one laying around.) Get a modern HD capable job. That way, when someone posts how to modify the hardware to use them, you will be ready. Shop around and you should get them for under or around $70. In particular, get a FD-235HF-3240-U (other versions I have seen are the -217-U and -240-U, these will give you some grief, see below). ------------------------------------------------------------------ The 217 and 240 have a limited set of jumpers as follows: HHO plug on = floppy outputs density to controller OP plug on = floppy senses density from hole in media LHI plug on = pin 2 low tells floppy to use HD HHI plug on = pin 2 high tells floppy to use HD D1 plug on = set to drive select 1 D0 plug on = set to drive select 0 To use these, jumper D1 and HHI, then see below for info on the cable. OK, one trouble you are gonna have (which is why you should get the 3240-U model) is that pin 34 on this job, is "disk change" instead of "ready." The 3b1 controller expects "ready," and sadly, "disk change" needs to be inverted to be suitable. Actually, even after inverting the signal, "disk change" is not identical to "ready", but I understand that it works. How should you invert the signal? I dunno? (shouldn't be too hard actually). I have avoided that issue by getting 3240-U units.) Now, here are the jumpers for the 3240 -- here you get a 4 by 7 matrix of jumpers and every option in the book. The matrix is labelled 1,2,3,4 and A,B,C,D,E,F,G on the two axes, and here are your choices: A1 - B1 DS0 Drive select 0 B1 - C1 DS1 Drive select 1 A2 - B2 DS2 Drive select 2 B2 - C2 DS3 Drive select 3 A4 - B4 RY34 Ready output on Pin 34 B4 - C4 DC34 Disk Change output on Pin 34 C3 - C4 DC2 Disk Change output on Pin 2 C4 - D4 DC4 Disk Change output on Pin 4 A3 - B3 HA density set automatically B3 - C3 HI2 density set by HD IN on pin 2 C3 - D3 HO2 density (HD OUT) output on pin 2 D3 - D4 HO4 density (HD OUT) output on pin 4 D1 - D2 LHI ---or--- D2 - E2 LHI HD IN low is high density D1 - E1 LHO ---or--- E1 - E2 LHO HD IN high is high density E2 - F2 HMK half mask for INDEX/READ-DATA F3 - G3 NMK no mask for INDEX/READ-DATA F1 - G1 IR LED on when: (Drive Select AND Ready) G1 - G2 ML motor on when: (Motor ON AND LED on) E4 - F4 ACD disable auto-chucking G3 - G4 REN enable auto-recalibration E2 - E3 HF ---or--- E3 - E4 HF must always be in for this version of drive. Whew, there you go! What I used (and works fine) is as follows: DS1, HI2, RY34, HF, REN (they came jumpered DS1, HA, DC34, HF, REN -- ready for an IBM/PC machine). Toshiba ND352: [from rhaar@gmr.com (Robert Haar)] This drive is available in a kit (ND352KU) which includes a 3.5" to 5 1/4" mounting adaptor and interface adaptors for about $90. This makes for an easy installation. Jumper settings are: DC/RDY to RDY (for drive ready signal) Drive select on DS1 (== DS0 ) 4. Physical Mounting (This is the easiest topic.) The 3.5 inch drives are quite a bit smaller in all dimensions than the 5 1/4" ones, and use different mounting points. You can fabricate adaptors, but by far, the easiest method is the use an adaptor kit that is sold for putting a 3.5" drive into 5 1/4 half-height opening. These contain either a mounting tray or two mounting rails that attach tha the 3.5" drive and give mountings compatible with a 5 1/4" drive. These kits often include a large faceplate and adaptors for the power and interface connectors. If you are keeping the stock 5 1/4" drive, then something has to go into an external box. Some people have move the hard drive into an external box, and put the 3.5" floppy drive in its place. Others have put one or both floppy drives into an external enclosure. The details of how to do this are left to the reader as they vary considerably depending on your setup. On my system, I have put both floppy drives in an enclosure (with its own power supply) that is sold for IBM-PC systems. One side effect of this arrangement is that I can power down the floppy drives when I am not using them and just turn on the power as needed. The UNIXpc doesn't seem to notice. ================================================================== 5. Software and Usage 5.1 Accessing 720K MS-DOS format floppies If you want to exchange files with other machines, the 720K format is the way to go. You can use the standard pre-formatted diskettes sold for IBM PC as is. The User Agent (UA) selections for listing/read/writing files to MS-DOS floppies don't seem work with the 3.5" diskettes. [If anyone has hacked this software, please let me know - RLH] To read/write files in the MS-DOS files system, I suggest the mtools package by Emmet Gray that is available in the archives. Later versions of mtools (2.0 patch level 7 seems current) understand the 3.5" 720K format. If you only have an earlier version, you can edit the init.c file and re-compile to add this ability. [from egray@fthood.UUCP (Emmet P. Gray)] >Reference the question on 720k 3.5in floppies with mtools... The parameters for the init.c file are: dir_start = 7; dir_len = 7; clus_size = 2; fat_len = 3; num_clus = 713; if on a AT&T 7300, also add: gdbuf.params.heads = 2; gdbuf.params.cyls = 80; gdbuf.params.psectrk = 9; gdbuf.params.pseccyl = 18; 5.2 800K format For local use and exhcange with other UNIXpc's, I recommend the 800K format that is obtained by putting 10 sectors on each track. To format 800K floppies, you will need to create appropriate entries in the /usr/lib/iv directory. My versions of these follow: /usr/lib/iv/MF10nl: #sccs "@(#)iv/lib:MFnl 1.0" # iv description file for 800K MicroFloppy (3.5) disk. # No loader type FD name Floppy cylinders 80 heads 2 sectors 10 steprate 0 singledensity $ $ $ 0 1 $ $ /usr/lib/iv/MF10sl: #sccs "@(#)iv/lib:MFsl 1.0" # iv description file for 800K MicroFloppy (3.5) disk. # Silent Loader type FD name Floppy cylinders 80 heads 2 sectors 10 steprate 0 singledensity $ loader /usr/lib/iv/s4load.silent $ $ 0 7 $ $ /usr/lib/iv/MF10vl: #sccs "@(#)iv/lib:MFvl 1.0" # iv description file for 800K MicroFloppy (3.5) disk. # Verbose loader type FD name Floppy cylinders 80 heads 2 sectors 10 steprate 0 singledensity $ loader /usr/lib/iv/s4load.verbose $ $ 0 7 $ $ The difference between these three is whether or not the floppy is created with a boot loader and which loader is used. With these files in place, prepare an 800K disk as follows: iv -i /dev/rfp020 /usr/lib/iv/MF10nl mkfs /dev/rfp021 from the UNIX command line. Or you can add this to the UA menus by adding the following lines to /usr/lib/ua/Floppy file: # Name = MicroFloppy Format (10 Sectors) Default = Run Run = SH -pwd /usr/bin/MFformat10.sh Help = EXEC -d /usr/bin/uahelp -h /usr/lib/ua/ua/hlp -t "Format Floppy" And create the MFformat10.sh script by editing one of the existing format scripts or just inserting the following: #sccs "@(#)adminbin:MFformat10.sh 1.1" # MFformat10.sh # PURPOSE: Format a 10 sector/track MicroFloppy disk using the iv function # CALLED BY: Floppy object file in /usr/lib/ua # REQUIRED FILES: /etc/iv, /usr/lib/iv/FD10 files # ------------------------------------------------------------------------- ERROR1="You have a disk mounted already!\n\nPossible reasons: you have another Floppy window opened or you did a 'mount' on the system.Please dismount the floppy disk by closing the 'Floppydisk' window or issue a 'dismount -f' in the 'Unix' window before attempting this operation." LOCKFILE=/tmp/FinUse.lock ERRINUSE="The floppy disk is already in use by another application. Please wait for the disk to finish before starting again." MUSTBECON="You may not format floppy disks from a remote terminal." TERMCAP= export TERMCAP umask 022 ## LIMIT FORMATTING TO CONSOLE USERS TTY=`tty` expr "$TTY" : "/dev/w." > /dev/null 2>&1 if [ $? != 0 ] then message -u "$MUSTBECON" exit 1 fi ## CHECK THAT FLOPPY IS NOT IN USE BY OTHER OPERATIONS. if [ -s $LOCKFILE ] then sh /usr/bin/Funlock.sh if [ $? != 0 ] then message -u "$ERRINUSE" exit fi fi ## CHECK THAT THE FLOPPY IS NOT MOUNTED. DEVNUM=`mount | wc -l | cut -c7-7` if [ "$DEVNUM" != "1" ] then clear message -cu $ERROR1 exit fi message -cu "Please insert the floppy disk for formatting.\n\nWARNING: this will erase whatever is currently on the floppy disk!" if [ $? != "0" ] then exit fi clear echo "\n\n\n\n\n Floppy format in progress\n\n\n\n" echo "$$ Fformat10.sh" > $LOCKFILE GO=1 while [ "$GO" = 1 ] do GO=0 iv -i /dev/rfp020 /usr/lib/iv/MF10nl > /dev/null 2>&1 if [ "$?" != "0" ] then clear message -cu "^GCannot format floppy disk. Possible reasons include: disk has silver write-protect tab on it (remove tab); disk is not inserted or is inserted improperly; latch is not closed or disk is bad. Please check floppy disk." if [ $? != "0" ] then dismount -f > /dev/null 2>&1 rm -f $LOCKFILE exit fi GO=1 else mkfs /dev/rfp021 > /dev/null 2>&1 dismount -f > /dev/null 2>&1 clear message -iu "The floppy diskette is now formatted.\n\nPlease press Enter to continue." fi done rm -f $LOCKFILE 5.3 Creating a bootable UNIX system on floppy Using either the MF10sl or MF10vl iv format descriptors, you can create a floppy with a boot loader. This is particularly useful to create a bootable diskette with diagnostic software and enough of the UNIX system to run without the hard disk. This can be used if you need to repair your hard disk file system after a crash. [from lenny@icus.islp.ny.us (Lenny Tropiano)} The procedure is quite simple, basically what I did was to format a 3.5" 720K disk (in your case 5.25") with the verbose loader [ use MF10vl above -RLH]. Now I have a bootable floppy with the verbose loader. The verbose loader allows you to enter the program to boot off (this will allow me to boot either /unix or /s4diag off the floppy) Now here's a basic list of the files you need to put on your floppy disk. All of this should fit in less than 800K (that's how much you get when formatting with 10 sec/trk) /UNIX3.51 linked to /unix <- copy this off the "Floppy Boot disk" do not use the one on the hard disk These can be taken from the hard disk: /bin /bin/cat /bin/chgrp /bin/chmod /bin/chown /bin/cp linked to /bin/ln /bin/cpio /bin/date /bin/df /bin/echo /bin/file /bin/find /bin/grep /bin/ls /bin/mkdir /bin/mv /bin/pwd /bin/rm /bin/sh /bin/stty /bin/sync /bin/tail /bin/wc Make the following nodes (mknod)... It's easiest to use cpio to create those files.... /dev /dev/console /dev/fp000 /dev/fp001 /dev/fp002 /dev/fp003 /dev/fp004 /dev/fp005 /dev/fp006 /dev/fp007 /dev/fp008 /dev/fp009 /dev/fp00a /dev/fp00b /dev/fp00c /dev/fp00d /dev/fp00e /dev/fp00f /dev/fp010 /dev/fp011 /dev/fp012 /dev/fp013 /dev/fp014 /dev/fp015 /dev/fp016 /dev/fp017 /dev/fp018 /dev/fp019 /dev/fp01a /dev/fp01b /dev/fp01c /dev/fp01d /dev/fp01e /dev/fp01f /dev/fp020 /dev/fp021 /dev/kmem /dev/mem /dev/null /dev/rfp000 /dev/rfp001 /dev/rfp002 /dev/rfp003 /dev/rfp004 /dev/rfp005 /dev/rfp006 /dev/rfp007 /dev/rfp008 /dev/rfp009 /dev/rfp00a /dev/rfp00b /dev/rfp00c /dev/rfp00d /dev/rfp00e /dev/rfp00f /dev/rfp010 /dev/rfp011 /dev/rfp012 /dev/rfp013 /dev/rfp014 /dev/rfp015 /dev/rfp016 /dev/rfp017 /dev/rfp018 /dev/rfp019 /dev/rfp01a /dev/rfp01b /dev/rfp01c /dev/rfp01d /dev/rfp01e /dev/rfp01f /dev/rfp020 /dev/rfp021 /dev/swap /dev/syscon linked to /dev/systty /dev/tty /etc /etc/chroot /etc/devnm /etc/fsck <- a must for any repairing /etc/fsdb <- only if your a fs-guru /etc/group /etc/ldrcpy /etc/magic /etc/mkfs /etc/mknod /etc/mnttab /etc/mount /etc/ncheck /etc/passwd /etc/reboot /etc/umount /etc/utmp /lib /lib/shlib <- take this from the "Floppy Filesystem Disk" /mnt /s4diag <- copy off your favorite diagnostic disk ... /tmp --- Now create a file in the /etc directory of your floppy called: /etc/profile: > /etc/mnttab PATH=:/mnt/bin:/bin:/etc; export PATH HISTFILE=/.kshistory;export HISTFILE HISTSIZE=128;export HISTSIZE stty erase '^h' kill '^u' intr '^c' echoe echo "Floppy UNIX Started" --- Now to test it all ... Shutdown your machine, reboot with the floppy inserted. When it boots and asks you to load from which device, select "2" for Floppy. Then it will ask you to enter the name of the program to load, you'll enter /unix (to boot unix) and /s4diag (for diagnostics). If all goes well (if you are booting /unix) you'll get the familiar prompt to insert the "Floppy Filesystem disk" and press any key. But in this case you already have it in there :-) So just press a key ... It should continue loading ... Finally it will say "Floppy UNIX Started" and give you a "#" prompt. You're up! Now you can do things like ... # fsck /dev/rfp002 # mount /dev/fp002 /mnt # ls /mnt/bin <- look at the /bin directory on the HD. # umount /dev/fp002 # sync; sync; sync; reboot [ andvancleef@netcom.COM (Henry van Cleef) added:] Use cpio -p to copy the /dev/ nodes to the bootable floppy from the hard disk/ Then do some dleting and linking to make sure that our major and minor device numbers match the list. This is quicker and easier than using mknod for all of those nodes. 5.4 Other formating comments: [from: andy@scp.caltech.edu (Andy Fyfe)] And included is my fdformat perl script, that I use to format floppies. #!/bin/sh # This is a shell archive (shar 3.46) # made 01/28/1993 06:04 UTC by andy@kodiak # Source directory /tmp_mnt/ufs/vortex/andy # # existing files will NOT be overwritten unless -c is specified # # This shar contains: # length mode name # ------ ---------- ------------------------------------------ # 1872 -rw-r--r-- fdformat # # ============= fdformat ============== if test -f 'fdformat' -a X"$1" != X"-c"; then echo 'x - skipping fdformat (File already exists)' else echo 'x - extracting fdformat (Text)' sed 's/^X//' << 'SHAR_EOF' > 'fdformat' && #!/usr/local/bin/perl eval 'exec /usr/local/bin/perl -S $0 "$@"' X if $running_under_some_shell; X do 'getopts.pl' || die "can't load getopts\n"; X &Getopts("Dl:c:h:s:"); X $loader = defined($opt_l) ? $opt_l : ""; $cyls = defined($opt_c) ? $opt_c : 80; $hds = defined($opt_h) ? $opt_h : 2; $secs = defined($opt_s) ? $opt_s : 10; X if ($loader) { X if ($loader eq "none") { X $loader = ""; X } X else { X $loader = "/usr/lib/iv/s4load.$loader"; X die "unknown loader $loader\n" if (! -r $loader); X } } die "illegal number of cylinders $cyls\n" if ($cyls != 40 && $cyls != 80); die "illegal number of tracks/cylinder $hds\n" if ($hds != 1 && $hds != 2); die "illegal number of sectors/track $secs\n" if ($secs != 8 && $secs != 10); X print "Floppy parameters:\n"; print "\tsize: ", $cyls * $hds * $secs / 2, "k"; print " [$cyls cyls * $hds trks/cyl * $secs secs/trk]\n"; if ($loader) { X print "\tloader: $loader\n"; X $loaderskip = 7; } else { X print "\tloader: none\n"; X $loaderskip = 1; } X open(DESC, ">/tmp/iv_$$"); X print DESC "type FD\n"; print DESC "name Floppy\n"; print DESC "cylinders $cyls\n"; print DESC "heads $hds\n"; print DESC "sectors $secs\n"; print DESC "steprate 0\n"; print DESC "singledensity\n"; print DESC "\$\n"; print DESC "loader $loader\n" if $loader; print DESC "\$\n"; print DESC "\$\n"; print DESC "0\n"; print DESC "$loaderskip\n"; print DESC "\$\n"; print DESC "\$\n"; X close(DESC); X sub execute { X local ($cmd) = @_; X print "$cmd\n"; X if (!defined($opt_D)) { X return system "$cmd"; X } X else { X return 0; # indicate success X } } X print "formating......\n"; $ret = &execute("/etc/iv -iv /dev/rfp020 /tmp/iv_$$"); unlink("/tmp/iv_$$"); die "format failed\n" if ($ret == 1); X print "making a file system......\n"; &execute("/etc/mkfs /dev/fp021"); &execute("/etc/dismount -f >/dev/null 2>&1"); X Xexit 0; SHAR_EOF chmod 0644 fdformat || echo 'restore of fdformat failed' Wc_c="`wc -c < 'fdformat'`" test 1872 -eq "$Wc_c" || echo 'fdformat: original size 1872, current size' "$Wc_c" fi exit 0 ================================================================== 6. Credits: The following people originated significant portions of the advice and information in the article. Much of it was compiled from old Usenet articles. Some of their mail addresses are no doubt out of date. lenny@icus.islp.ny.us (Lenny Tropiano) thad@cup.portal.com (Thad P Floryan) lii@cbnewsd.ATT.COM (louis.i.ingwersen) cmv@ihlpf.ATT.COM (C M Votava) todd@ivucsb.sba.ca.us (Todd Day) jbm@uncle.UUCP (John B. Milton) egray@fthood.UUCP (Emmet P. Gray) jan@bagend.UUCP (Jan Isley) tom@astro.as.arizona.edu (Thomas J. Trebisky) dnichols@ceilidh.beartrack.com (Don Nichols (DoN.)) vancleef@netcom.COM (Henry van Cleef) roger@booth.uucp (Roger Abrahams) dave@galaxia.network23.com (David H. Brierley) cwr@crash.cts.com (Will Rose) lowen@lorc.UUCP (Lamar Owen) rwilson@uts.cc.wayne.edu (Ron Wilson) psfales@cbnewsc.ATT.COM (Peter Fales) david@ms.uky.edu (David Herron) jon@jonlab.UUCP (Jon H. LaBadie) andy@scp.caltech.edu (Andy Fyfe) frank@halcyon.com (Frank Higgins) --- Robert Haar InterNet : rhaar@gmr.com Computer Science Dept., G.M. R & D Center DISCLAIMER: Unless indicated otherwise, everything in this note is personal opinion, not an official statement of General Motors Corp.