Ana səhifə

Appendix e: ms-dos


Yüklə 0.5 Mb.
səhifə6/8
tarix25.06.2016
ölçüsü0.5 Mb.
1   2   3   4   5   6   7   8

THE MS-DOS BOOT SEQUENCE

Now we have taken a quick look at the system configuration files, config.sys and autoexec.bat, we will summarise the sequence of events from power on to the command processor prompt for an MS-DOS based PC.


The operating system performs the following tasks during the boot sequence:
(i) Executes ROM based diagnostic routines and sets up programmable hardware devices.

(ii) Checks for system software files on the default drive, namely IO.sys, MS-DOS.sys.

(iii) Loads the hidden files IO.sys and MS-DOS.sys from the default drive into RAM.

(iv) Checks for a CONFIG.SYS file and executes it, if present.


(v) Passes control to COMMAND.COM, a file in the root directory of the default drive.

(vi) The command processor looks for autoexec.bat and executes it if present. If there is no autoexec.bat file the command processor prompts for the date and time before handing control over to the user, i.e. it awaits for a command from the keyboard. If there is an autoexec.bat file this is executed first. What happens after this depends on the command sequence in autoexec.bat, but usually it loads a PATH for the various application programs present, set the on screen prompt


Figure 14 MS-DOS BOOT SEQUENCE



DOS MEMORY LIMITATIONS

In the first PCs based on the IBM XT, the maximum memory addressing capability of the 8086/88 CPU, with its 20 address wires, was 1MB, (220 = 1048576 bytes = 1 MB). The 1MB address space was divided up for Application programs, the OS, the BIOS ROM and the Video Display, as shown in the memory map below.


The bottom 640KB of the address space is known as conventional memory and is used by DOS and DOS Application software. The top 384KB holds the BIOS ROM, graphics memory and Expanded Memory (EMS) area. This is known as the upper memory area.

The 640KB maximum memory space assigned to DOS and its applications was more than adequate for the size of programs available at the time. In fact many early XT machines were shipped with 256KB or less, of main system RAM.




Figure 15 Basic memory map an XT system running MS-DOS.
As more powerful CPUs became available the CPUs inherent addressing range increased significantly. The 486 and modern Pentium style CPUs have 32 address wires, so they can directly address a maximum of 4 Gigabytes of RAM. Unfortunately, even though the PC hardware is capable of addressing these huge amounts of memory, DOS isn't! It is held back by the need to offer downward compatibility and is therefore restricted to the 640KB conventional memory limit. The downward compatibility requirement of DOS, until the advent of Windows 95 and Windows NT, held back the progress of the PC compared to other personal computer systems such as the Apple Mac.

EXPANDED MEMORY (obsolete, but sometimes the hapless PC technician still comes across it on some old legacy systems)
In an attempt to increase the memory used by DOS application programs, the Expanded Memory System (EMS) was introduced by Lotus, Intel and Microsoft. The last version, produced in 1987, was known as the LIM 4 specification (sometimes referred to as EMS 4.0). This allowed all XT and AT PCs fitted with an EMS RAM adapter card, and expanded memory manager software, to run applications that would normally demand more memory than the 640KB DOS limit.
EMS uses a technique known as bank switching. Instead of addressing memory contiguously as in conventional memory reads and writes, it copies 16KB blocks of memory from the EMS adapter card to a specially reserved area of RAM in the 384KB upper memory area. The 16KB blocks are known as pages. Four such pages were stored in a block of upper memory known as a page frame. An EMS memory card containing several Megabytes of RAM could therefore store large amounts of data including large application programs. However, because only four pages (64KB), could be copied across to a page frame at a time, the system was inherently slow.
The advantage of the EMS specification is that is allows XT class machines to use larger programs and handle larger amounts of data. The disadvantages were all too apparent. As well as it's slow performance, application software had to be specifically written for the LIM 4.0 driver software.
Memory adapter cards are now a thing of the past as more and more memory is being integrated onto the motherboard. This has the added advantage that ram devices, can now run at the full external CPU bus speed (usually 66MHz), instead of the slow ISA bus speed of 8MHz..
As page switching was a slow and cumbersome process, EMS is now classed as obsolete and is no longer supported by the original vendors. However, it is wise to become familiar with it, as many DOS machines still have EMS installed. The games fraternity, until quite recently, used EMS to increase the size of DOS based games. This allowed better graphics and more elaborate scenarios to be incorporated into the software. Such games are still being sold in most games stores, often at greatly reduced prices.
To install an EMS compatible driver on a PC AT with a 386SX or greater processor, the EMS emulator called EMM386.EXE, supplied with MS-DOS 5.0 or greater, should be used. This is an upper memory manager and EMS emulator, for use with extended memory. Note: Extended memory is discussed later in this section.
As EMS is probably only needed on the odd occasion, e.g., to run DOS based games5, it is best to make a special floppy boot disk, rather than install an EMS driver onto the C: drive. To make an EMS boot disk follow the procedure below:


PRODUCING AN EMS BOOT DISK

To make a DOS bootable floppy disk that will also install 1024KB (1MB) of expanded memory, using DOS 5 to DOS 6.22, follow these steps:




  1. Produce a bootable floppy disk.

  2. Copy config.sys and autoexec.bat from the root directory of drive C: drive to drive A:.

  3. Add an extra line into config.sys to enable the EMS driver.

  4. Check the memory configuration to confirm the new 1024KB EMS portion. In this example a total of 4MB or RAM is installed

The following steps take you through this procedure:



STEP 1: Format a blank disk and install a DOS boot sector and system files by typing

format a:/s then press enter.


STEP 2: Once the boot disk has been created, copy config.sys and autoexec.bat from the root directory of drive C: to the floppy disk A: by typing:

copy c:\config,sys a: then press enter.
copy c:\autoexec.bat a: then press enter.

STEP 3: Now invoke the DOS EDITOR (EDIT.COM) in the DOS directory of drive c: by typing:

c:\dos\edit then press enter.

Once in EDIT, open your existing config,sys file, installed on the root directory of drive A: by typing :


alt f then o
then type a:\Config.sys then press enter.

Your config.sys file will appear in the editor screen.


Insert the new line DEVICE=C:\DOS\EMM386.EXE 1024 RAM It must be placed below the line DEVICE=C:\DOS\HIMEM.SYS. See the example config.sys file below.


CONFIG.SYS

DEVICE=C:\DOS\HIMEM.SYS

BUFFERS=30

FILES=40


DOS=UMB

LASTDRIVE=E

DOS=HIGH

COUNTRY=044,,C:\DOS\COUNTRY.SYS



DEVICE=a:\DOS\EMM386.EXE 1024 RAM

DEVICE = C:\DOS\SETVER.EXE

DEVICE = C:\DOS\DISPLAY.SYS CON=(EGA,,1)

DEVICE = C:\DOS\ANSI.SYS

DEVICE = C:\DOS\MOUSE.SYS


Figure 16 A typical Config.sys file
Save the new config.sys file by typing:
alt f then a
then in the filename box that appears, type:

a: Config.sys then press enter.
Exit the editor by typing :
alt f then x
STEP 4: Now reboot the PC from the A: drive:
To do this, leave your disk in the A: drive, and press the RESET button, or hold down the Ctrl and Alt keys and then press Del.
STEP 5: To see your new memory configuration run the DOS MEM command. To do this type:
mem then press enter.
The DOS mem command lists the current memory configuration.
The new 2048KB EMS memory area that you have just created, will be displayed in a similar fashion to that shown in figure 18.


Memory Type Total = Used + Free

---------------- ------- ------- -------

Conventional 640K 23K 617K

Upper 187K 81K 106K

Reserved 384K 384K 0K

Extended (XMS) 2,885K 217K 2,668K

---------------- ------- ------- ---------

Total memory 4,096K 704K 3,392K
Total under 1 MB 827K 103K 724K
Largest executable program size 617K (632,176 bytes)

Largest free upper memory block 106K

MS-DOS is resident in the high memory area


Figure 17 Memory before EMS is installed.


Memory Type Total = Used + Free

---------------- ------- ------- -------

Conventional 640K 41K 599K

Upper 91K 74K 17K

Reserved 384K 384K 0K

Extended (XMS)* 2,981K 485K 2,496K

---------------- ------- ------- -------

Total memory 4,096K 984K 3,112K
Total under 1 MB 731K 115K 616K
Total Expanded (EMS) 1,408K (1,441,792 bytes)

Free Expanded (EMS)* 1,024K (1,048,576 bytes)


* EMM386 is using XMS memory to simulate EMS memory as needed.

Free EMS memory may change as free XMS memory changes.


Largest executable program size 599K (613,184 bytes)

Largest free upper memory block 17K

MS-DOS is resident in the high memory area.


Figure 18 Memory after 1024k of EMS is installed.

EXTENDED MEMORY used on DOS and WIN3.1 based systems.
Many DOS based, applications and GUI programs like Windows need memory in excess of the normal 640k DOS limit. The old LIM 4.0 expanded memory system did not do justice to the powerful CPUs emerging on the market. Coupled to this was the burgeoning demand for more potent applications. What was needed was a more modern memory management system that could utilise the huge memory addressing capability of the then new 386 and 486 CPUs.

To go some way to meeting this requirement, Microsoft added drivers and memory management utilities to MS-DOS­­-5, and onwards, to support Extended Memory. This is memory above the 1MB 8086/8088 addressing capability, so it is unsuitable for PC XTs. Unfortunately the old DOS 640KB limit still applied to conventional DOS application programs but new programs can be specially written to utilise the vast extended memory area.


Microsoft's extended memory manager is known as HIMEM.
In a PC system with a 386SX or greater processor and MS-DOS 5.0 to 6.22 installed, the available memory is divided into areas known as Conventional Memory, Upper memory, High Memory and Extended Memory. This is shown if figure 3.1. 48.


Maximum amount of

memory actually installed




Extended Memory (XMS)







High Memory Area (HMA)

1MB


Upper memory area (384k)




640k


Conventional Memory (640k)




0k

Figure 19 Basic memory map of a PC with MS-DOS 5 or greater installed.


Instead of storing device drivers in conventional memory, as they were in older versions of DOS, they can be stored in Upper Memory thus freeing up more of the 640KB conventional memory for DOS applications. Unused portions of upper memory are known as UMBs (Upper Memory Blocks).
By including the DOS devicehigh command before a device driver statement in config.sys, MS-DOS will attempt to fit the device driver into a spare UMB rather than use up valuable conventional memory space.
The High Memory Area (HMA) is the first 64k of extended memory. Part of DOS can be made to run from this area by incorporating the DOS=HIGH statement in config.sys thereby freeing up space in conventional ram.
Extended Memory (XMS) is ram above 1MB including HMA. Applications that use this area require extended-memory manager software such as HIMEM provided with DOS 5.0 and DOS 6.x.
Expanded Memory applications on a 386SX or higher machine can be supported in DOS or Windows by invoking the EMM386 expanded memory driver supplied with DOS 5.0 and DOS 6.x.


DEVICE=C:\DOS\HIMEM.SYS

DEVICE=C:\DOS\EMM386.EXE NOEMS

BUFFERS=30 _

FILES=40 _

DOS=UMB _

LASTDRIVE=E _

FCBS=16,8 _

DEVICEHIGH /L:1,12048 =C:\DOS\SETVER.EXE _

DOS=HIGH _

COUNTRY=044,,C:\DOS\COUNTRY.SYS _

DEVICEHIGH /L:1,15792 =C:\DOS\DISPLAY.SYS CON=(EGA,,1) _

DEVICEHIGH /L:1,9072 =C:\DOS\ANSI.SYS _

DEVICEHIGH /L:1,9456 =C:\WINDOWS\PP\SCANDEV.SYS _

DEVICEHIGH /L:1,2640 =C:\WINDOWS\PUBPB\HPSCANER.SYS

Figure 20 A typical CONFIG.SYS file for a 80486 based PC running Windows 3.1.


1   2   3   4   5   6   7   8


Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©atelim.com 2016
rəhbərliyinə müraciət