Smart Computing ® Smart Computing ®
Top Subscribe Today | Contact Us | Register Now   
middle
Home | Tech Support | Q&A Board | Article Search | Subscribe & Shop   


DOS Email This
Print This
View My Personal Library

Operating Systems
February 2000 • Vol.4 Issue 1
Add To My Personal Library

DOS
Fixing DOS & Making It Run Better
Jump to first occurrence of: [CONFIG.SYS]

Computing today is a Windows world, but the venerable Disk Operating System, better known as DOS, is still the operating system that runs more personal computers than all other platform environments combined. DOS can stand alone as an operating system and remains the backbone that supports the Windows operating environment and the Windows 95 operating system. Many Windows users revert to DOS to perform specialized tasks and improve their systems' performance. For both the computer novice and the seasoned pro, the DOS prompt is the real "window" to get the power of the PC working for you.

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.



Potential Upgrading Problems.

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.



Recover With A Backup.

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:

  1. 1. Place a blank diskette in drive A:.
  2. 2. At a DOS prompt, type copy sys a:\ (press ENTER).
  3. 3. Type copy c:\autoexec.bat a:\ (press ENTER).
  4. 4. Type copy c:\config.sys a:\ (press ENTER).


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."



Maximize Your Memory.

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.)



Figure 1. The MEM command in DOS reports the use of base and expanded memory. This screen shows a test computer with 40MB of memory. This is much more memory than the typical DOS computer needs.
A related DOS command called MEM (Mem.exe), shows the current status of the computer's memory use (see Figure 1). Type mem at a DOS prompt to get a readout of the computer's memory allocation.



Understanding Memory.

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:



Figure 2. The EDIT command takes you to a main screen that looks like a typical text editor. Drop-down menu options make it easy to load and edit control files for DOS.


    DEVICE=C:\DOS\HIMEM.SYS
    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.



Keeping Things Tidy.

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).



Figure 3. ScanDisk comes bundled with DOS 5.0 and higher. It is needed to diagnose and fix corrupt files and troublesome hard drives.
If you use your computer frequently, run ScanDisk once a week as part of your PC's maintenance. You also should run it when you can't access a file. From a DOS prompt, type scandisk, followed by the parameters you want. Parameters are placed at the end of commands; they let you run a command with the options you want.

Let's look at a sample SCANDISK command line with some popular parameters.



    scandisk c: /all /autofix /surface



    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 <drivename> <filename>. Lets you fix a corrupt file that will not load properly. This is faster than scanning the entire drive.

    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.



Other Helpful DOS Utilities.

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.



    attrib +r-r +a-a +s-s +h-h



    +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 /c:ync
    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




Useful DOS Programs


You might think there are no longer any good programs available for DOS, and in truth, the numbers are decreasing. These are some DOS applications available to make your computing time more efficient and safer. Visual dBASE 5.7. During our searches, we found that dBASE 5.0 for DOS is no longer available, but Visual dBASE 5.7 is, and it reads and writes dBASE DOSfiles. For more information about dBASE 5.0 for DOS, visit http://www.dbase2000.com/Productdbolder.htm#db5dos.

Office 98 for DOS. New Deal's Office 98 for DOS package is a powerful office suite based upon the GEOS multitasking graphical user interface and provides the functionality of both a complete operating system and a complete application suite. It contains word processor, spreadsheet, database, graphics, personal finance, and telecommunications programs. For more information about Office 98 for DOS, visit http://www.newdealinc.com.

Professional Write 3.0 for DOS. Serif/SPC Inc.'s Professional Write 3.0 for DOS is a powerful word processing package available in a standalone version.

It has both mouse-based pull-down menus and fast keyboard commands. While still available (800/557-3743), Pro Write 3.0 is not Y2K compliant and the company does not offer technical support for it.

Norton AntiVirus 4.0. Keep your DOS-based computer system and your crucial data free from severe damage. Symantec's Norton AntiVirus 4.0 for DOS is an easy-to-use package that detects, destroys, and prevents virus infection. It can even remove unknown and polymorphic viruses. For more information about Norton AntiVirus 4.0, visit http://www.symantec.com/nav/nav_3.x.html.

Norton Utilities 8.0 for DOS. Symantec's Norton Utilities 8.0 for DOS has all the powerful tools that have made it the worldwide standard for data protection and recovery plus significant new features and enhancements to diagnose hardware problems, recover corrupted and deleted files, and improve system performance. For more information about Norton Utilities 8.0, visit http://www.symantec.com/nu/nu_3xdos.





More DOS Information


For more information about DOS, Microsoft's Knowledge Base is a definitive source for DOS troubleshooting. Start searching for answers at http://www.microsoft.com/Support.



DOS Newsgroups On The Internet:
  • alt.msdos
  • alt.msdos.programmer
  • comp.os.msdos










Want more information about a topic you found of interest while reading this article? Type a word or phrase that identifies the topic and click "Search" to find relevant articles from within our editorial database.

Enter A Subject (key words or a phrase):
ALL Words (‘digital’ AND ‘photography’)
ANY Words (‘digital’ OR ‘photography’)
Exact Match ('digital photography'- all words MUST appear together)





Home     Copyright & Legal Information     Privacy Policy     Site Map     Contact Us

Copyright © 2009 Sandhills Publishing Company U.S.A. All rights reserved.