Wednesday, August 29, 2007

Customization of DOS with CONFIG.SYS

Customizing DOS with CONFIG.SYS

Working With DOS System Files 5/5/03

CONFIG.SYS is a system file that is made to be changed. Commands and device drivers are located in the CONFIG.SYS file. CONFIG.SYS can be used for vital tasks such as memory management (arrangement of memory addresses used by DOS programs). Doublespace program can be included in the CONFIG.SYS, allowing the doubling of disk space through disk compression. There are also multi-configuration options available, which allow you to change your configuration at bootup depending on your needs. In the bootup process, CONFIG.SYS loads into memory prior to COMMAND.COM. To view its contents, you must first be in the root directory of your hard drive, which will be indicated by the C:\> prompt. Along side this prompt, type the following: EDIT CONFIG.SYS. In all likelyhood you will see something like this:

Before editing the CONFIG.SYS file, it is a good idea to make a copy of it so you can restore its previous settings. This may be necessary in that it is possible to render your system non-functional through incorrect changes to the file. To make a copy, type the following: COPY CONFIG.SYS CONFIG.BAK. If you later need to restore the previous settings you can use the following commands in the following order:
These commands will replace the existing CONFIG.SYS with one that is known to work.

The following describes the most commonly used parameters for CONFIG.SYS and how they are used. The commands must follow a proper format, as shown in the command’s syntax.
FILES - The Files command describes how many file handles DOS can keep track of simultaneously. A file handle is simply another name for open file. If DOS discovers that a program exceeds this limit as it tries to open a file, DOS responds by saying there are too many files open. The highest number the system will allow is 255.
BUFFERS - The Buffers command determines the number of buffers that DOS creates, so it can store disk information in RAM rather than on disk. This will lessen the need for constantly accessing the hard drive, reducing the number of read and writes, and speeding up the overall operation of the computer. A windows-based computer should have a lower number of buffers.
DEVICE - Every device that is connected to a computer relies on a piece of software called a device driver, in order to communicate with the operating system
A.These drivers are sometimes included with DOS.
B. Drivers for those devices that are not included with DOS must have a pointer in the CONFIG.SYS file that directs DOS to the correct address for the driver.
1. The pointer is the DEVICE= command.
2. The DEVICE= command is executed through the CONFIG.SYS at bootup. DOS will find the driver and load it into memory.
3. The syntax for the DEVICE= command is:
DEVICE= [d:path] filename.
4. Many kinds of software require the use of device drivers, such as DOS own memory management program. The memory management drivers are HIMEM.SYS and EMM386.EXE. Other drivers include DOUBLESPACE.SYS, which is a device driver for DOS’ DOUBLESPACE disk compression program.
Memory Management involves loading portions of DOS or complete DOS program into areas of memory normally not accessible. This is an essential part of optimizing DOS for high performance, as it makes more memory available to other programs, including Windows. Some DOS programs require contiguous blocks of memory to run and using memory management may allow them to fit into memory. DOS is capable of working with 1,024KB of memory addresses under most circumstances.
A. DOS was originally designed to work with the Intel 8088 CPU that IBM picked out for the original PC back around 1980.
B. The 8088 could address 1,024KB of memory, which at the time was a colossal amount of memory.
C. These early programmers also had to decide how those 1,024KB of memory addresses would be used.
1. They decided that the first 640KB called conventional memory would be used for programs, data and the operating system itself.
a. Most programs written for DOS are designed to work within the first 640KB of memory which is sometimes called the 640K barrier.
2. The area between 640KB and 768KB is reserved for video memory.
3. The upper area from 768KB to 1,024KB (reserved memory or upper memory area) is reserved for ROMs on circuit board such as LAN cards or hard disk controller cards.
4. Originally, the programmers for DOS envisioned that this 640KB would be enough memory space to run any software built for DOS programs.
D. Memory above 1,024KB is called extended memory, and is used by Windows and windows-based programs.
E. Extended memory cannot be accessed unless the HIMEM.SYS memory manager is used.
F. The lowest 640KB of extended memory, from 1,024KB to 1,088KB is called the High Memory Area (HMA)
1. Portions of DOS can be loaded into this area using a memory manager.
HIMEM.SYS is the DOS memory manager that enables extended memory above 1,024K on your system, including the High Memory Area from 1,024KB to 1,088KB. Windows can’t load at all without HIMEM.SYS, and for this reason it automatically invokes it whether it is present or not in the CONFIG.SYS. The syntax for HIMEM.SYS is as follows:
DEVICE= [d:\path] HIMEM.SYS[switches]
1. The DOS=HIGH command is used to load part of DOS into the HMA between 1,024KB and 1,088KB
2. The DOS=UMB command enables DOS to manage upper memory blocks (UMBs).
A. Upper memory blocks are the blocks of free memory in the upper memory area between 640KB and 1,024KB.
B. Using DOS=UMB will mean that DOS is empowered to load programs and device drivers into UMBs.
C. DOS=HIGH and DOS=UMB can be left as separate commands or combined into one statement. Example: DOS=HIGH,UMB
3. The DOS=HIGH command will not work unless HIMEM.SYS device driver is installed.
EMM386.EXE - The EMM#*^.EXE reserved memory manager provides DOS with the ability to utilize upper memory blocks (UMBs) to store programs and device drivers.
A. UMBs reside in the 640KB to 1,024KB region of memory.
B. The EMM386.EXE is also used to simulate expanded memory for DOS applications that utilize 386 enhanced mode.
The syntax for the command is:
C. EMM386.EXE comes with numerous optional switches.
D. NOEMS is a commonly used option for disabling expanded memory. The I= range and the X=range switches are commonly used both by MEMMAKER program and by anyone performing manual memory mapping of the system.
E. The EMM386.EXE driver is often used in conjunction with the DEVICEHIGH and LOADHIGH commands.
1. TheLOADHIGH command is loaded in the AUTOEXEC.BAT and is used to load an application program into upper memory block.
DEVICEHIGH - This command functions precisely as the device command, but with the following exception: It will load the device driver into upper memory blocks thereby freeing up space in conventional memory. If there is insufficient space in the UMB, DOS will load the device drivers into conventional memory. This command requires requires the EMM386.exe invocation to be place in the CONFIG.SYS. The syntax for the command is:
Example: DEVICE=C:\1srjt\sr.sys
Using MEM to verify memory usage
Type Total Used Free
Conventional 640K 44K 596K
Upper 0K 0K 0K
Reserved 384K 384K 0K
Extended 15,360K 2,240K 13,120K
------------ ------------- ----------- ------------
T Memory 16,384K 2,668K 13,716K
T Memory under 1MB 640K
T Expanded (EMS) 20M(20,463,616)bytes
F Expanded (EMS) 13M(13,434,880)bytes
Largest executable Program Size 596K(606,968)bytes
Largest Free Upper Memory Block 0K (0 bytes)
MS-DOS is resident in high memory area.

No comments: