|
||
|
| DOS |
Email This
View My Personal Library |
|
Operating Systems February 2000 Vol.4 Issue 1 |
DOS Fixing DOS & Making It Run Better | ||
|
Jump to first occurrence of: [CONFIG.SYS] DOS controls all connections between a PC's central processing unit (CPU) and peripherals attached to the PC's motherboard. When you read, save, or print a file, the PC relies upon DOS to get the job done. DOS even manages the computer's memory use. But DOS is limited in how much memory it can handle and how many programs it can run at once. When it shares these operating decisions with an interface such as Windows, DOS still works behind the scenes. The graphical user interface (GUI) of Windows 3. x and Windows 95 (Win95) are easier to use than DOS, so why do so many PC users return to the blank screen with the blinking cursor at the C> prompt? The answer is simple: economy and speed. DOS programs run faster than Windows applications, and DOS machines don't need extra memory and costly equipment. Many users like DOS because it is the fastest and most reliable operating system available for IBM-compatible computers. (A GUI, such as Windows, uses graphical symbols called icons and menus to carry out commands, open files, and select options.) DOS comes in more than one version. The most recent retail version of MS-DOS, the DOS version made by Microsoft, is version 6.22. Microsoft bundles MS-DOS 7.0 with Win95, but doesn't sell it separately. No operating system is fine-tuned right out of the box. As hardy and reliable as DOS is, it can cause unexpected problems when you add newer equipment or updated software to your computer system. You can solve many of these problems by adjusting DOS to control how it loads programs, where it puts them in memory, and setting the amount of memory available for applications. Regardless of which version of DOS you use, expect some trouble when you run older applications on newer computers. Problems can arise with hardware device drivers (programs that enable two-way communications between a computer and peripherals) and software that make assumptions about the physical hardware or limits of the system, such as the amount of memory or disk size. Some old DOS programs, for example, compute hard drive space using techniques that assume a drive won't have more than 512 megabytes (MB) of available space. When DOS confronts a large hard drive, unpredictable and undesirable results can occur. Similar problems are caused by old DOS programs that assume a computer will not have more than 16MB of extended memory, which is the name for all the memory after about the first megabyte. Still another common problem develops with DOS programs that directly manipulate video hardware. If a program uses undocumented or unsupported techniques for using the display, problems will arise if the program does not know how to deal with the extended color depth or extended screen sizes available on contemporary monitors and systems. There are no sure solutions to these incompatibility problems. Unless the developer of a DOS application that has problems on newer hardware is still providing updates for it, you will have to choose between keeping an older computer system or giving up that application. Also, keep a sharp eye on equipment needs listed on hardware boxes when you purchase new equipment. Not all hardware will work on a DOS-only PC. Some inkjet printers, for example, do not print from DOS screens or work at all with DOS applications. Similar hardware incompatibility problems can crop up with modems and scanners. DOS is pretty rugged, but it certainly isn't invincible. Installing software upgrades and new hardware can interfere with a computer's existing settings. To ensure a speedy recovery from inadvertent problems, keep an up-to-date backup copy of the computer's basic control files, Autoexec.bat and Config.sys, on diskette. An emergency bootable diskette lets you bypass changes made to settings stored on the hard drive that prevent the computer from booting. Storing backup copies of Autoexec.bat and Config.sys let you quickly undo changes that can cause the computer to malfunction. Here's how to make a bootable diskette with a copy of these files:
Label this diskette and place it in a safe location. If you need to start your computer when it doesn't boot properly from the hard drive, just insert this diskette and press the CTRL-ALT-DEL keys together (also called a warm reboot). When the computer restarts, type these commands at the DOS prompt: copy autoexec.bat c:\ (press ENTER). copy config.sys c:\ (press ENTER). For more information about making backup files, see "Backup Strategies: Being Prepared For Hard Drive Problems" in this issue. For more information about Autoexec.bat and Config.sys, see "Using & Fixing Autoexec.bat Files" and "Using & Fixing Config.sys Files." Often, the best way to make programs that have problems running in DOS better is to configure how DOS uses memory. Most later versions of DOS include a memory-setting utility called MemMaker (Memmaker.exe). This program checks how a computer is using its memory and calculates the most-efficient combination of options to maximize the amount of free memory left for applications. MemMaker makes changes to the Autoexec.bat and Config.sys files and reboots the computer so you can try the new memory settings. If you decide you don't want to keep those changes, you can always restore the original settings. Running MemMaker is easy; just type memmaker at the DOS prompt and follow the on-screen directions. (NOTE: MemMaker is not installed in MS-DOS 7.0 because Win95 handles its own memory management.)
Computer memory is a confusing topic, but understanding the basics of memory will help you get the best performance from your computer. Some DOS programs will refuse to run if there isn't enough memory available. You might have a computer with 4MB of memory, but the DOS application thinks the 495 kilobytes (KB) of random-access memory (RAM) it needs isn't available because it only finds 490KB available. This happens because there is both low and high memory, and some DOS programs can only handle low memory. You can set up the computer so it boots with five more kilobytes of RAM so the demanding DOS program will be loaded without balking. To understand this process, let's tackle conventional memory. In the DOS world, conventional memory is the first 640KB of the computer's RAM. In the early 1980s, PCs boasted just 640KB of memory. When the designers built in more memory, they made 640KB of RAM the limit. Back then, that much memory seemed like an unfillable, large space. Today's software needs much more memory to run than programs designed for older computers. As the operating system grew larger, less of that 640KB was available for programs. PC makers needed memory beyond the 640KB DOS limit. Computer designers solved that problem by stacking memory above the 640KB limit in two layers. The first layer of higher memory is called extended memory (XMS), which is an upper memory area that gives the operating system more room to work. But the memory extension is limited to 1MB. Memory management software such as Himem.sys arranges the resources so some of the operating system's routines can be stored in extended memory. The second layer is called expanded memory (EMS). It uses a programming trick to get beyond the 640KB RAM barrier. A "door" of 64KB of RAM is set aside so program code can be shifted in and out in 64KB chunks. When the computer requires a 64KB chunk not currently shifted in, expanded memory software finds and inserts the chunk into the door. This occurs so fast the computer appears to have more than 640KB of memory. Extended and expanded memory sound the same, but they aren't. Extended memory is RAM above 1MB. It is found on the motherboard and is directly accessible to the microprocessor. Expanded memory isn't. EMS gets around the 640KB barrier using a trick called bank switching. A bank of conventional memory is set aside to be swapped in and out as needed, providing up to 8MB of apparent RAM. With expanded memory, a program must wait until the memory circuits swap the correct bank of memory into conventional memory. This gives slower access times than extended memory. Keep the meaning of these two terms handy when you configure your Config.sys and Autoexec.bat files. When you run MemMaker, the process is automatic, but you will still have to tell MemMaker what to do with extended memory. MemMaker asks if any programs need extended memory, and if so, how much. If any of your DOS applications require extended memory, the users manual will tell you how much is needed. Otherwise, tell MemMaker you want no extended memory. MemMaker is not infallible. Quite often, you can get more available memory below 640KB by sending more programs into upper memory than DOS' own memory management software does. Use the LOADHIGH command (LH) in the Config.sys file to place the programs DOS loads at boot up into upper memory. Then do the same thing in the Autoexec.bat file. This leaves more RAM in lower memory free to run your DOS applications, especially games. From the DOS prompt, open the Config.sys file by using the EDIT command to add the LOADHIGH command (see Figure 2). At a DOS prompt, type edit c:\config.sys then press ENTER. Type lh in front of each program listed in the file. Here is a typical Config.sys file with the LOADHIGH command in place:
DOS=HIGH DEVICE=C:\SBCD\DRV\SBIDE.SYS /D:MSCD001 /V /P:168,10,36E loadhigh c:\dos\doskey lh c:\programs\myprog.exe Save the file by pressing ALT-F-S. Exit by pressing ALT-F-X. Now do the same thing with the Autoexec.bat file. Try loading programs listed there into upper memory with the LOADHIGH command. When you reboot the computer after making these adjustments to the Config.sys and Autoexec.bat files, type mem at the DOS prompt to see how much free memory you saved. Check the line towards the bottom of the report that reads "total memory under 1 mb." Also, try changing the order that programs are loaded in these two files. A program's size determines where DOS places it in upper memory. Like fitting a variety of objects with different shapes into a box, how items fit around each other can change how many objects can be crammed into the box with a minimum of unused space left over. Later versions of DOS have three built-in disk maintenance utility programs you should use regularly. ScanDisk (Scandisk.exe), Defrag (Defrag.exe), and Check Disk (Chkdsk.exe) can prevent problems on hard drives and diskettes. They also can solve problems when a computer can't read a disk. ScanDisk. ScanDisk analyzes a disk for errors and repairs any problems it finds (see Figure 3).
Let's look at a sample SCANDISK command line with some popular parameters.
c:. Tells ScanDisk to examine the C: drive, which is usually the PC's hard drive. Change this to "a:" or "b:" to examine a diskette in one of these two drives. /ALL. Tells ScanDisk to check all the sub-directories. /AUTOFIX. Tells ScanDisk to make repairs without asking permission from the user. /SURFACE. Instructs ScanDisk to diagnose the drive's surface and mark any defective areas so that the files will not be saved in those areas, thereby making these files unreadable. Here are some additional parameters to tailor how ScanDisk works. You can use any number of parameters on one command line.
scandisk /fragment <drivename> <filename>. Checks a file you name for fragmentation. By itself, this information isn't very useful unless you need to make sure a particular file is saved without any wasted space. /nosave. Tells ScanDisk to delete lost clusters rather than save them. /nosummary. ScanDisk routinely prompts you for an Undo disk. This switch prevents the prompt. /checkonly. Checks a drive for errors but does not repair any damage it finds. These ScanDisk parameters give you a powerful error-correcting utility. Defrag. The Defrag utility keeps all parts of a file in contiguous sectors so the hard drive or diskette drive can find and load data more quickly. Run Defrag at least once a month. If you frequently add and delete files to your system, you should use Defrag on your drives even more often. Heavily fragmented drives will take noticeably more time to load and save files. When you notice the computer slowing down, defrag the drives. Defrag reorganizes the files on a disk to optimize disk performance. DOS saves files in segments to fill available free space on a disk. The more fragmented a disk becomes, the longer it takes to read a file. From a DOS prompt, type defrag followed by the options you want. Here is a sample command line to run Defrag: defrag c: /f As in the ScanDisk example, the "c:" can be changed to run Defrag on a different drive. The /F parameter tells Defrag to fully optimize all files, leaving no empty storage clusters between them. As an alternative, use /U to defragment files, but not the spaces. This is quicker but doesn't provide maximum free space. Check Disk. The CHKDSK command checks the status of a disk and displays a status report. The status report shows errors found in the MS-DOS filing system, which consists of the File Allocation Table (FAT) and directories. It also can fix disk errors. It isn't as thorough as ScanDisk, but if you use a DOS version earlier than 6.0, you don't have a choice. From the prompt, type chkdsk, followed by the options you want. Here is a sample command line to run Chkdsk: chkdsk c: /f /v Again, you can change the "c:" to the drive letter to be checked. The /F parameter fixes errors found on the drive. The /V parameter displays the name of each file in every directory as the drive is checked. Running CHKDSK without /F will list the errors located, but they won't be repaired. Use ATTRIB (Attrib.exe) and CHOICE (Choice.exe) to troubleshoot problems with booting your computer or running a program. Attrib. This tiny utility displays or changes file attributes that control whether a file or entire directory is a hidden, read-only file or is able to be copied (an archive file). At the DOS prompt, type the command and one or more parameters for the job you want done. A plus sign turns the option on; a minus sign turns the option off.
+R. Sets the Read-Only file attribute. -R. Clears the Read-Only file attribute. +A. Sets the Archive file attribute. -A. Clears the Archive file attribute. +S. Sets the file as a System file. -S. Clears the System file attribute. +H. Sets the file as a Hidden file. -H. Clears the Hidden file attribute. /S. Processes files in the current directory and all of its subdirectories. Choice. If your computer is having trouble booting, or if you only want to run some of the programs listed in the Autoexec.bat file, you can select what you want by having DOS give you a Yes/No/Continue (Y/N/C) option after each item during the boot sequence. Use the EDIT command to open the Autoexec.bat file. Type this command on the first line: choice /c:ync This tells DOS to display the message "press Y for yes, N for no, C for continue" after every program that launches from the batch file (provided you precede each command with choice). You can add the /S parameter to force the CHOICE command to be case-sensitive. If you want DOS to accept only a capital letter in response, use the SHIFT and letter key in the command line: choice /c:YNC /S This is how a portion of Autoexec.bat will appear after you edit the file: choice SET TEMP=C:\DOS choice SET MIDI=SYNTH:1 MAP:E MODE:0 choice SET SOUND=C:\PROGRA~1\ CREATIVE\CTSND choice SET BLASTER=A220 I5 D1 H5 P330 E620 T6 Use the /N parameter to force the CHOICE command not to display the Y/N/C prompt. The specified keys, however, are still valid. Troubleshooting DOS does not require technical training. Get familiar with the commands and controls that operate your computer. When trouble occurs, check the most recent changes introduced to the system and undo them. By tweaking DOS to make it run more efficiently, you have what is still a useful operating system that can run by itself or with a Windows operating system. by Jack M. Germain
|
|
Home Copyright & Legal Information Privacy Policy Site Map Contact Us