Microsoft KB Archive/63284

= MS-DOS LAN Manager Redirector in High Memory Area =

Article ID: 63284

Article Last Modified on 9/30/2003

-

APPLIES TO


 * Microsoft LAN Manager 1.0
 * Microsoft LAN Manager 2.0 Standard Edition
 * Microsoft LAN Manager 2.1 Standard Edition
 * Microsoft LAN Manager 2.1a
 * Microsoft LAN Manager 2.2 Standard Edition

-



This article was previously published under Q63284



SUMMARY
This article describes the following topics involving the high memory area (HMA) and MS-DOS LAN Manager:


 * The memory mappings from power-on until the point when the redirector is loaded into the HMA by HIMEM.SYS.
 * How the usage of the HMA can be maximized in an attempt to free conventional memory for other applications.
 * The inclusion in a future release of the MS-DOS LAN Manager redirector of a way to determine the amount of memory the redirector occupies in the HMA.



MORE INFORMATION
The following information covers the 80286/80386 platforms as all microprocessors start up in real mode and jump to a &quot;hard-wired&quot; address in higher memory.

When the power is turned on, the microprocessor by default begins execution with the CS:IP register set to FFFF:0000H. This location typically has a jump address in the ROM BIOS that contains the initialization code for the machine. For example:   -- <--FFFF:000FH |                                   | <--FFFF:0000H |                                   |   -- <--F000:000H (Physical address:FFFF0H) The address of FFFF:000F translates to a physical address of FFFFFH, which is actually 1 MB. This implies that the 20 (A0-A19) lines of the address bus have been enabled. Please note that all interrupts are disabled when the microprocessor starts execution. Therefore, it is up to the initialization routine to set up the interrupt vectors at the base of the memory.

We then go through the initialization process and reach a point where the SYSINIT routine in MSDOS.SYS reads the CONFIG.SYS file.

At this point, the HIMEM driver goes through an initialization process where it checks for a variety of things such as pre-existing XMS drivers, extended memory, etc. On passing that test successfully, the HIMEM driver loads itself into lower memory and then proceeds to set up the vector routines.

The MS-DOS LAN Manager redirector has two code segments, the lower and the upper. The upper code segment is addressed using a far pointer scheme, whether or not HIMEM is loaded. When the redirector loads, it checks whether the HIMEM parameter has been commented, enabled, or disabled. It checks whether the HIMEM driver has been loaded by loading the AX register with 4300H and calling interrupt 2FH, which sets the AL register to 80H if HIMEM is loaded.

The MS-DOS LAN Manager redirector then makes a request for the high memory area from HIMEM. This is achieved by loading the AH and DX registers with 01H and FFFFH respectively, and calling interrupt 2FH. This routine also checks whether or not some other program has turned the A20 memory address line on, and helps register the redirector with HIMEM. This gives the redirector the capability to use the routines provided by HIMEM.

It is the application's responsibility to toggle the A20 line to gain access to the HMA. HIMEM provides a function to do this called Global Enable A20. After the redirector has enabled the A20 line, it has access to the HMA from memory location FFFF:0010 (1024K) to FFFF:FFFFH (1088K).

The redirector then calls another function called Move Extended Memory Block, and moves its upper code segment into the HMA. For the lower code segment to access the upper, it must load the code segment with FFFFH and the IP register with 0010H.

NOTE: Toggling the A20 line is controlled by hardware. HIMEM implements this function by providing a routine to control the hardware. As with any MS-DOS application, you can implement your own routine to enable and disable A20, as there is no protection to stop any application from doing so.

Currently, the only way to use the HMA (bypassing HIMEM) after having loaded the redirector is to do the following:


 * 1) Obtain a memory size map of the redirector in the HMA.
 * 2) Offset your IP register by memory size by using segment FFFFH. The current method to obtain the size of the redirector in memory is to either use tools such as ARENA or MEM /DEBUG or use ROM BIOS functions. If you use ARENA, you will get a map for segment FFFF:0000H, and the segment will be marked as active. Because it is the redirector that is using that part of memory, you can calculate the offset required. In the case of MEM /DEBUG, you are required to know the size of the executable from which you are supposed to subtract the value obtained for the lower code segment.

A future release of MS-DOS LAN Manager should contain a function that will determine the size of the redirector in the HMA.

Additional query words: prodlm 1.00 2.00 2.10 2.10a 2.20

Keywords: KB63284

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.