ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º º º Inboard 386/PC Software Design Considerations º º º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ SOFTWARE DESIGN CONSIDERATIONS This document describes the Intel Inboard 386/PC and its associated software. Code excerpts are included to serve as a guideline for software developers. THE BOARD AND THE ENVIRONMENT The Inboard 386/PC is a single slot 80386-based add-on card for the IBM PC, IBM XT, and compatibles. Benchmarks show the Inboard 386/PC boosts performance to approximately 10 times that of an IBM XT. Inboard 386/PC is unique because it provides the user with AT capabilities (extended memory and the ability to run protected mode software) in a PC environment. CHECKING THE MACHINE TYPE CODE Some applications software, such as extended memory RAMdisks, allow or disallow functions depending on the machine type code stored in ROM. They may assume that extended memory isn't supported on a particular computer because that computer's type code indicates PC or XT. Inboard 386/PC is not a system board replacement so it doesn't alter the machine type code. Although the INBRDPC.SYS driver provides BIOS INT 15h extended memory functions, it does not supply the second Programmable Interrupt Controller (PIC), additional DMA channels, or any of the other peripheral chips which differentiate the AT from the PC. The computer should be considered a modified PC. If your software requires an 80386-based machine, or if it requires extended memory, we suggest that the software first determine whether the machine is 80386-based (see "80386 detection"), and if so, whether it contains the Inboard 386/PC (see "Inboard 386/PC detection"). 80386 DETECTION The following code fragment can be used to distinguish an 80386 from an 80286 or 8086. This routine uses Intel-approved code that reads the high nibble of the flag word in the REAL MODE of the various processors. The Most Significant Bit (bit 15) is always a one on the 8086 and 8088 and a zero on the 286 and 386. Bit 14 (NT flag) and bits 13/12 (IOPL bit field) are always zero on the 286, but can be set on the 386. To ensure future compatibility of this test, we strongly recommended using this instruction sequence. However, you can modify the exit codes can to fit a particular need. check_processor_type PROC NEAR PUSH AX ;Save AX PUSHF ;Save flags XOR AX,AX ;Clear AX PUSH AX POPF ;Try to put zero into the flags PUSHF POP AX ;What really went into flags? TEST AX,08000h ;Was high bit set ? JZ Is386 ;NO -- this might be a 386 JMP IsNot386_exit ;YES -- abort with carry set Is386: MOV AX,07000h ;Try to set the NT/IOPL bits PUSH AX POPF ;...in the flags PUSHF POP AX ;Look at actual flags TEST AX,07000h ;Are any high bits set ? JZ IsNot386_exit ;NO -- abort with carry set Is386_cleanup: POPF ;Restore flags CLC ;Return status = 80386 JMP SHORT I386_exit IsNot386_exit: POPF ;Restore flags STC ;Return status <> 80386 I386_exit: POP AX ;Recover AX RET ;RETurn with carry clear if 80386 check_processor_type ENDP INBOARD 386/PC DETECTION Once the software has determined the computer is 80386-based, one of several methods can determine whether it contains an Inboard 386/PC. The first two methods assume the INBRDPC.SYS device driver has been installed in a DOS environment. 1. If INT 15h function 88h (return extended memory size) returns a non-zero AX, and the machine type claims PC or XT, then the machine contains an Inboard 386/PC. 2. Alternatively, if INT 15h function 89h returns CARRY set, and functions 87h and 88h return without error, then an Inboard 386/PC is present. 3. Finally, the software might set the Inboard to its slowest speed (see "Speed setting"), time a software loop, set the Inboard to its fastest speed, and then time the same loop. If the timings are dramatically different, then the machine must contain an Inboard 386/PC. SPEED SETTING The Inboard's speed is controlled via a byte output to a WRITE-ONLY speed port. The byte value, which is an even number from 0 to 30, specifies the number of wait states to be inserted by the Inboard. The highest performance is at zero wait states. To change the Inboard speed: MOV AL, Speed ;Speed is an even value 0 to 1EH Bit 0=0 AND AL, 00011110B ;Mask value for safety MOV DX, 670H ;Get Inboard speed port OUT DX, AL ;Set speed EXTENDED MEMORY The Inboard 386/PC baseboard contains 1 megabyte of 32 bit RAM: 640k completely replaces the motherboard conventional memory and 256k is extended memory. A portion of the remaining 128k is used to run the system ROM BIOS from 32 bit RAM (ROM "shadow"). Optional piggyback memory modules provide an additional 1, 2, or 4 megabytes of 32 bit extended memory. INBRDPC.SYS will diagnose all extended memory, and if it has detected memory errors, will display baseboard and piggyback board diagrams highlighting faulty chips in reverse video. The INT 15h extended memory functions 87h (move block) and 88h (return extended memory size) are installed with INBRDPC.SYS. Function 89h (enter protected mode) is not supplied because the AT version assumes the presence of a second PIC, which is not present on a PC. However, functions 87h and 88h are all that is necessary for a well-behaved application to access extended memory. Indeed, on the 80386, the real- to-protected mode switching is accomplished in markedly less time than on the AT because it is not necessary to reset the processor when re- entering real mode. GATING/DEGATING A20 The Inboard 386/PC gates and degates the A20 address line using a subset of the AT A20 handshake. To enable A20: MOV AL,0DFh ;Get A20 enable value MOV DX,060h ;Get address of A20 ctrl port OUT DX,AL ;Gate A20 on To disable A20: MOV AL,0DDh ;Get A20 disable value MOV DX,060h ;Get address of A20 ctrl port OUT DX,AL ;Gate A20 off EXPANDED MEMORY EMULATION (LIMULATION) Expanded memory emulators use extended memory to emulate expanded memory. If users have an EMS board, they cannot use the expanded memory manager for the EMS board while the emulator is loaded. Users must be given the option, if at all possible, of using either true EMS hardware or expanded memory emulation. LOADALL EMULATION An 80286 LOADALL emulator is supplied with INBRDPC.SYS for those ill- behaved applications that use LOADALL to access extended memory. The LOADALL emulator simply translates the 286 LOADALL register image into a 386 LOADALL register image and then issues an 80386 LOADALL instruction. SYSTEM BIOS IN 32-BIT RAM INBRDPC.SYS automatically copies the system ROM BIOS into an unused portion of 32 bit RAM. This results in significantly faster BIOS code execution (a read from the normal PC ROM BIOS range, 0F0000h - 0FFFFF, will actually read from the copy of the BIOS in 32 bit RAM). This feature can be disabled via an INBRDPC.SYS command line parameter, but it is not recommended because this feature is also used for system ROM BIOS patching. EGA BIOS IN 32 BIT RAM The user may optionally cause INBRDPC.SYS to copy the EGA BIOS into 32- bit conventional memory RAM. This results in significantly faster EGA BIOS code execution. Depending on the size of the EGA BIOS, the resulting buffer would consume 16 - 32k of conventional memory. WARM BOOTS AND PATCHING THE BIOS INBRDPC.SYS uses the "system BIOS in 32-bit RAM" feature to "patch" the BIOS at one location. This patch is used to capture all warm-boot sequences, whether via the CTRL-ALT-DEL keypress or direct FAR jumps to the reset code. The capture is necessary so that the following can be accomplished before the reset code executes: 1. The NT bit in the FLAGS register must be reset. 2. The A20 address line must be degated. 3. The Inboard 386/PC must be set to its fastest speed. 4. The system ROM BIOS must be run from ROM instead of 32 bit RAM. SLOWING DOWN FOR THE FLOPPY When the system ROM BIOS is run from 32-bit RAM, certain timing- sensitive operations are affected by the much faster code execution, in particular the diskette BIOS code. As a result, the Inboard 386/PC must be slowed (using the speed port) before the floppy diskette code is executed, and speeded up after the floppy diskette code is finished. This is accomplished by INBRDPC.SYS via an INT 13h front-end, which inserts the default or user-specified number of wait states prior to invoking the real INT 13h routine. INBRDPC.SYS INBRDPC.SYS is a DOS device driver which: þ Implements the BIOS INT 15h functions, þ Provides the hot-keys which allow for dynamic speed changing, þ Initializes the Inboard, diagnoses extended memory, þ Copies the system BIOS, and þ Enables the ROM shadow feature. ISPEEDPC.EXE ISPEEDPC allows you to alter the Inboard speed from a batch file. ISPEEDPC.EXE reads and writes the Inboard speed via IOCTL function calls to INBRDPC.SYS. ISTATPC.EXE ISTATPC displays the state of the INBRDPC.SYS variables and displays context-sensitive help information about each variable. ISTATPC.EXE obtains the state variable information via IOCTL function calls to INBRDPC.SYS. KEYBRDPC.EXE KEYBRDPC will reinstall the INBRDPC.SYS hot-key monitoring facility. Some applications software, notably IBM's foreign language keyboard drivers, do not properly chain onto existing interrupt vectors, but instead blindly overwrite them without saving the address of the original owner. KEYBRDPC.EXE uses IOCTL function calls to instruct INBRDPC.SYS to re-install the keyboard monitoring facility. ILIM386.SYS ILIM386.SYS allows the user to convert extended memory on Inboard 386/PC to expanded memory. By default it converts all extended memory to expanded except that which ILIM386 needs for itself. ILIM386.SYS allocates extended memory from the top of memory down. It also uses INT15 function 88h to return a new memory size. If the computer had 2048K of extended memory and the user requests 1024K expanded, the INT15 function 88H will return a size of 1024K for extended memory. Extended memory will always start at the usual 1024K address. ILIM386.COM ILIM386.COM displays the memory configuration of your Inboard 386/PC after ILIM386.SYS has been installed. It is a passive program in that it only reports the current memory configuration but cannot change it. ICACHE.COM ICACHE creates a disk cache in extended memory. The size can be from 32K to 1024K. ICACHE adjusts the extended memory size through the use of INT15. Thus, if you had 2048K of extended memory and specified a disk cache size of 1024K, INT15 function 88H would return a size of 1024K. CHKCOP.EXE CHKCOP checks to see if an 8087, 80287 or 80387 coprocessor is installed and working properly. End of Inboard 386/PC Scoop ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ End of file Intel FaxBack # 2516 June 25,1992