TAMU .99p4 Linux Installation Instructions MINIMUM HARDWARE REQUIREMENTS: 80386 CPU 4MB or more of RAM 40MB of disk space (base) 65MB of disk space (base + X11) RECOMMENDED HARDWARE: 80486 CPU 8MB RAM 80MB disk BEFORE INSTALLATION: 1. Retrieve the appropriate files from sc.tamu.edu: boot.Z 3inch/* for 3.5 inch floppies (HD) 5inch/* for 5.25 inch floppies (HD) Note: the boot diskette must be used in your drive A: but you may use any floppy drive for the install disk set. So if you have a 5.25 a: and 3.5 drive b:, the boot diskette must be 5.25, but the install set may be either 5.25 or 3.5. 2. Uncompress boot.Z 3. Transfer the images to diskettes with either dd (unix) or rawrite (dos). (Rawrite and uncompress for DOS are available from sc.tamu.edu in dos-utils.tar.Z). By the way, dd runs MUCH faster to floppies on a Sun if the blocking is set up correctly. For 3.5 inch floppies on a Sun sparcstation: dd bs=18k conv=sync if=boot of=/dev/rfd0 4. Linux will automatically determine your drive's geometry, with the exception of a few scsi adapters. If you have one of these, you will need to find out your hard disk's geometry. The best way to find out if linux can read your drive geometry is to try fdisk on the boot disk. Note, that you must use DOS's view of the drive geometry - the controller bios may fake the geometry to stay under the 1024 cylinder DOS limit. For example, my 3.5" 510 MB conner drive appears to DOS as 517 cylinders, 64 heads (!!!), and 32 sectors, which is obviously not true. Nevertheless, the partition table must use these faked numbers to keep DOS happy. You can find out your values with Norton/Pctools system info programs, or with diskgeom.exe (available on sc.tamu.edu). 5. Make sure you know what devices/partitions will be used during installation. You need to know the linux name for: install device (which floppy drive will be used for loading the install set - this need not be drive a:) hard disk drive (the drive linux will be installed on) hard disk partition (the partition linux will be installed on) This package uses the standard linux naming scheme: fd0H1440 3.5 inch HD floppy (a:) fd0h1200 5.25 inch HD floppy (a:) fd1H1440 3.5 inch HD floppy (b:) fd1h1200 5.25 inch HD floppy (b:) hda entire ide/mfm first *drive* hda1 .. hda4 first thru fourth *partition* on hda hdb entire ide/mfm second *drive* hdb1 .. hdb4 first thru fourth *partition* on hdb sda entire scsi first *drive* sda1 .. sda4 first thru fourth *partition* on sda INSTALLATION: If your disk will be sharing space with another operating system, such as DOS, it is generally better to install the other system first. The installations instructions contain some comments which appear in parenthesis (like this) and examples of commands which appear in brackets [like this]. There are two installation methods: a simple menu driven installation script for simple configurations (single linux root partition), or manual installation for experienced users with more complex needs. AUTOMATED INSTALLATION: Note: the automated installation uses extended filesystems for linux. I made this the default, as the size and name restrictions of the minix filesystem have caused so many problems, and extfs is reasonably stable. If you really must have a minix filesystem, do a manual install, using mkfs rather than mkefs. A typical installation might have partition 1 for DOS, partition 2 for linux swap, and partition 3 for linux root, all on the first ide hard disk (hda). This configuration will be used in the fdisk examples. 1. Boot the "boot" diskette. This will start the installation program. You will see three initial menu items: 1. run fdisk 2. install backup set 3. exit Once the menu appears, remove the boot floppy. 2. Select (1.) to run fdisk to create a linux partition. You will be asked which disk device to partition, such as hda, hdb, sda, sdb as discussed above. Fdisk has command help available with the "m" command. "fdisk" should be able to determine your disk's geometry. If not, you will need to tell it the number of cylinders, heads, and sectors of your hard disk. Use the "x" command to switch to expert menu. Then use the "c" command to specify the cylinders, "h" command to specify heads, and "s" command to specify the sectors of your disk. Now use the "r" command to return to the starting menu. The instructions here are a little less clear since your partitioning preferences may be different. I will give an example of 3 partitions, one for DOS, one for swap and the other for the root filesystem. I have a 90M drive that I want to partition into 10M for DOS, 10M linux swap and 70M linux root file system. First I use the "p" command to print the partition table. I see that my disk has 1024 cylinders, and that partition 1 (DOS) covers cylinders 1 through 114. Then I use the "d" command to delete any partitions other than DOS (partition 1). I then use the "n" command to create new partitions. "fdisk" will ask me if I want a primary of extended partition: use primary. Next it will ask me where to start the partition: I use cylinder 115. I want my first partition to be a swap partitoin of size 10M. The computer asks me how big to make the partition: I enter 114 cylinders. I create a second primary partition starting at cylinder 229 and make it 796 cylinders in size. By default, all partitions are created as Linux/MINIX partitions. Since we want to use partition 2 for swap, we need to change its type, or "system id". Use the "t" command to change the type: choose partition 2 and choose type 82 "Linux swap". Similarly, partition 3 needs to be changed to type 83 (extfs). A complete list of supported partition types can be obtained using the "l" command. Before we go, use the "p" command to print the partition table and note down the number of blocks for each partition. We will need this in the next step. We are now done with this. Use the "w" command to write the information to disk and exit "fdisk". When you exit fdisk, you will be reminded to reboot, which you must do now, if you changed any partition information with fdisk. To reboot, press -- keys together. If you did not make any changes, simply press return to continue installation. 3. At the main menu, select (2.) for installation from the backup set. This will present a menu to choose the floppy installation source. Then it will ask for the destination drive (such as hda, sda...), destination primary partition on that drive (1,2,3,4), and its size in 1k blocks (which you should have noted in fdisk). It will then ask if you want to load X11 during installation. (X11 is on the distribution disk set. If you say 'n' here, the installation will simply not extract the X11 files from the set.) It will also ask if you want to load the "bootactv" boot time selector, which you will want if you want to select among multiple operating systems at boot time. After this it will ask for confirmation of the installation parameters, with a suitable "WARNING" that the installation will delete all data in the target partition. After confirmation, the installation will prompt for each installation set floppy disk. On the last disk, gzip will probably complain that the input is not in compressed format. This is normal, as it simply represents the null space at the end of the backup set on the last diskette. After the installation completes, choose (3.) to exit the installation program. 4. proceed to the section "FURTHER CONFIGURATION" MANUAL INSTALLATION: 1. Boot your computer with disk "boot". At the maintenance menu, select (3.) to exit to a command shell. 2. Run the "fdisk" command. Partitions the disk as desired and note down the number of blocks allocated to each partition. (see the earlier description of this.) [ fdisk /dev/hda ] 3. Reboot your machine. (Ctrl-Alt-Del or push reset button). 4. Run "mkefs" to create the file system on all non-swap partitions. [ mkefs -c /dev/hda2 72345 ] (I pulled 72345 out of air for this example, but you should used the number of blocks fdisk reported in the previous step.) 5. do the actual installation: [ mount -t ext /dev/hda2 /mnt ] [ cd /mnt ] [ mr /dev/fd0H1440 1440 |gzip -d|tar xBpf - ] (change hda2 fd0H1440 and 1440 as appropriate) 6. Make the hard disk bootable: Change directory to /mnt/etc/lilo, edit the configuration file and run the "lilo" command to setup the computer to boot from the just loaded partition. [ cd /mnt/etc/lilo ] [ /mnt/usr/bin/vi config ] [ ./lilo -C /etc/lilo/config -r /mnt ] (You may need to read the lilo documentation to edit "config" correctly. My config file is shown below. # lilo configuration file compact install = /etc/lilo/boot.b boot = /dev/sda2 image = /vmlinux label = linux root = /dev/sda2 vga = 1 ramdisk = 0 # end of file Basically just change the two "/dev/sda2" entries to your linux partition name.) 7. edit /etc/fstab as appropriate [ /mnt/usr/bin/vi /mnt/etc/fstab ] 8. edit /mnt/etc/rc.local, to modify the efsck line to match your partition information. [ /mnt/usr/bin/vi /mnt/etc/rc.local ] 9. If you have more than one operating system (eg DOS and Linux) and want to have boot time selection of which operating system to run, install bootactv on your boot drive: [ /mnt/bin/cp bootactv.bin /dev/hda ] ( substitute your drive name for "/dev/hda") 10. prepare for reboot: [ cd / ] [ umount /mnt ] [ sync ] FURTHER CONFIGURATION: 1. remove all floppies, and reboot the machine: [ control-alt-delete ] 2. Log in as root by typing "root" at the login prompt. [ root ] 3. You are now mostly done. You will still need to configure /etc/mtools, /etc/fstab (if necessary for swap/cdrom ...), rc.local (to mount /proc), and /usr/X386/lib/X11/Xconfig. You may also want to rebuild the kernel for your configuration (the default kernel has everything in it, and assumes you have only a 80386 processor). Hints for the last two follow later. 4. If appropriate make the swap partition and start swapping. [ mkswap /dev/hda1 10464 ] [ swapon -a ] (Again, I have pulled 10464 from the air. But you should use the number that you got from fdisk) FINAL TIPS: 1. You will get a shadow password error message when logging on as root or user1, until you set passwords with "passwd". 2. root is configured to use twm and user1 is configured to use olvwm. This is easily set by copying the respective .xinitr-twm or .xinitrc.olvwm to .xinitrc in the desired home directory. 3. if you rebuild the kernel, be sure to run "ps -U" to update /etc/psdatabase. 4. if you are new to Linux, be sure to try the four virtual terminals, available with -F1 thru -F4 5. You can use the boot disk for maintenance (in case of filesystem problems, the disk has efsck), or for reinstallation from your own backup set. 6. to make a backup compatible with the installation disk: [cd /] [tar cf - .|gzip|mw /dev/fd0H1440 1440] (or as appropriate for your floppy) questions/comments to: dave safford drs0587@sc.tamu.edu ---------------------------------------------------------------------------- Rebuilding the kernel: 1. cd /usr/src/linux 2. edit the Makefile (if necessary to set the keyboard -- most other items can be set by /etc/lilo/config or make config.) 3. run "make config" This will ask which optional devices you want in the kernel. 4. run "make dep" 5. run "make clean" 6. run "make lilo" (ok for the timid/cautious, you can "make Image" first, as "make lilo" will install the new kernel for boot purposes.) ---------------------------------------------------------------------------- ***SIMPLIFIED X Window Configuration!!!! ***YOU have GOT to try this!!! ***(it even works for trident cards!) In /usr/lib/X11 there are several Xconfig templates: Xconfig.tamu - *DEFAULT* - working copy of Xconfig.1M Xconfig.1M - the install version for 1MB vga cards Xconfig.512K - the install version for 512K vga cards Xconfig - working copy of Xconfig.master Xconfig.master - standard X11 release version (manual install) Xconfig.drs - this is my tailored copy of Xconfig.1M By default, when you run "startx", the server will use Xconfig.tamu, as the hostname is "tamu". This file is a working copy of the .1M easy installation version for 1MB vga cards. If your vga card has only 512K bytes of memory, it can not run in the 1024x768 resolution modes, so you need to use the Xconfig.512K instead. Do this with: [ cp Xconfig.512K Xconfig.tamu ] Then, in Xconfig.tamu: 1. check the mouse definitions, and if necessary, comment out the default (microsoft mouse on ttys0, aka com1:) and uncomment the line corresponding to your mouse type and port. If you are not sure what you have, try the mouse test program in /usr/X386/lib/X11/etc/v1.1/tst/mouse. ** NOTE: apparently the mouse executable in the distribution is bad. If it doesn't work for you, simply recompile it with: gcc -o mouse mouse.c If your mouse has 3 buttons, comment out the "Emulate3Buttons" line. 2. run "startx" There will be 48 available "modes" that are essentially all possible combinations of clocks and resolutions. You can cycle through all of these modes by pressing control-alt-keypad+. (If your vga card has 512K, there will be only 32 modes). The modes are named "1" through "48" and appear in that order. Most of these modes will show garbage on your screen. Jot down the number (ie 1 - 48) of any mode that presents a reasonable display (minor size or x/y offset errors can be trimmed out later.) Hopefully you will find at least one good mode for each of 1024x768, 800x600, and 640x480 display resolutions. Exit X using control-alt-backspace, and then edit Xconfig.tamu, to delete the "bad" mode numbers out of the "Modes" line, leaving just the few good ones you jotted down. (You can look at my final version in Xconfig.drs, which left just three modes on the "Modes" line.) That should be it! No puzzling over the vga database, frequencies, clocks, or dot calculations! This has been tested on several machines with Tseng, trident, and paradise cards. On my own tseng clone, in 1 minute I discovered two very nice modes that I had missed in hours of testing using other methods! (2.1 If necessary, you may need to tweak the dot values in the corresponding mode entries in the ModeDB section, if the display is a little off center. Each mode line in the ModeDB section has 4 numbers for horizontal dots, and four numbers for vertical dots. If the display is a little off in the horizontal or vertical position, try adjusting the MIDDLE two numbers in the respective horizontal or vertical set by 10 or 20 dots. This needs to be done by trial and error, but at least you have a good starting point. ) MANUAL X Window Configuration Instructions ========================================== If for some reason the simplified method doesn't work, you will need to delete Xconfig.tamu, and manually edit the basic Xconfig file. First, read the man pages on X and X386. There are basically two steps in configuring X. The mouse configuration and the screen configuration. Both are done by editing the "Xconfig" file. I will describe these by explaining what the certain lines in "Xconfig" mean and how to use appropriate values in them. Let us first turn to the mouse configuration. There are two things to consider: what is the type of your mouse and which COM port it is connected to. In order to determine you should run the "mouse" program. 1. Go to the /usr/X386/lib/X11/etc/v1.1/tst/mouse directory. Run the "mouse" program and move the mouse and push its buttons. You should see some output from the program indicating that the mouse is operating successfully. Note down the arguments to "mouse" for the next step. [ cd /usr/X386/lib/X11/etc/v1.1/tst/mouse ] [ mouse Microsoft /dev/ttys1 ] (Here the first argument to "mouse" is the name of your mouse. The known mice are: Microsoft, MouseSystems, MMseries, Logitech. The second argument is the COM port or the serial line. Legal values here are "/dev/ttys0", "/dev/ttys1", "/dev/ttys2", "/dev/ttys3". If no output appears following the execution of "mouse" and your moving the mouse, try different combinations of the two command line arguments. You should find one that works, note it down. Now enter these in the "Xconfig" file. 2. Go to the /usr/X386/lib/X11 directory and edit the "Xconfig" file. Find the section that describes the mice. Look for the line similar to the following: Microsoft "/dev/ttys2" Uncomment the line corresponding to your mouse type and specify your mouse serial line as determined by the "mouse" program. [ cd /usr/X386/lib/X11 ] [ vi Xconfig ] 3. If you have a two button mouse, you will need to emulate 3 buttons. To do this just uncomment the line Emulate3Buttons (This will make the simultaneous click of both buttons behave as your middle mouse button.) 4. Save "Xconfig" and exit the editor. (Let us now turn to the video side of X. There are 5 things to consider. All four of these appear as lines in "Xconfig". 1. Chipset -- the chipset of your video card 2. Clocks -- the driving frequencies of your video card 3. Modes -- the resolutions, e.g., 800x600, of screen 4. Virtual -- the "virtual" screen size -- more later 5. ModeDB -- timing information You may be able to get the first four from a vga database of known working configurations. The database is in /usr/X386/lib/X11/doc directory and is called "vga.dbase". Look for your video card in that file. The entry corresponding to my setup looked like this: ####################################################################### # Card: Orchid Prodesigner II # Contributor: John LoSecco [losecco@undpdk.hep.nd.edu] # Last Edit Date: 10/20/91 # # chip ram virtual clocks default-mode flags ET4000 1024 1152 900 25 28 32 36 40 45 50 65 "800x600" Look at the last line. The chipset is "ET4000", clocks are "25 28 32 40 45 50 65", the mode is "800x600" and virtual screen size is 1152x900. If you don't find an entry in the database corresponding to your configuration, use your video board's manual. Let us look at these 5 Xconfig lines one at a time. The "Chipset" line specifies the chipset used by your video card. The supported values are "et4000", "et3000", "gvga", "pvga1". This is probably not an exhaustive list, there may be more. You can get your chipset from the "vga.dbase" file, or your video card's user's manual, or by opening up your PC and looking at the video card and reading the numbers painted on the chip. My "Chipset" line looks like this: Chipset "et4000" The "Clocks line specifies the driving frequencies that your video card supports. This information can be obtained from several sources. You may look it up in "vga.dbase" file, if an entry for your video card exists. You may also look it up in your video card's manual. The third method is to run the X server and catch its startup output in a file and then read it from that file. To do that do the following: a. Comment out the Clocks line from "Xconfig" file b. Start the X server with "startx" command c. Read the line starting with "clocks" and note down the printed values My "Clocks" line looks like this: Clocks 25 28 32 36 40 45 50 65 The "Modes" line specifies the resolution of your screen. The standard values are "640x480", "800x600", "1024x768i", "1024x768", "1280x1024i", "1280x1024". These are the standard values, others are certainy possible. You should choose the highest mode that your video card supports. I will describe shortly how to determine which value to use. For the time being we will stop at saying that this is the number of pixels that your monitor will display on screen. My "Modes" line looks like this: Modes "1024x768" The "Virtual" line specifies the virtual resolution of your screen. This resolution is the same as or larger than your "Modes" resolution. Think of virtual resolution as being the area that your programs think your screen is. The real resolution is a sliding window on your virtual screen that lets you view part of the virtual screen at a time. For example, you could make your virtual screen 1152 by 900 and your real screen 1024 by 768. When the X server starts, you will be looking at the top left corner of the 1152 by 900 screen. As you bring the mouse to the right edge of the screen, your screen will scroll to the right to show the 128 horizontal pixels that could not be shown before. My "Virtual" line looks like this: Virtual 1024 768 And now to bring the whole thing together, we will discuss the "ModeDB" lines. You should find the "ModeDB" line at the end of the "Xconfig" file. You should not need to change these. If you do, use the values found in "Xconfig.sample" first since these are the standard. Your video card is usually capable of driving your monitor at several frequencies. These are the "Clocks" that we saw before. These numbers are the clock frequencies in Mega Hertz. The higher resolution you choose, the higher driving frequencies are needed. Its only natural, since you need to paint more pixels, you need to do it faster, otherwise the previous pixels will fade before you can paint them again. And this fading is the cause of flicker in monitors. You wish to use the highest resolution that your video card can drive and that your video card has the memory to support. Let us look at a "ModeDB" line: # name clock horizontal timing vertical timing flags "1024x768" 65 1024 1032 1176 1344 768 771 777 806 The first entry is the name of the "Mode", in this case "1024x768". The second entry is the frequency needed to drive this mode, in this case 65MHz. From my "Clock" line above, I know that my card has a 65MHz clock. The next eight numbers are the horizontal and vertical timings at that resolution and clock. There is one more thing that I need to ensure before I can be certain that my hardware will support this resolution: Video memory. In order to display 1024 by 768 pixels at each pixel taking a byte of memory, I will need 1024 x 768 = 768 KB. Since my video card has 1 MB of memory, I am OK. If I had only 512 KB of video memory, I could only use the 800 x 600 mode as my highest resolution since it only requires 468.75 KB of memory. Since the virtual screen is stored in video memory, this restriction applies to the "Virtual" screen resolution also. My "ModeDB" lines look like this: ModeDB # OFFICIAL VESA Monitor timings + IBM Standards - TRY THESE FIRST # Contributor: Thomas Roell [roell@sgcs.com] # Last Edit Date: 3/29/92 # # name clock horizontal timing vertical timing flags "640x480" 25 640 664 760 800 480 491 493 525 31 640 664 704 832 480 489 492 520 "800x600" 36 800 824 896 1024 600 601 603 625 40 800 840 968 1056 600 601 605 628 50 800 856 976 1040 600 637 643 666 "1024x768i" 44 1024 1040 1216 1264 768 777 785 817 Interlace "1024x768" 65 1024 1032 1176 1344 768 771 777 806 75 1024 1048 1184 1328 768 771 777 806 85 1024 1032 1152 1360 768 784 787 823 "1280x1024i" 80 1280 1296 1512 1568 1024 1025 1037 1165 Interlace "1280x1024" 110 1280 1328 1512 1712 1024 1025 1028 1054 135 1280 1312 1456 1712 1024 1027 1030 1064 Once again, let me enphasize that one of the clocks supported by your video card must EXACTLY MATCH the clock shown in the above table. If it doesn't, then you can look in some of the other "Xconfig" files for an entry that matches your clock and mode--and can be supported by your video memory. If you still don't find an entry, you can make your own entry by following the instructions given in "/usr/X386/lib/X11/doc/video.tutorial". If that happens, Good Luck!) 5. Edit "Xconfig" and modify the "Chipset", "Clocks", "Modes", "Virtual", and "ModeDB" lines as described above. My entries look like this: Chipset "et4000" Clocks 25 28 32 36 40 45 50 65 Modes "1024x768" Virtual 1024 768 ModeDB # OFFICIAL VESA Monitor timings + IBM Standards - TRY THESE FIRST # Contributor: Thomas Roell [roell@sgcs.com] # Last Edit Date: 3/29/92 # # name clock horizontal timing vertical timing flags "640x480" 25 640 664 760 800 480 491 493 525 31 640 664 704 832 480 489 492 520 "800x600" 36 800 824 896 1024 600 601 603 625 40 800 840 968 1056 600 601 605 628 50 800 856 976 1040 600 637 643 666 "1024x768i" 44 1024 1040 1216 1264 768 777 785 817 Interlace "1024x768" 65 1024 1032 1176 1344 768 771 777 806 75 1024 1048 1184 1328 768 771 777 806 85 1024 1032 1152 1360 768 784 787 823 "1280x1024i" 80 1280 1296 1512 1568 1024 1025 1037 1165 Interlace "1280x1024" 110 1280 1328 1512 1712 1024 1025 1028 1054 135 1280 1312 1456 1712 1024 1027 1030 1064 (You should now be done with the configuration, so save the file and start the X server.) 6. Save "Xconfig" and exit the editor. 7. Start X by using the "startx" command. [ cd / ] [ startx ] (If everything works fine, you should be in X. If they don't here are some things to check for: a. If there is a grey pattern on the screen and the pointer is shaped like an X, but the mouse movement and keyboard activity does not generate a response, then, your mouse is probably configured incorrectly. Reboot your system--recall that the system is not responding to mouse and keyboard activity and you don't have a choice. Check the mouse with the "mouse" program as described earlier and make sure that the corresponding entry is correct in the "Xconfig" file. b. If the server does not start and gives among may other lines a blurb along "not enough memory for the virtual resolution", then, you don't have enough memory for the virtual resolution that you specified. Remember that virtual screen is kept in video memory and therefore its size is restricted by available memory the same way as the real resolution. Make your virtual screen size smaller to something you can fit in available memory. c. X comes up, but your pointer breaks up as you go to the right edge of the screen, then, the "ModeDB" entry is incorrect for your card. Make sure that your chosen "Modes" resolution and one of your available "Clocks" MATCHES EXACTLY on of the entries under "ModeDB". Remember, you should try one of the standard ones first and if these don't work try others. Also, you can create your own by following the instructions in /usr/X386/lib/X11/video.tutorial.