American Megatrends, Inc.

CSM

Copyright

CSM32 Release Notes

CSM16 Release Notes

Frequently Asked Questions

Base Memory Layout

OEM Interrupts and Functions Implementation

© American Megatrends, Inc.


Release Notes - NDA Required

Component Information:
Component Title: Compatibility Support Module
Component Reference Name: CSM
Component Type: eModule
Release Date: 2014-08-22
Source Control Label: 4.6.5.3_CSM.7.76_81
Source Control Location: SS: ALASKA;$/Alaska/Source/Modules/CSM/Generic;

Dependencies
N0NE
Non-Compiled BIN and LIB File(s) within this Component:

Amilegacy16.bin
Component Title: CSM16 Binary
Component Reference Name: CSM16
Project Source Control Label: 8.00.10.00.0x.76
Project Source Control Location: SS: ALASKA;$/Alaska/SOURCE/Modules/CSM/Generic/CSM16
Component Description:
This component, termed as "CSM" is a collection of sub-components assembled together to make an EFI project capable of:
  • launching Legacy Option ROMs
  • performing Legacy Boot
  • executing 16-bit code and 16-bit interrupt handlers
Filename | Description
CSM | Root\Board\em\CSM
csm.cif | CSM component information
csm.sdl | CSM parameters
csm.chm | This file
CSM Core | Root\Core\em\CSM - LegacyBios and LegacyBiosPlatrform protocols implementation
csmcore.cif | CSM Core component information
csm.dxs | LegacyBios and LegacyBiosPlatform protocols dependency expressions
csm.mak | CSM make file
csm.h | Local CSM definitions header file
csm.c | CSM initialization, protocols installation, callbacks registration code
csmoprom.c | Legacy Option ROM handling routines
biosdata.h | BDA (BIOS Data Area) structure definition
csmhwinfo.c | Hardware information routines
pciinterrupts.c | PCI routing functions
pciinfo.asm | The purpose of this file is to include PCI bus translation table generated by AMISDL
oempir.dat | Data file that contains "$PIR" header followed by the PCI routing table generated by AMISDL
csmbsp.c | LegacyBiosPlatform protocol implementation functions
csmlib.c | Various internal CSM functions implementation
csmsimplein.c | CSM SimpleTextIn protocol implementation
CSM Thunk | Root\Core\em\CSM\Thunk
thunk.cif | CSM Thunk Component Information file, contains several thunk drivers references listed below
x86 Thunk | Root\Core\em\CSM\Thunk\x86 - 16-bit code execution routines
x86thunk.cif | x86 thunk component information
thunk.c | Implementation of FarCall86 and Int86 functions of LegacyBios protocol
x86thunk.asm | CPU mode switching routines
x86thunk.mak | Rules to make FFS binary out of x86thunk.asm
INT13 (BiosBlockIo) | Root\Core\em\CSM\Thunk\BlockIo - INT13 thunk driver
Int13Thunk.cif | BiosBlockIo driver component information
CsmInt13.c | BiosBlockIo I/O operations implementation through BIOS INT13 functions
CsmBlkIoComponentName.c | ComponentName protocol implementation of the BiosBlockIo driver
CsmBlockIo.c | BiosBlockIo entry point and binding protocol function implementation: Supported/Start/Stop
CsmBlockIo.h | Definitions
CsmBlockIo.sdl | Driver parameters
CsmEdd.h | EDD related definitions
biosblkio.mak | Driver building make file
biosblockio.dxs | BiosBlockIo driver depenencies
SNP16 | Root\Core\em\CSM\Thunk\SNP16
snp16.cif | Network Thunk Driver component information file (currently empty)
CsmVideo | Root\Core\em\CSM\Thunk\CsmVideo - INT10 thunk driver
CsmVideo.cif | CSM Thunk video driver component information
CsmVideo.sdl | CSM Thunk video driver configuration
CsmVideo.mak | CSM Thunk video driver make file
UefiBiosVideo.h | Definitions
UefiBiosVideo.c | Driver entry point and binding protocol functions (Supported/Start/Stop)
ComponentName.c | Driver name protocol implementation
VesaBiosExtensions.h | VESA definitions
pci22.h | PCI definitions
AmiMapping.h | Mapping of some of the Tiano definitions onto AMI framework
AmiMapping.c | Mapping of some of the Tiano functions onto AMI framework
VgaMiniPort.h | VGA Mini port binding definitions
VgaClass.h | Generic VGA driver definitions
VgaClass.c | Generic VGA driver implementation
CSM16 OEM hooks | Root\Board\em\CSM - OEM 16-bit functions support
csmoem.cif | Component information
MBIOSMAC.MAC | Macros used for OEM functions definition
MBIOSEQU.EQU | Equates of the available OEM 16-bit function IDs
csmoem.sdl | OEM functions support master token, parent eLinks definition
oem16sig.asm | Data file that populates "$OEM$FUN" signature in the OEM data area
CSM16 binaries | Root\Addon
csm16.cif | Component information
Amilegacy16.bin | CSM16 binary
Pxebase.lom | PXE base code binary
LegacyInterrupt | Root\Chipset\SB\CSM\LegacyInterrupt
LegacyInterrupt.cif | LegacyInterrupt component information
LegacyInterrupt.sdl | LegacyInterrupt driver parameters
LegacyInterrupt.mak | LegacyInterrupt driver make file
LegacyInterrupt.c | LegacyInterrupt driver implementation
LegacyInterrupt.dxs | LegacyInterrupt driver depenencies
CSM Protocols | Root\Include\Protocol
CsmProtocols.cif | Component information
LegacyInterrupt.h | LegacyInterrupt protocol definitions
LegacyBiosPlatform.h | LegacyBiosPlatform protocol definitions
CsmPlatform.h | CsmPlatform protocol definitions
LegacyBiosExt.h | LegacyBiosExt (AMI extension of LegacyBios) protocol definitions
CsmVideoPolicy.h | CsmVideoPolicy protocol definitions
CSM Setup | Root\Board\em\CSM
csmsetup.cif | Component information
csm.uni | CSM setup strings definition
csm.sd | CSM setup data definitions
csmsetup.c | CSM setup functions
AMI Build Tools:
Tools Label: 4.5.5_TOOLS_40, Dated: 2012-03-07
Visual eBios: RSS.5.72.0219, Dated: 2011-12-20
Compiler Tool(s):
- Microsoft® Windows Driver Kit (WDK) Ver. 7600.16385.1
- Microsoft® Macro Assembler Version 6.15.8803
- Microsoft® Segmented Executable Linker Version 5.60.339 Dec 5 1994
New features added in this label:
  • CSM16 ver 7.76
  • Support for Legacy2Efi module
EIP addressed in this label:
  • csm.c, legacybiosext.h, amilegacy16.bin
    • EIP132753 - Support for Legacy2Efi module
  • csm.c
    • EIP121303 - UEFI Win7 hibernation wake up may fail (amount of BS memory is limited by MS)
    • EIP117874 - Modified AllConnectedCallback function event is based on TPL_NOTIFY
    • EIP120105 - Incorrect 'CSM16LocationAttribute' passed to CopyLegacyTable()
    • EIP165911 - CPU cache attributes need adjustment for the CSM shadow area
  • csmbsp.c
    • EIP169426 - CSM build error when disabling X64_SUPPORT
  • csmhwinfo.c
    • EIP158722 - PMM high memory life cycle: modified free memory block search algorithm
    • EIP125967 - Multiple IDE controllers in the HDD boot string
  • Csm.sd, Csm.uni, CsmBsp.c, PciInterrupts.c
    • EIP171280 - Clean CSM setup settings
  • csmoprom.c
    • EIP125092 - Support for PCI ROM 2.1+3.0
    • EIP111209 - ISA boot devices controlled by the Option ROM are added to the boot list
    • EIP141162 - InstallPciRom has the code that updates the list of executed ROMs; usage of this list has been corrected
  • CsmLib.c
    • EIP123915 - BBS table update in CSM should be atomic operation (extra reentrance guards added)
    • EIP118727 - Onboard PCI Option ROM loading is moved outside CSM
  • uefibiosvideo.c
    • EIP119388 - CppCheck error correction (uninitialized variable in UefiBiosVideo)
    • EIP161124 - BiosVideoGraphicsOutputVgaBlt does not allocate buffers
    • EIP164727 - Added CSM_VGA_64BITBAR_WORKAROUND token
    • EIP137393 - EDID_PROTOCOL_OVERRIDE support
    • EIP144132 - Extended the VGA controller identification
  • CsmInt13.c, CsmBlockIo.c
    • EIP125560 - Support Boot Sector Virus Protection for CSM Disabled Mode
    • EIP165014 - Start function might incorrectly initialize IBV fields in BBS table
  • rt32.c
    • EIP130418 - Correction in RT32 entry point calculation
Known issues and limitations in this label:
None
Remaining Issues:
None
Validation Testing:
Available upon request
Release History:
Earlier versions' release notes are available here.

© American Megatrends Inc.


CSM Release Notes

AMI CSM16 Component Release Notes

Component Information

Component Name | CSM16
Component Type | Legacy16 binary
Release Date | June 9th, 2014
Source Control Label | 8.00.10.00.0x.76
Source Control Location (BIN) | Alaska:/SOURCE/Modules/CSM/Generic/CSM16
Source Control Location (SRC) | SS: ALASKA; $/Alaska/CSM16/Complete Project/Furball10.64K, SS: CORE8_ATL
Component Description
This component, termed as "CSM16" or "EfiCompatibility16", is a runtime part of a traditional legacy BIOS.
Source downloading notes
  • As CSM16 source is based on Core8, portion of it is downloaded from CORE8_ATL database. For full source downloading be sure to have access to both Alaska and Core8 source databases.
  • While downloading the CSM16 source, VeB will show the following two warning messages:
    Warning #1

    Warning #2

  • Warning1: This happens on any Core8 project that includes Core source includes as a module part; it is CIF/VEB specific limitation
  • Warning2: This happens when one file belongs to two different modules. In CSM16 source files BFIUSB.ASM and BFIUSB.EQU belong to two different modules. This was needed to be able either to include USB INT13 with the main CSM16 binary, or to create a separate binary. Current Aptio4 code uses a separate binary, however several Aptio3 projects use it as part of CSM16 binary. So for now we have to keep it in two different parts at the same time (and have only one copy on the SS).
Revision History

Version 76, June 9, 2014
  • bfiinit.asm, rt-pci.asm
    • EIP168105: RT PCI function find_device should skip the buses that do not exist

    Version 75, April 21, 2014
    • Module update
      • AHCI - AHCI.12_CSM16.57_12
      • SREDIR - SREDIR_CSM53.36
      • TCPA - TCPA_CSM16.55_11
      • USB - CSM16_USB_03
    • bfi.asm
      • EIP155425: PCI BIOS 16-bit Protected Mode throws Exception
    • int19.asm
      • EIP160863: Remove nnecessary writes to write-protected area
      • EIP164547: Modify INT19 MBR validation code, remove checking for Protective MBR (0EEh) in the partition table

    Version 74, January 10, 2014
    • Note: version 73 release has been skipped due to CSM16 release synchronization between Aptio 4 and Aptio V
    • bfi.asm, int19.asm
      • EIP149769: LegacyToEfi boot feature made optional, added point-of-no-return functionality

    Version 72, August 14, 2013
    • bfi.asm, bbsc.asm, int19.asm, mbiosequ.equ
      • EIP132753: Legacy2Efi module support

    Version 71, December 14, 2012
    • bfiinit.asm, bfiport.asm
      • EIP102771: added API to restore USB hard drive connection order; currently used by FWBOOT module

    • bfi.asm
      • EIP93796: during legacy boot "cls" command does not always clear the screen
      • EIP92261: during legacy boot the indicator of 101/102 keyboard must be set in 40:96

    • bbs.equ
      • EIP105453: the value of IPLPT_MAX_COUNT is increased to 40

    • int19.asm
      • EIP102765: MBR validation needs to be improved: RHEL disk utility might initialize LBA0 with DWORD pattern 33 CC 55 AA
      • EIP106090: CPU flat mode lost inside INT19 boot loop

    • patches.sdl
      • EIP94481: CSM16 Furball build fails

    Version 70, June 27, 2012
    • EIP86718 :: bfi.asm
      • Removed CSM16 code attempts to write to read-only region (F000)

    • EIP86521 :: bfiport.asm
      • CSM16 memory manager improvement: changed the algorithm in AllocateMemoryInE000OrF000 function

    Version 69, December 23, 2011
    • EIP74972 :: int19.asm
      • Modified the range of MBR validation; checking for zeroes is done from offset 0 to 1B7

    • EIP74971 :: bfi.equ, bfibbs.asm, bfiata.asm, bfiisr.asm, core.mak, core.sdl, coredef.mak, cf.asm, disr.asm, hd.asm, i13c.asm, int13.asm, int13isr.asm, jmp.asm, bbs.equ, nt13pnp.equ, tiano16.mak
      • Support for 6 IDE Controllers

    • EIP77222 :: hdapi.inc
      • Fixed function 48h returns wrong number of sectors if HDD supports 48-bit LBA but the size is smaller than 8GB. The size read might be changed by the SET MAX command. When its size < 8.4GB the num_sectors becomes invalid and it should not be used for 48-bit LBA HDDs.

    • EIP76821 :: bfiinit.asm, pmm.asm, pmm.equ
      • Added permanent PMM allocation support for <1MB regions

    • EIP75928 :: cdatapi.inc
      • Clearing 40:8E added to clear_interrupt routines

    • EIP73969 :: nruntime.asm
      • Added checking for FF when reading BusMaster port in ide_irq_isr_extra function

    Version 68, October 11, 2011
    • EIP69156 :: bfiisr.asm
      • INT1A, function B10E destroys interrupt flag (cli)

    • EIP70905 :: bfiisr.asm
      • INT15, function D042 error exit path corrected to preserve all CPU flags except CF

    • EIP70382 :: bfibbs.asm
      • during IPLDT preparations look in the AdditionalInt field, create BEV device if these fields are non-zero

    Version 67, August 16, 2011
    • EIP64251 :: bfibbs.asm
      • Added a call to switch to big real mode after Option ROM execution

    • EIP66440
      • When boot is attempted from boot override or pop-up menu and the boot device is not the first in the list within a group, then boot fails.
        Root cause: device map (e.g. HdMap) does not match IPLDT: if the device is second within a group, it will be the first in IPLDT
        Solution: modified MardDevicesToSkip routine to properly initialize device map

    • EIP62792 :: int74.asm
      • Disable keyboard during INT74 processing

    • EIP61746 :: int19.asm
      • MBR sector may contain non-0 data at 1B0..1BF. Changed the boot validation code accordingly

    Version 66, June 16, 2011
    • EIP55913 :: bfiport.asm, bfi.asm
      • LastOpromAddress location restored so that it follows "$EFI" structure. This resolves compatibility issues

    • EIP62017 :: bfiport.asm
      • Removed setting NMI enable information, it is done outside CSM16

    • bfi.asm
      • Correction in Boot_FAR, set video mode parameters corrected

    • bfibbs.asm
      • Modified HandleNonBBSOptionROM_FAR to support non-PnP ROMs that trap INT18/INT19

    Version 64, October 20, 2010
    • EIP39688 :: int17.asm
      • Pressing Ctrl+P from DOS causes hang in DOS] in Los Lunas EV ( Desktop )

    • pmm.asm
      • Added checking for permanent memory allocation request

    • EIP39228, EIP40121 :: biosdata.asm, ms.asm
      • Added a code to avoid mouse data transfers when legacy mouse driver is not active

    • EIP38426, EIP40588 :: csp.asm, bfi.asm
      • Warmboot related changes

    • EIP42178 :: rt-pci30.inc
      • Bugfix in pci30_read_cfg_x

    • bfi.asm
      • Added stack_ptr_reverse_thunk variable

    • bfiport.asm
      • Skip installing INT74 for legacy free systems

    • EIP44759 :: bfiisr.asm
      • INT15_E820 function modification: removed checking for a "buffer too big" condition

    • EIP41547 :: bfiusb.asm
      • USB INT13 errors out on zero sector size

    • bfiinit.asm
      • Added the reporting of the location of stack_ptr_reverse_thunk variable in InitializeYourself call
      • Extended LEGACY16_TO_EFI_DATA_TABLE_STRUC structure

    Earlier versions' release notes are available here.

    • © American Megatrends Inc.


AMI CSM Frequently Asked Questions

Q: Do we need CSM to boot to EFI OS?
A: We might. CSM is needed if there are Legacy Option ROMs controlling the hardware, for example for Video or SCSI controllers. CSM can be removed if the system is "purely" EFI system and every piece of hardware is controlled by EFI driver.
Q: Which legacy runtime functions are not supported by CSM16?
A: CSM16 does not support several PnP functions:
  • BBS runtime PnP function
  • ESCD PnP function
  • Set PCI IRQ call - int 1A func B10F
    • Q: What is the runtime size of CSM?
    A: Currently CSM occupies ~60K of F000 segment.
    Q: How can the driver allocate "legacy" memory?
    A: For allocations in E000/F000 segments use GetLegacyRegion function, for EBDA allocation use AllocateEbda function.
    Q: Can driver allocate shadow memory in C0000..DFFFF?
    A: No, CSM does not provide such interface. This area is used for Option ROMs, the only build parameter that OEM can change is OPROM_MAX_ADDRESS.
    Q: Does E000/F000 areas have to be unlocked during CSM16 calls
    A: Yes. Use LegacyRegion.Unlock function to do so. The only exception is LegacyBoot function (#3); when it is called, E000/F000 is locked.
    Q: Any CSM porting required for legacy free projects?
    A: No. CSM is using CORE token KBC_SUPPORT to support legacy free (token set to 0) projects.
    Q: Are there any CSM files need to be private?
    A: No. CSM is designed to be generic. Porting hooks are the eLinks that can be implemented in teh OEM modules.
    Q: How can OEM code manage the execution of the Option ROM?
    A: There are several ways of controlling whether or not the Option ROM execution is to be skipped. One way is to implement CsmPlatform_PreProcessOpRom/CsmPlatform_PostProcessOpRom functions. Another way is to install a callback notification on the installation of OpromStartEndProtocolGuid. This will ensure the control comes to the OEM code before Option ROM execution. The pre-defined interface allows to reject the Option ROM execution.
    See OEMDXE.C for details.

    © American Megatrends Inc.


OEM Interrupts and Functions Implementation

CSM currently supports OEM interrupt handlers as well as OEM 16-bit functions. As development continues, 32-bit functions support will be added. This document will be updated accordingly to describe the porting steps for the custom 32-bit functions. The idea is to let OEM customers to bring their 16-bit code along with their 32-bit modules without having them rebuild the main CSM16 binary. For this CSM uses one of the standard SDL output formats - OUTPOST. The output file will contain a function tables with OEM interrupt handlers and 16-bit code routines. Here are the details of generic part of OEM interrupt and OEM 16-bit function implementation.
"CSM16 OEM Hooks" is a module part of a generic CSM module and does not require modifications.
CSMOEM.SDL file has the eLink definitions that would allow bringing the custom interrupt handlers and OEM routines from different modules.
CSMOEM.MAK is the make file that has rules for building the OEM binary. This binary is loaded during CSM initialization in the CSM entry point.
MBIOSMAC.MAC and MBIOSEQU.EQU are needed to build the OUTPOST file generated by SDL.
Notes:
    All custom interrupt handlers and custom 16-bit functions will be located inside the modules whose function they implement, not inside CSM module. CSM only provides the mechanism of linking these OEM pieces together and initializing them so that they become available to CSM16 binary. For example, CPU microcode update INT15 functions implementation should be placed inside CPU module. Similarly, custom HW reset function should be a part of North Bridge module.

It is very important to use the pre-defined segments name in ALL custom routines, that is CSMOEM_CSEG for OEM interrupt handlers and OEM16_CSEG for OEM 16-bit routines. Any other segment name would not give a build error, but cause a problem for linker for calculating proper offsets.

OEM Interrupt handler implementation

The following example of OEM interrupt demonstrates the implementation of custom INT15 handler. Let us take this example and clarify what are the steps to take for the OEM interrupt handler implementation.
OEMINT.SDL - this file provides the necessary eLinks to make the interrupt handler available to CSM module
OEMINT.ASM - this is the interrupt handler source file
OEMINT.MAK - make file to build the handler source

Parameters defined in OEMINT.SDL

OEM_INTERRUPT_SAMPLE- module master flag that turns it on or off
SAMPLE_DIR - module directory, will be used in .MAK file
The following eLink describes the routine implemented in OEMINT.ASM file:

ELINK
Name = "OemIntSample01"
Parent = "CsmOemInterrupts"
ProcID = 015h
SrcFile = "Board\em\Csm\oemint.asm"
InvokeOrder = AfterParent
End

There are three custom fields in this eLink: ProcID that represents the interrupt to be implemented (INT15 in this sample), Name has the exact name of the interrupt handler routine, and SrcFile is the file name of the interrupt handler source.
The following eLink indicates the .OBJ file that is the compiled interrupt handler:

ELINK
Name = "$(BUILD_DIR)\oemint.obj"
Parent = "CSM_OEMINT_OBJS"
InvokeOrder = AfterParent
End

These eLinks are visually represented in VeB kernel table list as follows:
The children of CsmOemInterrupts are the names of the custom interrupt routines. In this example there are two different INT15 handlers implemented in different modules: OemNBSpecialInt and OemIntSample01.

The children of CSM_OEMINT_OBJS are the OBJ files used by CSM to link them together into OEM binary file. Because of that there can not be two different interrupt handlers that use the same file name, every file name has to be unique.

Note that in case OEM interrupt handler supplied as .OBJ file initially, the correct path to this file shall be used. Sample implementation is using source file which is assembled to $(BUILD_DIR)\oemint.obj

OEM Interrupt Handler source file

OEMINT.ASM is an example of the OEM interrupt handler implementation. The file name may be changed as long as it is properly indicated in .MAK file. Below is the listing of the file; the parts that can be modified are highlighted blue, parts that must not be changed are red.
TITLE OEMINT.ASM -- OEM INTERRUPT IMPLEMENTATION EXAMPLE
    ****************************************************************************
    ;***************************************************************************
    ;**                                                                       **
    ;**            (C)Copyright 1985-2010, American Megatrends, Inc.          **
    ;**                                                                       **
    ;**                          All Rights Reserved.                         **
    ;**                                                                       **
    ;**          5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093            **
    ;**                                                                       **
    ;**                        Phone (770)-246-8600                           **
    ;**                                                                       **
    ;***************************************************************************
    ;***************************************************************************
    ;****************************************************************************

CSMOEM_CSEG SEGMENT PARA PUBLIC 'CODE' USE16
    ASSUME cs: CSMOEM_CSEG, ds: CSMOEM_CSEG
OldIntHandler LABEL DWORD
    IntOfsSav dw 0
    IntSegSav dw 0
    ;---------------------------------------------------------------------------
    ;
    ; Name: OemIntSample
    ;
    ; Description: OEM Interrupt function implementation example. In this example
    ; int 15 function FF return AA55 in AX with CF=0.
    ;
    ;---------------------------------------------------------------------------
OemIntSample01 PROC NEAR PUBLIC
        cmp	ah, 0FFh
        je thats_us
        jmp DWORD PTR cs:[OldIntHandler]
thats_us:
        mov ax, 0AA55h
        clc
        retf 2
OemIntSample01 ENDP
CSMOEM_CSEG ENDS
END
Note:
  • Multiple custom interrupt handler files can not be in different files that have the same name, e.g. there can be only one OEMINT.OBJ in the project; otherwise the linker will generate an error.

OEM 16-bit function implementation

Similarly to custom interrupt handlers, OEM can develop 16-bit routines that will be invoked from CSM16 binary. Every routine has its ID; CSM16 handles the list of the "installed" custom 16-bit routines using ID. Certainly the functionality of the custom code and the point of invocation is defined by ID. Here is the list of IDs that is currently implemented:
    CSM16_OEM_HW_RESET              EQU   01h ; Before executing cold reset
    CSM16_OEM_NMI                   EQU   02h ; Before executing a default NMI (INT02) handler
    CSM16_OEM_SMBIOS_PNP            EQU   03h ; SMBIOS PnP functions
    CSM16_OEM_AFTER_SWSMI           EQU   04h ; After software SMI execution
    CSM16_OEM_BEFORE_SWSMI          EQU   05h ; Before software SMI execution
    CSM16_OEM_ON_BOOT_FAIL          EQU   06h ; After all boot options exhaust, before displaying error message
    CSM16_OEM_AHCI_ACCESSHBA        EQU   07h ; AHCI access to HBA, used in AHCI INT13 handler
    CSM16_OEM_BEFORE_CALL_BOOT_VECTOR EQU 08h ; After boot record is copied into 7C00, before giving it control
    CSM16_OEM_PROBE_KBC             EQU   09h ; Before default routing accessing KBC port to see its presence
    CSM16_OEM_VIRUS_WARNING         EQU   0Ah ; Before displaying a default virus warning upon write to LBA0
    CSM16_OEM_SERIAL_ACCESS         EQU   0Bh ; Before serial port access, used in legacy serial redirection
    CSM16_OEM_BEFORE_CALL_INT19     EQU   0Ch ; Before executing INT19
    CSM16_OEM_TRY_NEXT_BOOT         EQU   0Eh ; After unsuccessful boot
This list will grow as we identify the OEM routines to be called from CSM16 binary. eLinks for 16-bit custom functions are very similar to OEM Interrupt eLinks; use them as a reference.

Oem16Sample01 is the 16-bit function sample implementation. Similarly to OEM Interrupts, OEM function does not have to be a part of CSM module, it should be implemented in the module with which it is attached logically and functionally.

OEM 16-bit function source file

The parts of the file can be modified are highlighted blue, parts that must not be changed are red.

    TITLE	OEM16.ASM -- 16 bit CSM OEM FUNCTIONS IMPLEMENTATION EXAMPLE

;****************************************************************************
    ;***************************************************************************
    ;**                                                                       **
    ;**            (C)Copyright 1985-2010, American Megatrends, Inc.          **
    ;**                                                                       **
    ;**                          All Rights Reserved.                         **
    ;**                                                                       **
    ;**          5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093            **
    ;**                                                                       **
    ;**                        Phone (770)-246-8600                           **
    ;**                                                                       **
    ;***************************************************************************
    ;***************************************************************************
    ;****************************************************************************

OEM16_CSEG SEGMENT PARA PUBLIC 'CODE' USE16
    ASSUME cs:OEM16_CSEG, ds:OEM16_CSEG

;---------------------------------------------------------------------------
;
; Name:		Oem16Sample01
;
; Description:	OEM function implementation example. The rules and restrictions
;				to consider while writing a funciton:
;				1) function has to be in OEM16_CSEG
;				2) function has to return with far return RETF
;				3) no input/output can be passed using registers
;
; Input:		AX - function ID
;				DS:SI points to structure {DW func_id, DW func_offset}
;
; Output:		None
;
; Modified:		Any 32 bit register as well as DS, ES, FS, GS can be modified;
;				all of them will be restored by the CSM16 API wrapper.
;
;---------------------------------------------------------------------------

Oem16Sample01 PROC NEAR PUBLIC
    db	9ah, 35h, 0eeh, 00h, 0f0h	; call far f000:ee35 - single_beep
    retf
db 'OEM16 Sample'
Oem16Sample01 ENDP

OEM16_CSEG ENDS

END

;****************************************************************************
;****************************************************************************
;**                                                                        **
;**         (C)Copyright 1985-2006, American Megatrends, Inc.              **
;**                                                                        **
;**                          All Rights Reserved.                          **
;**                                                                        **
;**                 6145-F Northbelt Pkwy, Norcross, GA 30071              **
;**                                                                        **
;**                          Phone (770)-246-8600                          **
;**                                                                        **
;****************************************************************************
;****************************************************************************
;****************************************************************************

© American Megatrends Inc.


AMI CSM Base Memory Layout

© American Megatrends Inc.


Function by File Name

AMIBIOS Function Reference

By File Name

The following is a list of the source files.
For a list in alphabetical order, see In Alphabetical Order.
For a list by segment, see By Segment.

  • AmiMapping.c
  • AmiMapping.h
  • CSM.c
  • CSM.dxs
  • CSM.h
  • CSM.mak
  • csm.sd
  • CsmBlkIoComponentName.c
  • CsmBlockIo.c
  • CsmBlockIo.h
  • CsmBsp.c
  • CsmEdd.h
  • CsmHwInfo.c
  • CsmInt13.c
  • CsmLib.c
  • csmoem.mak
  • CsmOpROM.c
  • CsmPlatform.h
  • csmsetup.c
  • CsmSimpleIn.c
  • CsmVideo.mak
  • CsmVideoPolicy.h
  • LegacyBios.h
  • LegacyBiosExt.h
  • LegacyBiosPlatform.h
  • LegacyInterrupt.c
  • LegacyInterrupt.dxs
  • LegacyInterrupt.h
  • LegacyInterrupt.mak
  • MBIOSEQU.EQU
  • MBIOSMAC.MAC
  • OemPir.dat
  • PciInfo.asm
  • PciInterrupts.c
  • thunk.c
  • x86thunk.asm
  • x86thunk.mak
Built on 16:20:52 08/05/14


AmiMapping.c

Description:
Mapping from EDK to AMI definitions


AmiMapping.h

Description:
Mapping from EDK to AMI definitions


CSM.c

Description:
Compatibility Support Module entry point and interface functions.

The following functions are used in the file: CSM.c.

Function | Description
AllConnectedCallback | This function is executed after all drivers have been connected.
ClearFreeMemory | This function goes through system memory map and clears memory that is not allocated within the given range.
CopyLegacyRegion | This function is called when copying data to the region assigned by EFI_LEGACY_BIOS_PROTOCOL.GetLegacyRegion().
CopyLegacyTable | This fuction allocates CSM16 memory within E0000..FFFFF and then copies the passed data into allocated region.
CsmEntryPoint | CSM driver entry point
EnablePciDevices | This function enables all PCI devices before legacy boot
FindCompatibility16Table | This function identifies the validity of CSM16 binary by searching "$EFI" and verifying table checksum and returs the location of $EFI table
Get16BitFuncAddress | LegacyBiosExt API, returns the entry point of 16-bit function which was added using "CsmOem16Functions" eLink
GetBbsInfo | Presents BBS information to external agents.
GetEmbeddedRom | This function calls FindEmbeddedRom to search for onboard Option ROM.
GetLegacyRegion | This function is called when EFI needs to reserve an area in the 0xE0000 or 0xF0000 64 KB blocks.
HaltApsBeforeBoot | This call is halting APs before giving control to Legacy OS.
InitCompatibility16 | This function reads Compatibility16 binary into the pre-defined shadow memory region, executes InitializeYourself function and initializes Thunk data structures.
InitializeCsm16MiscInfo | This function initialize AMI specific CSM16 data: POST/RT variables in CSM16 based on Setup settings, OEM porting overridesIt will be skipped in case of non-AMI CSM16 binary.
InitializeLegacyMemory | This function initializes CSM related memory regions
InitializeOem16 | Initialize OEM interrupts and update CSM16 OEM int pointer
InitializeOemInt | Initialize OEM interrupts and update CSM16 OEM int pointer
InitializePortingHooks | Initialize the data areas for Chipset/OEM 16 bit and 32 bit routines and interrupt handlers.
LegacyBoot | Boots a traditional OS
PrepareToBoot | This function is called when booting an EFI-aware OS with legacy hard disks. The legacy hard disks may or may not be the boot device but will be accessed by the EFI-aware OS.
UpdateKeyboardLedStatus | Updates the BDA to reflect status of the Scroll Lock, Num Lock, and Caps Lock keys and LEDs.
UpdatePciLastBus | In a multiple root-complex platform, the CSM16 routine "rth_pci_get_last_bus" needs to return the correct bus number. For example, in a 2 IOH system, the base bus #s for IOH0 can be 0 and IOH1 can be 80h. It should not be assumned there is only one root-complex and return the correct bus # (max bus of first IOH), for the card is plugged into the 2nd IOH. This function creates a callback notification event for EfiPciRootBridgeProtocol GUID installation. The callback function then will process the list of root bridges and will update the LastPciBus field of EFI_COMPATIBILITY16_TABLE accordingly.


AllConnectedCallback in the CSM.c

Function : AllConnectedCallback

File: CSM.c
Description:
This function is executed after all drivers have been connected.
Notes:
Specific to Core version, first time this event is signaled in 4.6.3.1.


ClearFreeMemory in the CSM.c

Function : ClearFreeMemory

File: CSM.c
Description:
This function goes through system memory map and clears memory that is not
allocated within the given range.
Input:
Start and End addresses
Output:
EFI_STATUS the status of memory clearing operation


CopyLegacyRegion in the CSM.c

Function : CopyLegacyRegion

File: CSM.c
Description:
This function is called when copying data to the region assigned by
EFI_LEGACY_BIOS_PROTOCOL.GetLegacyRegion().
Input:
This                Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
LegacyMemorySize    Size in bytes of the memory to copy.
LegacyMemoryAddress The location within the region returned by
       EFI_LEGACY_BIOS_PROTOCOL.GetLegacyRegion().
LegacyMemorySourceAddress       Source of the data to copy.
Output:
EFI_SUCCESS         The data was copied successfully.
EFI_ACCESS_DENIED   Either the starting or ending address is out of bounds.


CopyLegacyTable in the CSM.c

Function : CopyLegacyTable

File: CSM.c
Description:
This fuction allocates CSM16 memory within E0000..FFFFF and then copies the
passed data into allocated region.
Input:
Data to be copied, data size and CSM16 and memory location attribute
(F0000_BIT or E0000_BIT or both)
Notes:
CSM16 memory must be open for writing.


CsmEntryPoint in the CSM.c

Function : CsmEntryPoint

File: CSM.c
Description:
CSM driver entry point


EnablePciDevices in the CSM.c

Function : EnablePciDevices

File: CSM.c
Description:
This function enables all PCI devices before legacy boot


FindCompatibility16Table in the CSM.c

Function : FindCompatibility16Table

File: CSM.c
Description:
This function identifies the validity of CSM16 binary by searching "$EFI"
and verifying table checksum and returs the location of $EFI table
Input:
RomImageStart    Binary location address
RomImageSize     Size in bytes
Output:
Address of the beginning of $EFI table or NULL if this table is not found
Notes:
Compatibility16 binary is linked with the current section


Get16BitFuncAddress in the CSM.c

Function : Get16BitFuncAddress

File: CSM.c
Description:
LegacyBiosExt API, returns the entry point of 16-bit function which was
added using "CsmOem16Functions" eLink
Input:
id          function ID
Output:
EFI_SUCCESS if found, Addr is updated with 32-bit pointer to the function
EFI_NOT_FOUND if function with the requested ID is not found


GetBbsInfo in the CSM.c

Function : GetBbsInfo

File: CSM.c
Description:
Presents BBS information to external agents.
Input:
This        Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
HddCount    Number of HDD_INFO structures.
HddInfo     Onboard IDE controller information.
BbsCount    Number of BBS_TABLE structures.
BbsTable    BBS entry.


GetEmbeddedRom in the CSM.c

Function : GetEmbeddedRom

File: CSM.c
Description:
This function calls FindEmbeddedRom to search for onboard Option ROM.
Output:
EFI_SUCCESS or EFI_NOT_FOUND
Referrals:
FindEmbeddedRom


GetLegacyRegion in the CSM.c

Function : GetLegacyRegion

File: CSM.c
Description:
This function is called when EFI needs to reserve an area in the 0xE0000
or 0xF0000 64 KB blocks.
Input:
This                Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
LegacyMemorySize    Requested size in bytes of the region.
Region              Requested region.
           00 = Either 0xE0000 or 0xF0000 blocks.
           Bit0 = 1 Specify 0xF0000 block
           Bit1 = 1 Specify 0xE0000 block
Alignment           Bit-mapped value specifying the address alignment
       of the requested region. The first nonzero value
       from the right is alignment.
LegacyMemoryAddress Address assigned.
Output:
EFI_SUCCESS The requested region was assigned.
EFI_ACCESS_DENIED   The function was previously invoked.
Other   The requested region was not assigned.


InitCompatibility16 in the CSM.c

Function : InitCompatibility16

File: CSM.c
Description:
This function reads Compatibility16 binary into the pre-defined shadow
memory region, executes InitializeYourself function and initializes Thunk
data structures.
Input:
BIOS_INFO           *CoreBiosInfo
EFI_SYSTEM_TABLE    *SystemTable
Output:
EFI_SUCCESS = Success
Notes:
InitializeLegacyMemory has to be executed prior to this function


InitializeLegacyMemory in the CSM.c

Function : InitializeLegacyMemory

File: CSM.c
Description:
This function initializes CSM related memory regions
Input:
BIOS_INFO *CoreBiosInfo
Output:
EFI_STATUS  Legacy memory initialization status
Referrals:
BIOS_INFO


InitializeOem16 in the CSM.c

Function : InitializeOem16

File: CSM.c
Description:
Initialize OEM interrupts and update CSM16 OEM int pointer
Input:
Csm16TableStart     The address of the beginning of OEM table
Csm16Address        The address of the beginning of OEM16 data/code
Csm16InitSegPtr     The address of the field with OEM16 pointer
       that is passed to CSM16.
Output:
Pointer to the next type of OEM code/data


InitializeOemInt in the CSM.c

Function : InitializeOemInt

File: CSM.c
Description:
Initialize OEM interrupts and update CSM16 OEM int pointer
Input:
Csm16TableStart     The address of the beginning of OEM table
Csm16Address        The address of the beginning of OEM interrupt table handler(s)
Csm16InitSegPtr     The address of the field with OEM interrupt pointer that is
       passed to CSM16.
Output:
Pointer to the next type of OEM code/data


InitializePortingHooks in the CSM.c

Function : InitializePortingHooks

File: CSM.c
Description:
Initialize the data areas for Chipset/OEM 16 bit and 32 bit routines and
interrupt handlers.
Input:
BIOS_INFO *CoreBiosInfo
Output:
EFI_STATUS Success of failure of the operation.
Notes:
At the point of calling CSM16 is loaded, no CSM16 function is executed.
E0000..FFFFF area is unlocked.
Referrals:
BIOS_INFO


LegacyBoot in the CSM.c

Function : LegacyBoot

File: CSM.c
Description:
Boots a traditional OS
Input:
This            Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
BootOption      The EFI device path from BootXXXX variable.
LoadOptionSize  Size of LoadOption.
LoadOption      The load option from BootXXXX variable.
Output:
EFI_DEVICE_ERROR    Failed to boot from any legacy boot device
Notes:
This function normally never returns. It will either boot the OS or
reset the system if memory has been "corrupted" by loading a boot sector
and passing control to it.


PrepareToBoot in the CSM.c

Function : PrepareToBoot

File: CSM.c
Description:
This function is called when booting an EFI-aware OS with legacy hard disks.
The legacy hard disks may or may not be the boot device but will be accessed
by the EFI-aware OS.
Input:
This        Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
BbsCount    Number of BBS_TABLE structures.
BbsTable    BBS entry.
Output:
Status of the boot preparation.


UpdateKeyboardLedStatus in the CSM.c

Function : UpdateKeyboardLedStatus

File: CSM.c
Description:
Updates the BDA to reflect status of the Scroll Lock, Num Lock, and Caps
Lock keys and LEDs.
Input:
This    Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
Leds    Current LED status, as follows:
       Bit 0 - Scroll Lock
       Bit 1 - Num Lock
       Bit 2 - Caps Lock
Output:
EFI_SUCCESS The BDA was updated successfully.


CSM.dxs

Description:
AMI CSM dependency file.


CSM.h

Description:
AMI CSM header file.

The following functions are used in the file: CSM.h.

Function | Description
Compatibility16Boot | Causes the Compatibility16 BIOS to boot. The Compatibility16 code is Read/Only.
Compatibility16DispatchOprom | Allows the Compatibility16 code rehook INT13, INT18, and/or INT19 after dispatching a legacy OpROM.
Compatibility16GetTableAddress | Finds a free area in the 0xFxxxx or 0xExxxx region of the specified length and returns the address of that region.
Compatibility16InitializeYourself | Causes the Compatibility16 code to do any internal initialization required. The EFI_TO_COMPATIBILITY16_INIT_TABLE pointer is passed into this function.
Compatibility16InstallPciHandler | Enables the EfiCompatibility module to install an interrupt handler for PCI mass media devices that do not have an OpROM associated with them. An example is SATA
Compatibility16PrepareToBoot | Allows the Compatibility16 code to perform any final actions before booting. The Compatibility16 code is read/write.
Compatibility16RetrieveLastBootDevice | Allows the Compatibility16 code to get the last device from which a boot was attempted. This is stored in CMOS and is the priority number of the last attempted boot device.
Compatibility16SetKeyboardLeds | Enables the EfiCompatibility module to do any nonstandard processing of keyboard LEDs or state.
Compatibility16UpdateBbs | Causes the Compatibility16 BIOS to perform any drive number translations to match the boot sequence.

The following data structures are used in the file: CSM.h.

Variable | Description
AMIIRQ_HEADER | AMI IRQ Routing Table Header Structure
BIOS_INFO | This structure is not specified in CSM specification. It defines the useful fields for the global variable to be used throughout POST.
DEVICE_PRODUCER_DATA_HEADER |
DEVICE_PRODUCER_FLOPPY |
DEVICE_PRODUCER_PARALLEL |
DEVICE_PRODUCER_SERIAL |
EFI_ADDON_PCIBUS_TABLE | Table that holds the information about the buses generated by P2P bridges that are not listed in $PIR table
EFI_DISPATCH_OPROM_TABLE |
EFI_LEGACY_INSTALL_PCI_HANDLER |
EFI_TO_COMPATIBILITY16_BOOT_TABLE | Data structure passed to Compatibility16InitializeYourself function.
EFI_TO_COMPATIBILITY16_INIT_TABLE | Data structure passed to Compatibility16InitializeYourself function.
LEGACY_DEVICE_FLAGS |
SMM_ATTRIBUTES |
SMM_ENTRY |
SMM_FUNCTION |
SMM_TABLE | SMM Table definitions; SMM table has a header that provides the number of entries. Following the header is a variable length amount of data.


AMIIRQ_HEADER in the CSM.h

Variable : AMIIRQ_HEADER

File: CSM.h
Description:
AMI IRQ Routing Table Header Structure


BIOS_INFO in the CSM.h

Variable : BIOS_INFO

File: CSM.h
Fields:

Name | Type | Description
iBios | EFI_LEGACY_BIOS_PROTOCOL | LegacyBios instance pointer
iRegion | EFI_LEGACY_REGION_PROTOCOL | LegacyRegion instance pointer
iBiosPlatform | EFI_LEGACY_BIOS_PLATFORM_PROTOCOL | LegacyPlatform instance pointer
iInterrupt | EFI_LEGACY_INTERRUPT_PROTOCOL | LegacyInterrupt instance pointer
i8259 | EFI_LEGACY_8259_PROTOCOL | Legacy8259 instance pointer
hBios | EFI_HANDLE
hImage | EFI_HANDLE | This driver LoadedImage handle
hVga | EFI_HANDLE | Video controller handle
Csm16Header | EFI_COMPATIBILITY16_TABLE | Pointer to CSM16 header
Thunk | THUNK_MEMORY | Pointer to thunk memory area
Csm16EntrySeg | UINT16 | CSM16 entry point segment
Csm16EntryOfs | UINT16 | CSM16 entry point offset
BbsTable | BBS_TABLE | BBS table pointer
BbsEntriesNo | UINT8 | Number of BBS entries
HddCount | UINT8 | Number of hard disks in the system
E820Map | E820_ENTRY | E820 memory map entries
NumberE820Entries | UINT16 | Number of E820 entries populated

Description:
This structure is not specified in CSM specification. It defines the useful
fields for the global variable to be used throughout POST.


Compatibility16Boot in the CSM.h

Function : Compatibility16Boot

File: CSM.h
Description:
Causes the Compatibility16 BIOS to boot. The Compatibility16
code is Read/Only.
Input:
AX = Compatibility16Boot
Output:
Status Codes Returned
Referrals:
EFI_TO_COMPATIBILITY16_BOOT_TABLE, EFI_IA32_REGISTER_SET


Compatibility16DispatchOprom in the CSM.h

Function : Compatibility16DispatchOprom

File: CSM.h
Description:
Allows the Compatibility16 code rehook INT13, INT18, and/or
INT19 after dispatching a legacy OpROM.
Input:
AX = Compatibility16DispatchOprom
ES:BX = Pointer to EFI_DISPATCH_OPROM_TABLE
Output:
AX =  Returned status codes
BX = Number of non-BBS-compliant devices found. Equals 0 if
BBS compliant.
Referrals:
EFI_DISPATCH_OPROM_TABLE, EFI_IA32_REGISTER_SET


Compatibility16GetTableAddress in the CSM.h

Function : Compatibility16GetTableAddress

File: CSM.h
Description:
Finds a free area in the 0xFxxxx or 0xExxxx region of the
specified length and returns the address of that region.
Input:
AX = Compatibility16GetTableAddress
BX = Allocation region
   00 = Allocate from either 0xE0000 or 0xF0000 64 KB blocks.
   Bit 0 = 1 Allocate from 0xF0000 64 KB block
   Bit 1 = 1 Allocate from 0xE0000 64 KB block
CX = Requested length in bytes.
DX = Required address alignment. Bit mapped. First non-zero bit
from the right is the alignment.
Output:
AX = Returned status codes:
   EFI_SUCCESS 0x0000
   EFI_OUT_OF_RESOURCES    0x8009
DS:BX = Address of the region


Compatibility16InitializeYourself in the CSM.h

Function : Compatibility16InitializeYourself

File: CSM.h
Description:
Causes the Compatibility16 code to do any internal initialization
required.  The EFI_TO_COMPATIBILITY16_INIT_TABLE pointer is passed
into this function.
Input:
AX = Compatibility16InitializeYourself
ES:BX = Pointer to EFI_TO_COMPATIBILITY16_INIT_TABLE
Output:
Status Codes Returned
Referrals:
EFI_TO_COMPATIBILITY16_INIT_TABLE, EFI_IA32_REGISTER_SET


Compatibility16InstallPciHandler in the CSM.h

Function : Compatibility16InstallPciHandler

File: CSM.h
Description:
Enables the EfiCompatibility module to install an interrupt
handler for PCI mass media devices that do not have an OpROM
associated with them. An example is SATA
Input:
AX = Compatibility16InstallPciHandler
ES:BX = Pointer to EFI_LEGACY_INSTALL_PCI_HANDLER structure
Output:
Status Codes Returned
Referrals:
EFI_LEGACY_INSTALL_PCI_HANDLER


Compatibility16PrepareToBoot in the CSM.h

Function : Compatibility16PrepareToBoot

File: CSM.h
Description:
Allows the Compatibility16 code to perform any final actions
before booting.  The Compatibility16 code is read/write.
Input:
AX = Compatibility16PrepareToBoot
ES:BX = Pointer to EFI_TO_COMPATIBILITY16_BOOT_TABLE structure
Output:
Status Codes Returned
Referrals:
EFI_TO_COMPATIBILITY16_BOOT_TABLE, DEVICE_PRODUCER_DATA_HEADER
HDD_INFO, BBS_TABLE, BBS_STATUS_FLAGS, SMM_TABLE, UD_TABLE,
UDC_ATTRIBUTES, EFI_IA32_REGISTER_SET


Compatibility16RetrieveLastBootDevice in the CSM.h

Function : Compatibility16RetrieveLastBootDevice

File: CSM.h
Description:
Allows the Compatibility16 code to get the last device from
which a boot was attempted.  This is stored in CMOS and is
the priority number of the last attempted boot device.
Input:
AX = Compatibility16RetrieveLastBootDevice
Output:
AX = Returned status codes:
   EFI_SUCCESS 0x0000
   EFI_ABORTED 0x8015
BX = Priority number of the boot device
Referrals:
EFI_IA32_REGISTER_SET


Compatibility16SetKeyboardLeds in the CSM.h

Function : Compatibility16SetKeyboardLeds

File: CSM.h
Description:
Enables the EfiCompatibility module to do any nonstandard
processing of keyboard LEDs or state.
Input:
AX = Compatibility16SetKeyboardLeds
CL = LED status:
   Bit 0 - Scroll Lock         0 = Off
   Bit 1 - Num Lock
   Bit 2 - Caps Lock
Output:
Status Codes Returned


Compatibility16UpdateBbs in the CSM.h

Function : Compatibility16UpdateBbs

File: CSM.h
Description:
Causes the Compatibility16 BIOS to perform any drive number
translations to match the boot sequence.
Input:
AX = Compatibility16UpdateBbs
ES:BX = Pointer to EFI_TO_COMPATIBILITY16_BOOT_TABLE
Output:
Status Codes Returned
EFI_SUCCESS 0x0000
Referrals:
EFI_TO_COMPATIBILITY16_BOOT_TABLE, EFI_IA32_REGISTER_SET


DEVICE_PRODUCER_DATA_HEADER in the CSM.h

Variable : DEVICE_PRODUCER_DATA_HEADER

File: CSM.h
Fields:

Name | Type | Description
Serial | DEVICE_PRODUCER_SERIAL | Data for serial port x
Parallel | DEVICE_PRODUCER_PARALLEL | Data for parallel port x
Floppy | DEVICE_PRODUCER_FLOPPY | Data for floppy
MousePresent | UINT8 | Flag to indicate if mouse is present
Flags | LEGACY_DEVICE_FLAGS | Miscellaneous Boolean state information passed to CSM

Referrals:
DEVICE_PRODUCER_SERIAL, DEVICE_PRODUCER_PARALLEL,
DEVICE_PRODUCER_FLOPPY, LEGACY_DEVICE_FLAGS


DEVICE_PRODUCER_FLOPPY in the CSM.h

Variable : DEVICE_PRODUCER_FLOPPY

File: CSM.h
Fields:

Name | Type | Description
Address | UINT16 | I/O address assigned to the floppy
Irq | UINT8 | IRQ assigned to the floppy.
Dma | UINT8 | DMA assigned to the floppy.
NumberOfFloppy | UINT8 | Number of floppies in the system.


DEVICE_PRODUCER_PARALLEL in the CSM.h

Variable : DEVICE_PRODUCER_PARALLEL

File: CSM.h
Fields:

Name | Type | Description
Address | UINT16 | I/O address assigned to the parallel port
Irq | UINT8 | IRQ assigned to the parallel port.
Dma | UINT8 | DMA assigned to the parallel port.
Mode | PARALLEL_MODE | Mode of the parallel port.


DEVICE_PRODUCER_SERIAL in the CSM.h

Variable : DEVICE_PRODUCER_SERIAL

File: CSM.h
Fields:

Name | Type | Description
Address | UINT16 | I/O address assigned to the serial port
Irq | UINT8 | IRQ assigned to the serial port
Mode | SERIAL_MODE | Mode of serial port


EFI_ADDON_PCIBUS_TABLE in the CSM.h

Variable : EFI_ADDON_PCIBUS_TABLE

File: CSM.h
Description:
Table that holds the information about the buses generated by
P2P bridges that are not listed in $PIR table


EFI_DISPATCH_OPROM_TABLE in the CSM.h

Variable : EFI_DISPATCH_OPROM_TABLE

File: CSM.h
Fields:

Name | Type | Description
PnpInstallationCheckSegment | UINT16 | Segment of the PnpInstallationCheck data structure.
PnpInstallationCheckOffset | UINT16 | Offset of the PnpInstallationCheck data structure.
OpromSegment | UINT16 | The segment where the OpROM was placed. Offset is assumed to be 3.
PciBus | UINT8 | The PCI bus.
PciDeviceFunction | UINT8 | The PCI device * 0x08 | PCI function.
NumberBbsEntries | UINT8 | The number of valid BBS table entries upon entry and exit.
BbsTable | UINT32 | Pointer to the BBS table.


EFI_LEGACY_INSTALL_PCI_HANDLER in the CSM.h

Variable : EFI_LEGACY_INSTALL_PCI_HANDLER

File: CSM.h
Fields:

Name | Type | Description
PciBus | UINT8 | The PCI bus of the device.
PciDeviceFun | UINT8 | The PCI device in bits 7:3 and function in bits 2:0.
PciSegment | UINT8 | The PCI segment of the device.
PciClass | UINT8 | The PCI class code of the device.
PciSubclass | UINT8 | The PCI subclass code of the device.
PciInterface | UINT8 | The PCI interface code of the device.
PrimaryIrq | UINT8 | The primary device IRQ.
PrimaryReserved | UINT8 | Reserved.
PrimaryControl | UINT16 | The primary device control I/O base.
PrimaryBase | UINT16 | The primary device I/O base.
PrimaryBusMaster | UINT16 | The primary device bus master I/O base.
SecondaryIrq | UINT8 | The secondary device IRQ.
SecondaryReserved | UINT8 | Reserved.
SecondaryControl | UINT16 | The secondary device control I/O base.
SecondaryBase | UINT16 | The secondary device I/O base.
SecondaryBusMaster | UINT16 | The secondary device bus master I/O base.


EFI_TO_COMPATIBILITY16_BOOT_TABLE in the CSM.h

Variable : EFI_TO_COMPATIBILITY16_BOOT_TABLE

File: CSM.h
Fields:

Name | Type | Description
MajorVersion | UINT16 | The EfiCompatibility major version number.
MinorVersion | UINT16 | The EfiCompatibility minor version number.
AcpiTable | UINT32 | Location of the RSDT ACPI table.
SmbiosTable | UINT32 | Location of the SMBIOS table in EFI memory.
SmbiosTableLength | UINT32 | Length of the SMBIOS table in bytes.
SioData | DEVICE_PRODUCER_DATA_HEADER | Standard traditional device information.
DevicePathType | UINT16 | The default boot type. See notes for details.
PciIrqMask | UINT16 | Mask of which IRQs have been assigned to PCI.
NumberE820Entries | UINT32 | Number of E820 entries.
HddInfo | HDD_INFO | Hard disk drive information, including raw Identify Drive data.
NumberBbsEntries | UINT32 | Number of entries in the BBS table
BbsTable | UINT32 | Pointer to the BBS table.
SmmTable | UINT32 | Pointer to the SMM table.
OsMemoryAbove1Mb | UINT32 | The amount of usable memory above 1 MB, i.e. E820 type 1 memory.
UnconventionalDeviceTable | UINT32 | Information to boot off an unconventional device like a PARTIES partition.

Description:
Data structure passed to Compatibility16InitializeYourself
function.
Notes:
Following are the defined DevicePathType values:
FD = Floppy
HD = Hard Disk
CDROM = CD-ROM
PCMCIA = PCMCIA
USB = USB
NET = Networks
BEV = BBS BEV devices
Referrals:
Compatibility16InitializeYourself, EFI_TO_COMPATIBILITY16_INIT_TABLE, HDD_INFO


EFI_TO_COMPATIBILITY16_INIT_TABLE in the CSM.h

Variable : EFI_TO_COMPATIBILITY16_INIT_TABLE

File: CSM.h
Fields:

Name | Type | Description
BiosLessThan1MB | UINT32 | Starting address of memory under 1 MB.The ending address is assumed to be 640 KB or 0x9FFFF.
HiPmmMemory | UINT32 | Starting address of the high memory block
HiPmmMemorySizeInBytes | UINT32 | Length of high memory block
ReverseThunkCallSegment | UINT16 | The segment of the reverse thunk call code
ReverseThunkCallOffset | UINT16 | The offset of the reverse thunk call code
Number820Entries | UINT32 | The number of E820 entries copied to the Compatibility16 BIOS
OsMemoryAbove1Mb | UINT32 | The amount of usable memory above 1 MB, e.g., E820 type 1 memory
ThunkStart | UINT32 | The start of thunk code in main memory. Memory cannot be used by BIOS or PMM.
ThunkSizeInBytes | UINT32 | The size of the thunk code
LowPmmMemory | UINT32 | Starting address of memory below 1MB
LowPmmMemorySizeInBytes | UINT32 | Length of low Memory block

Description:
Data structure passed to Compatibility16InitializeYourself
function.
Notes:
- The address of the ReverseThunkCall code is provided in case
the Compatibility16 code needs to invoke a Compatibility16
function.  It is not used to return from this function or any
other traditional BIOS interface function.  These functions simply
do a far return.
- CSM16 must handle cases where PMM pointers are NULL. That indicates
that PMM is not supported for that range. If both pointers are NULL
then PMM is not supported. That covers cases where no add-in cards
are supported and/or memory given to EFI.
- CSM16 must initialize PMM regions to zero prior to usage by OpROMs.
CSM16 can not assume the CSM32 had zeroed out the regions.
- CSM16 must monitor for EBDA size increase after OpROM is initalized
and adjust PMM below 1MB, if required.
- BiosLessThan1MB field is maintained for compatibility with the
previous versions of the specification and the CSM16 should not use this
field. The CSM16 should use LowPmmMemory and LowPmmMemorySizeInBytes fields
for the low memory that can be used for PMM.
Referrals:
Compatibility16InitializeYourself


LEGACY_DEVICE_FLAGS in the CSM.h

Variable : LEGACY_DEVICE_FLAGS

File: CSM.h
Fields:

Name | Type | Description
A20Kybd | UINT32 | :1 A20 controller by keyboard controller.
A20Port92 | UINT32 | :1 A20 controlled by port 0x92.
Reserved | UINT32 | :30 Reserved for future usage.

Notes:
A20Kybd and A20Port92 are not mutually exclusive.


SMM_ATTRIBUTES in the CSM.h

Variable : SMM_ATTRIBUTES

File: CSM.h
Fields:

Name | Type | Description
Type | UINT16 | Access mechanism used to generate the soft SMI
PortGranularity | UINT16 | Size of "port" in bits
DataGranularity | UINT16 | Size of data in bits
Reserved | UINT16 | Reserved for future use


SMM_ENTRY in the CSM.h

Variable : SMM_ENTRY

File: CSM.h
Fields:

Name | Type | Description
SmmAttributes | SMM_ATTRIBUTES | Describes the access mechanism, SmmPort, and SmmData sizes
SmmFunction | SMM_FUNCTION | Function Soft SMI is to perform
SmmPort | UINT16 | SmmPort size depends upon SmmAttributes and ranges from 2 bytes to 16 bytes
SmmData | UINT16 | SmmData size depends upon SmmAttributes and ranges from 2 bytes to 16 bytes

Referrals:
SMM_ATTRIBUTES, SMM_FUNCTION


SMM_FUNCTION in the CSM.h

Variable : SMM_FUNCTION

File: CSM.h
Fields:

Name | Type | Description
Function | UINT16 | Function this Soft SMI is to initiate
Owner | UINT16 | The definer of the function


SMM_TABLE in the CSM.h

Variable : SMM_TABLE

File: CSM.h
Fields:

Name | Type | Description
NumSmmEntries | UINT16 | Number of entries represented by SmmEntry
SmmEntry | SMM_ENTRY | One entry per function

Description:
SMM Table definitions; SMM table has a header that provides
the number of entries. Following the header is a variable
length amount of data.
Referrals:
SMM_ENTRY


CSM.mak

Description:
Make file for the CSM component


csm.sd

Description:
CSM Setup data definitions, currently go under Boot page


CsmBlkIoComponentName.c

Description:
Set of functions that implement Component Name protocol
for the CSM BlockIO driver.


CsmBlockIo.c

Description:
CSM Block I/O Module. Main module, containing entry,
supported, start, and stop functions.

The following functions are used in the file: CsmBlockIo.c.

Function | Description
BuildDevicePath | Builds device path for this device
CsmBlockIoEntryPoint | This is the CsmBlockIo driver entry point. It installs gCsmBlockIoDriverBinding protocol
CsmBlockIoStart | Installs BlockIoProtocol using INT13 services produced by Option ROM
CsmBlockIoStop | Installs IdeControllerProtocol
CsmBlockIoSupported | This is a binding protocol function. It checks whether or not this driver supports the given controller


BuildDevicePath in the CsmBlockIo.c

Function : BuildDevicePath

File: CsmBlockIo.c
Description:
Builds device path for this device
Input:
IN  EFI_DEVICE_PATH_PROTOCOL  *BaseDevicePath,
IN  CSM_LEGACY_DRIVE          *Drive,
OUT EFI_DEVICE_PATH_PROTOCOL  **DevicePath
Notes:
Here is the control flow of this function:
1. Decrement user counter
2. Free global buffer
3. Release PCI I/O protocol and Block I/O protocol for each child handle.
4. Shut down the hardware for each child handle.


CsmBlockIoEntryPoint in the CsmBlockIo.c

Function : CsmBlockIoEntryPoint

File: CsmBlockIo.c
Description:
This is the CsmBlockIo driver entry point. It installs
gCsmBlockIoDriverBinding protocol


CsmBlockIoStart in the CsmBlockIo.c

Function : CsmBlockIoStart

File: CsmBlockIo.c
Description:
Installs BlockIoProtocol using INT13 services produced by Option ROM
Input:
IN EFI_DRIVER_BINDING_PROTOCOL    *This,
IN EFI_HANDLE                     Controller,
IN EFI_DEVICE_PATH_PROTOCOL       *RemainingDevicePath
Notes:
Here is the control flow of this function:
1. Open PCI and Devicepath protocol
2. Enable the device
3. Post the option rom
4. If first time, allocate buffer for real mode thunk code
5. For each disk...
a. Allocate and initialize a private structure
b. Install block I/O protocol on a new child device
c. Open the child device
6. Increment user counter


CsmBlockIoStop in the CsmBlockIo.c

Function : CsmBlockIoStop

File: CsmBlockIo.c
Description:
Installs IdeControllerProtocol
Input:
IN EFI_DRIVER_BINDING_PROTOCOL    *This,
IN EFI_HANDLE                     Controller,
IN EFI_DEVICE_PATH_PROTOCOL       *RemainingDevicePath
Notes:
Here is the control flow of this function:
1. Decrement user counter
2. Free global buffer
3. Release PCI I/O protocol and Block I/O protocol for each child handle.
4. Shut down the hardware for each child handle.


CsmBlockIoSupported in the CsmBlockIo.c

Function : CsmBlockIoSupported

File: CsmBlockIo.c
Description:
This is a binding protocol function. It checks whether or not this
driver supports the given controller
Input:
IN EFI_DRIVER_BINDING_PROTOCOL    *This,
IN EFI_HANDLE                     Controller,
IN EFI_DEVICE_PATH_PROTOCOL       *RemainingDevicePath


CsmBlockIo.h

Description:
CSM BlockIO driver header file.


CsmBsp.c

Description:
Compatibility Support Module - Board Support Package.
This driver implements LEGACY_BIOS_PLATFORM_PTOTOCOL interface functions.

The following functions are used in the file: CsmBsp.c.

Function | Description
BspPrepareToBoot | Prepares the attempt to boot a traditional OS.
BspUpdatePrt | This function is called from PciInterrupts.c when PCI Interrupt routing table is ready for copying to shadow memory. Do the final updates of the routing information.
CheckOemPciSiblings | This function checks whether a given PCI device can be controlled by one of the Option ROMs that have been already executed.
EnableOemPciSiblings | This function enables devices on PCI bus that can be controlled by the Option ROM associated with the given PCI device.
GetCustomPciIrqMask | This function is called from PciInterrupts.ProgramPciIrq() before programming PCI register 3C. This function is given the PciIo of the device and a list of possible IRQ choices for this device. The possible IRQs are given in a form of UINT16 IRQ mask, where 1 is a masked IRQ level. This function can modify this list and return EFI_SUCCESS. A caller then will AND the existing mask with the one returned by this function. Note that this way the existing list can only be shrunk, not extended.
GetGateA20Information | This function is called from LegacyBios entry point and it returns the board specific information related to the way of controlling GateA20. Two different aspects of GateA20 control can be returned by this function: 1) Line GA20 can be activated/deactivated through KBC's GPIO (command D1), or through Port92 (Bit2). 2) Deactivation of GA20 is be desirable at all, any CSM16 function related to deactivation will be skipped.
GetNmiInformation | This function is called from LegacyBios entry point and it returns the board specific information related to NMI.
GetOemIntData | Gets the OEM INT custom data
GetOpromVideoSwitchingMode | This function is called from LEGACY_BIOS.InstallPciRom() before and after OpROM execution. It allows OEM override the default video mode switching policy during OpROM execution.
GetPlatformEmbeddedRom | This function is called from FindEmbeddedRom and allows OEM to have a custom code that looks for a binary. By default all addon ROMs are packed as BINFILE section. This function may be needed if binary is packed in a way that is different from default (for example it can be FFS file, etc.).
GetPlatformHandle | Returns a buffer of handles for the requested subfunction.
GetPlatformInfo | Finds the binary data or other platform information. Refer to the subfunctions for additional information.
GetPlatformPciEmbeddedRom | This function is called from CheckPciRom and allows OEM to have a custom code that looks for a binary.
GetRoutingTable | Returns information associated with PCI IRQ routing.
InitCsmBoard | CSM BSP driver entry point, it will instantinate LEGACY_BIOS_PLATFORM_PTOTOCOL interface
PlatformHooks | Allows platform to perform any required action after a LegacyBios operation.
ShadowServiceRoms | Executes Option ROMs that are not associated with PCI device, e.g. PXE base code image.
SmmInit | Loads and registers the Compatibility16 handler with the EFI SMM code. In also updates EFI_TO_COMPATIBILITY16_BOOT_TABLE.SmmTable.
TranslatePirq | This function translates the given PIRQ back through all buses, if required, and returns the true PIRQ and associated IRQ.


BspPrepareToBoot in the CsmBsp.c

Function : BspPrepareToBoot

File: CsmBsp.c
Description:
Prepares the attempt to boot a traditional OS.
Input:
This            Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance.
BbsDevicePath   EFI Device Path from BootXXXX variable. Type
   BBS_BBS_DEVICE_PATH is defined in EFI_LEGACY_BIOS_PROTOCOL.LegacyBoot().
BbsTable        A list of BBS entries of type BBS_TABLE. Type BBS_TABLE is
   defined in Compatibility16PrepareToBoot().
LoadOptionsSize Size of LoadOption in bytes.
LoadOptions     LoadOption from BootXXXX variable.
EfiToLegacyBootTable    Pointer to EFI_TO_COMPATIBILITY16_BOOT_TABLE. Type
   EFI_TO_COMPATIBILITY16_BOOT_TABLE is defined
   in Compatibility16PrepareToBoot().
Output:
EFI_SUCCESS Ready to boot.


BspUpdatePrt in the CsmBsp.c

Function : BspUpdatePrt

File: CsmBsp.c
Description:
This function is called from PciInterrupts.c when PCI Interrupt
routing table is ready for copying to shadow memory. Do the final
updates of the routing information.
Input:
This            Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance.
RoutingTable    Pointer to the PCI IRQ routing table. This location is
   the $PIR table. The contents is defined by the PCI IRQ
   Routing Table Specification; it has the  number of
   RoutingTableEntries of EFI_LEGACY_IRQ_ROUTING_ENTRY.
Output:
EFI_SUCCESS Data was updated successfully.
Notes:
Checksum of the table is not required in this routine, it will
   be done after this call is executed.
Referrals:
EFI_LEGACY_BIOS_PLATFORM_PROTOCOL, EFI_LEGACY_IRQ_ROUTING_ENTRY,
EFI_LEGACY_PIRQ_TABLE_HEADER, EFI_LEGACY_IRQ_PRIORITY_TABLE_ENTRY


GetOemIntData in the CsmBsp.c

Function : GetOemIntData

File: CsmBsp.c
Description:
Gets the OEM INT custom data
Notes:
This function returns EFI_UNSUPPORTED as it is currently replaced
with OEM interrupts support.


GetPlatformHandle in the CsmBsp.c

Function : GetPlatformHandle

File: CsmBsp.c
Description:
Returns a buffer of handles for the requested subfunction.
Input:
This            Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance.
Mode            Specifies what handle to return.
       GetVgaHandle
       GetIdeHandle
       GetIsaBusHandle
       GetUsbHandle
Type            Handle Modifier - Mode specific
HandleBuffer    Pointer to buffer containing all Handles matching the
   specified criteria. Handles are sorted in priority order.
   Type EFI_HANDLE is defined in InstallProtocolInterface()
   in the EFI 1.10 Specification.
HandleCount     Number of handles in HandleBuffer.
AdditionalData  Pointer to additional data returned - mode specific..
Output:
EFI_SUCCESS The handle is valid.
EFI_UNSUPPORTED Mode is not supported on this platform.
EFI_NOT_FOUND   The handle is not known.


GetPlatformInfo in the CsmBsp.c

Function : GetPlatformInfo

File: CsmBsp.c
Description:
Finds the binary data or other platform information.
Refer to the subfunctions for additional information.
Input:
This    Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance.
Mode    Specifies what data to return:
 EfiGetPlatformBinaryMpTable
 EfiGetPlatformBinaryOemIntData
 EfiGetPlatformBinaryOem16Data
 EfiGetPlatformBinaryOem32Data
 EfiGetPlatformBinaryTpmBinary
 EfiGetPlatformBinarySystemRom
 EfiGetPlatformPciExpressBase
 EfiGetPlatformPmmSize
 EfiGetPlatformEndRomShadowAddr
 EfiGetPlatformOpromVideoMode
 EfiGetPlatformIntSaveRestoreTable
 EfiGetPlatformPciIrqMask
 EfiGetPlatformGateA20Information

Table       Pointer to OEM legacy 16-bit code or data.
TableSize   Size of data.
Location    Location to place table.
   Bit 0 = 1 0xF0000 64 KB block.
   Bit 1 = 1 0xE0000 64 KB block.
   Note: Multiple bits can be set.
Alignment   Bit-mapped address alignment granularity. The first
   nonzero bit from the right is the address granularity.
LegacySegment   Segment where EfiCompatibility code will place the
   table or data.
LegacyOffset    Offset where EfiCompatibility code will place the
   table or data.
Output:
EFI_SUCCESS     The data was returned successfully.
EFI_UNSUPPORTED Mode is not supported on this platform.
EFI_NOT_FOUND   Binary image not found.
Referrals:
EFI_GET_PLATFORM_INFO_MODE


GetRoutingTable in the CsmBsp.c

Function : GetRoutingTable

File: CsmBsp.c
Description:
Returns information associated with PCI IRQ routing.
Input:
This            Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance.
RoutingTable    Pointer to the PCI IRQ routing table. This location is
   the $PIR table minus the header. The contents is defined
   by the PCI IRQ Routing Table Specification; it has the
   number of RoutingTableEntries of EFI_LEGACY_IRQ_ROUTING_ENTRY.
RoutingTableEntries     Number of entries in the PCI IRQ routing table.
LocalPirqTable          $PIR table. It contains EFI_LEGACY_PIRQ_TABLE_HEADER,
           immediately followed by RoutingTable.
PirqTableSize           Size of $PIR table.
LocalIrqPriorityTable   A priority table of IRQs to assign to PCI. This table
           has IrqPriorityTableEntries entries of
           EFI_LEGACY_IRQ_PRIORITY_TABLE_ENTRY type and is used to
           prioritize the allocation of IRQs to PCI.
IrqPriorityTableEntries Number of entries in the priority table.
Output:
EFI_SUCCESS Data was returned successfully.
Referrals:
EFI_LEGACY_BIOS_PLATFORM_PROTOCOL, EFI_LEGACY_IRQ_ROUTING_ENTRY,
EFI_LEGACY_PIRQ_TABLE_HEADER, EFI_LEGACY_IRQ_PRIORITY_TABLE_ENTRY


InitCsmBoard in the CsmBsp.c

Function : InitCsmBoard

File: CsmBsp.c
Description:
CSM BSP driver entry point, it will instantinate
LEGACY_BIOS_PLATFORM_PTOTOCOL interface
Input:
Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT
Output:
The status of CSM board initalization


PlatformHooks in the CsmBsp.c

Function : PlatformHooks

File: CsmBsp.c
Description:
Allows platform to perform any required action after a LegacyBios
operation.
Input:
DeviceHandle    List of PCI devices in the system. Type EFI_HANDLE is defined in
   InstallProtocolInterface() in the EFI 1.10 Specification.
ShadowAddress   First free OpROM area, after other OpROMs have been dispatched..
Compatibility16Table    Pointer to the Compatibility16 Table.
AdditionalData          Pointer to additional data returned - mode specific..
Output:
EFI_SUCCESS     The operation performed successfully.
EFI_UNSUPPORTED Mode is not supported on this platform.
EFI_SUCCESS     Mode specific.


ShadowServiceRoms in the CsmBsp.c

Function : ShadowServiceRoms

File: CsmBsp.c
Description:
Executes Option ROMs that are not associated with PCI device,
e.g. PXE base code image.


SmmInit in the CsmBsp.c

Function : SmmInit

File: CsmBsp.c
Description:
Loads and registers the Compatibility16 handler with the EFI SMM code.
In also updates EFI_TO_COMPATIBILITY16_BOOT_TABLE.SmmTable.
Input:
This     Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance.
EfiToCompatibility16BootTable    The boot table passed to the Compatibility16.
Output:
EFI_SUCCESS         The SMM code loaded.
EFI_DEVICE_ERROR    The SMM code failed to load.


TranslatePirq in the CsmBsp.c

Function : TranslatePirq

File: CsmBsp.c
Description:
This function translates the given PIRQ back through all
buses, if required, and returns the true PIRQ and associated IRQ.
Input:
This        Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance.
PciBus      PCI bus number for this device.
PciDevice   PCI device number for this device.
PciFunction PCI function number for this device.
Pirq        The PIRQ. PIRQ A = 0, PIRQ B = 1, and so on.
PirqIrq     IRQ assigned to the indicated PIRQ.
Output:
EFI_SUCCESS The PIRQ was translated.


CsmEdd.h

Description:
EDD support definitions file

The following data structures are used in the file: CsmEdd.h.

Variable | Description
CSM_BLOCK_IO_DEV | CSM BlockIo device properies
CSM_LEGACY_DRIVE | Hard drive data structure
EDD_DEVICE_ADDRESS_PACKET | Device address packet used during EDD data transfers


CSM_BLOCK_IO_DEV in the CsmEdd.h

Variable : CSM_BLOCK_IO_DEV

File: CsmEdd.h
Fields:

Name | Type | Description
BlockIo | EFI_BLOCK_IO_PROTOCOL | BlockIo protocol instance
Handle | EFI_HANDLE | EFI device handle
ControllerHandle | EFI_HANDLE | EFI controller handle
BlockMedia | EFI_BLOCK_IO_MEDIA | BlockIo device media
DevicePath | EFI_DEVICE_PATH_PROTOCOL* | Device path
PciIo | EFI_PCI_IO_PROTOCOL* | Device PciIo
LegacyBios | EFI_LEGACY_BIOS_PROTOCOL* | Legacy Bios instance pointer
Drive | CSM_LEGACY_DRIVE | Drive data pointer
HwInt | UINT8 | Hardware interrupt used by this device
HwIntHandler | UINT32 | Storage for the original HW interrupt

Description:
CSM BlockIo device properies
Referrals:
CSM_LEGACY_DRIVE


CSM_LEGACY_DRIVE in the CsmEdd.h

Variable : CSM_LEGACY_DRIVE

File: CsmEdd.h
Fields:

Name | Type | Description
Letter | CHAR8 | Drive letter
Number | UINT8 | INT13 drive handle
EddVersion | UINT8 | EDD version supported by the drive
ExtendedInt13 | BOOLEAN | Extended INT13 support status
DriveLockingAndEjecting | BOOLEAN | Locking/Ejecting support
Edd | BOOLEAN | EDD support status
Extensions64Bit | BOOLEAN | 64 bit extension support
ParametersValid | BOOLEAN | Valid parameters (Parameters field) indicator
ErrorCode | UINT8 | Error code field
FdptPointer | VOID* | Pointer to FDPT
Floppy | BOOLEAN | Device-is-a-floppy indicator
AtapiFloppy | BOOLEAN | Device-is-an-ATAPI-floppy indicator
MaxHead | UINT8 | Number of heads
MaxSector | UINT8 | Number of sectors
MaxCylinder | UINT16 | Number of cylinders
Pad | UINT16
Parameters | EDD_DRIVE_PARAMETERS | EDD drive parameters

Description:
Hard drive data structure


EDD_DEVICE_ADDRESS_PACKET in the CsmEdd.h

Variable : EDD_DEVICE_ADDRESS_PACKET

File: CsmEdd.h
Fields:

Name | Type | Description
PacketSizeInBytes | UINT8 | Packet size in bytes
Zero | UINT8
NumberOfBlocks | UINT8 | # of blocks to transfer
Zero2 | UINT8
SegOffset | UINT32 | Data address below 1MB
LBA | UINT64 | Device Logical Block Address
TransferBuffer | UINT64 | Transfer Buffer
ExtendedBlockCount | UINT32 | Transferred blocks counter
Zero3 | UINT32

Description:
Device address packet used during EDD data transfers


CsmHwInfo.c

Description:
Hardware Information routines

The following functions are used in the file: CsmHwInfo.c.

Function | Description
GetDriveHandle | This function searches for the IDE mass storage device handle in the list of handles and returns the one that matches with the given IdentifyDrive information.
SetINT0F_E0000 | Change INT0F Vector To E000 Segment
UpdateCsm16Configuration | This function updates Csm16BootTable and BDA. It can be called multiple times during POST as the new hardware is discovered and configured.
UpdatePciLastBusCallback | This callback function then will process the list of root bridges and will update the LastPciBus field of EFI_COMPATIBILITY16_TABLE accordingly.


GetDriveHandle in the CsmHwInfo.c

Function : GetDriveHandle

File: CsmHwInfo.c
Description:
This function searches for the IDE mass storage device handle in the list
of handles and returns the one that matches with the given IdentifyDrive
information.


SetINT0F_E0000 in the CsmHwInfo.c

Function : SetINT0F_E0000

File: CsmHwInfo.c
Description:
Change INT0F Vector To E000 Segment
Output:
EFI_STATUS Success of failure of the operation.
Notes:
If the IRQ7 vector is in F000 segment, MS-DOS will take over
the IRQ7 ISR and cause HDDs not working. This routine places IRQ7
handler in E000 segment to avoid this problem.


UpdateCsm16Configuration in the CsmHwInfo.c

Function : UpdateCsm16Configuration

File: CsmHwInfo.c
Description:
This function updates Csm16BootTable and BDA. It can be called multiple
times during POST as the new hardware is discovered and configured.
Input:
Csm16BootTable  pointer to EFI_TO_COMPATIBILITY16_BOOT_TABLE
Output:
EFI_SUCCESS Table is updated successfully.


CsmInt13.c

Description:
CSM Block I/O module. Support module containing reset,
flush, read and write functions.

The following functions are used in the file: CsmInt13.c.

Function | Description
CsmBlockIoFlushBlocks | BlockIo protocol function that flushes data onto the device
Edd11CsmReadBlocks | Read device using EDD1.1 read function
Edd11CsmWriteBlocks | Write device using EDD1.1 write function
Edd30CsmReadBlocks | Read device using EDD3.0 read function
Edd30CsmWriteBlocks | Write device using EDD3.0 write function
GetDriveParameters | Executes INT13 function 48 to get hard disk parameters
GetInt13DeviceParameters | Get hard drive parameters using INT13 function 8
GetInt13Extensions | Executes INT13 func 41 to check EDD extensions
InitBlockIo | Initializes BlockIo protocol for a given device
LegacyCsmReadBlocks | Read device using INT13 function 2
LegacyCsmWriteBlocks | Write device using INT13 function 3
PatchHwInterrupt | Saves HW interrupt vector used by this device
RestoreHwInterrupt | Restores HW interrupt saved by PatchHwInterrupt


CsmBlockIoFlushBlocks in the CsmInt13.c

Function : CsmBlockIoFlushBlocks

File: CsmInt13.c
Description:
BlockIo protocol function that flushes data onto the device
Input:
Instance of the EFI_BLOCK_IO_PROTOCOL
Output:
Status of the operation


Edd11CsmReadBlocks in the CsmInt13.c

Function : Edd11CsmReadBlocks

File: CsmInt13.c
Description:
Read device using EDD1.1 read function
Input:
BlockIo protocol instance, Media ID, read data buffer
Output:
Status of the operation
Referrals:
EFI_LBA


Edd11CsmWriteBlocks in the CsmInt13.c

Function : Edd11CsmWriteBlocks

File: CsmInt13.c
Description:
Write device using EDD1.1 write function
Input:
BlockIo protocol instance, Media ID, write data buffer
Output:
Status of the operation
Referrals:
EFI_LBA


Edd30CsmReadBlocks in the CsmInt13.c

Function : Edd30CsmReadBlocks

File: CsmInt13.c
Description:
Read device using EDD3.0 read function
Input:
BlockIo protocol instance, Media ID, read data buffer
Output:
Status of the operation
Referrals:
EFI_LBA


Edd30CsmWriteBlocks in the CsmInt13.c

Function : Edd30CsmWriteBlocks

File: CsmInt13.c
Description:
Write device using EDD3.0 write function
Input:
BlockIo protocol instance, Media ID, write data buffer
Output:
Status of the operation
Referrals:
EFI_LBA


GetDriveParameters in the CsmInt13.c

Function : GetDriveParameters

File: CsmInt13.c
Description:
Executes INT13 function 48 to get hard disk parameters
Input:
BlockIo device, Drive
Output:
TRUE if operation is successful, FALSE otherwise
Referrals:
CSM_BLOCK_IO_DEV, CSM_LEGACY_DRIVE


GetInt13DeviceParameters in the CsmInt13.c

Function : GetInt13DeviceParameters

File: CsmInt13.c
Description:
Get hard drive parameters using INT13 function 8
Input:
BlockIo device, Drive
Output:
TRUE if operation is successful, FALSE otherwise
Referrals:
CSM_BLOCK_IO_DEV, CSM_LEGACY_DRIVE


GetInt13Extensions in the CsmInt13.c

Function : GetInt13Extensions

File: CsmInt13.c
Description:
Executes INT13 func 41 to check EDD extensions
Input:
BlockIo device, Drive
Output:
TRUE if operation is successful, FALSE otherwise
Referrals:
CSM_BLOCK_IO_DEV, CSM_LEGACY_DRIVE


InitBlockIo in the CsmInt13.c

Function : InitBlockIo

File: CsmInt13.c
Description:
Initializes BlockIo protocol for a given device
Input:
Device to initialize
Output:
TRUE initialization succeeded, FALSE otherwise
Referrals:
CSM_BLOCK_IO_DEV, GetInt13DeviceParameters, GetInt13Extensions


LegacyCsmReadBlocks in the CsmInt13.c

Function : LegacyCsmReadBlocks

File: CsmInt13.c
Description:
Read device using INT13 function 2
Input:
BlockIo protocol instance, Media ID, read data buffer
Output:
Status of the operation
Referrals:
EFI_LBA


LegacyCsmWriteBlocks in the CsmInt13.c

Function : LegacyCsmWriteBlocks

File: CsmInt13.c
Description:
Write device using INT13 function 3
Input:
BlockIo protocol instance, Media ID, write data buffer
Output:
Status of the operation
Referrals:
EFI_LBA


PatchHwInterrupt in the CsmInt13.c

Function : PatchHwInterrupt

File: CsmInt13.c
Description:
Saves HW interrupt vector used by this device
Input:
BlockIo device
Output:
None
Referrals:
CSM_BLOCK_IO_DEV


RestoreHwInterrupt in the CsmInt13.c

Function : RestoreHwInterrupt

File: CsmInt13.c
Description:
Restores HW interrupt saved by PatchHwInterrupt
Input:
BlockIo device
Output:
None
Referrals:
CSM_BLOCK_IO_DEV, PatchHwInterrupt


CsmLib.c

Description:
Functions and variables used in different CSM modules

The following functions are used in the file: CsmLib.c.

Function | Description
AddBbsEntry | This function adds given BBS entry to a BBS table.
ChecksumCSM16Header | Calculates and updates a checksum field of $EFI header.
ConnectSerialIO | Connect all the serial IO that was disconnected before.
Csm16Configuration | This is LegacyBiosExt interface function that manages CSM16 configuration settings.
DisconnectSerialIO | Disconnect the All the Serial io Handles
FindEmbeddedRom | This function searches for ROM within the data previously loaded from the main FV image and returns its pointer and size.
GetBbsTable | This function returns a pointer to the BBS table and the number of entries.
GetComPortResource | Returns COM port base address and interrupt
GetLptResource | Returns LPT base address and interrupt
GetSioDeviceStatus | Returns present/absent status of SIO device.
InsertBbsEntryAt | This function is an extension of AddBbsEntry function; it allows to add a BBS_ENTRY at a particular location or add a new entry and return its new location.
IsAMICSM16 | This function checks whether the CSM16 image is made by AMI.
IsSioDevicePluggedIn | Returns connect status of certain SIO device.
LockShadow | Locks the shadow region(s).
RemoveBbsEntryAt | This function removes BBS entry from BBS table.
RemoveDecodingForShadow | This function will clear the R/W attribute for the region from DecodeAddr to gMaxOpRomAddress; this is needed for some OS drivers to be loaded properly (Win PCMCIA driver).
SignalProtocolEvent | Internal function that installs/uninstall protocol with a specified GUID and NULL interface. Such protocols can be used as event signaling mechanism.
UnlockShadow | Opens the shadow region(s) for writing.


AddBbsEntry in the CsmLib.c

Function : AddBbsEntry

File: CsmLib.c
Description:
This function adds given BBS entry to a BBS table.
Input:
BbsEntry - BBS table entry to be added to a table.


ChecksumCSM16Header in the CsmLib.c

Function : ChecksumCSM16Header

File: CsmLib.c
Description:
Calculates and updates a checksum field of $EFI header.
Input:
Csm16Header Pointer to the EFI_COMPATIBILITY16_TABLE structure
Output:
Checksum byte
Notes:
Shadow region must be open for writing


ConnectSerialIO in the CsmLib.c

Function : ConnectSerialIO

File: CsmLib.c
Description:
Connect all the serial IO that was disconnected before.


Csm16Configuration in the CsmLib.c

Function : Csm16Configuration

File: CsmLib.c
Description:
This is LegacyBiosExt interface function that manages CSM16 configuration
settings.


DisconnectSerialIO in the CsmLib.c

Function : DisconnectSerialIO

File: CsmLib.c
Description:
Disconnect the All the Serial io Handles


FindEmbeddedRom in the CsmLib.c

Function : FindEmbeddedRom

File: CsmLib.c
Description:
This function searches for ROM within the data previously loaded
from the main FV image and returns its pointer and size.
Output:
EFI_SUCCESS or EFI_NOT_FOUND


GetBbsTable in the CsmLib.c

Function : GetBbsTable

File: CsmLib.c
Description:
This function returns a pointer to the BBS table and the
number of entries.
Output:
BbsTable - Pointer to BBS table.
BbsCount - Number of entries in table.


GetComPortResource in the CsmLib.c

Function : GetComPortResource

File: CsmLib.c
Description:
Returns COM port base address and interrupt
Input:
ComNo - COM port number, 0-based.
Output:
EFI_NOT_FOUND - COM port is not found.
EFI_SUCCESS - COM port found, the output variables are updated:
   Address - IO base address
   Irq     - IRQ number


GetLptResource in the CsmLib.c

Function : GetLptResource

File: CsmLib.c
Description:
Returns LPT base address and interrupt


GetSioDeviceStatus in the CsmLib.c

Function : GetSioDeviceStatus

File: CsmLib.c
Description:
Returns present/absent status of SIO device.


InsertBbsEntryAt in the CsmLib.c

Function : InsertBbsEntryAt

File: CsmLib.c
Description:
This function is an extension of AddBbsEntry function; it
allows to add a BBS_ENTRY at a particular location or add
a new entry and return its new location.
Input:
This        - Instance of LegacyBiosExt protocol.
EntryNumber - Pointer to 0-based index in BBS table. The
             value of 0xFF will generate a new entry.
Output:
EFI_INVALID_PARAMETER - EntryNumber is NULL.
EFI_SUCCESS - EntryNumber is updated with the index of updated
             BBS entry.


IsAMICSM16 in the CsmLib.c

Function : IsAMICSM16

File: CsmLib.c
Description:
This function checks whether the CSM16 image is made by AMI.


IsSioDevicePluggedIn in the CsmLib.c

Function : IsSioDevicePluggedIn

File: CsmLib.c
Description:
Returns connect status of certain SIO device.


LockShadow in the CsmLib.c

Function : LockShadow

File: CsmLib.c
Description:
Locks the shadow region(s).
Input:
LockAddr    - Starting address of the area to be locked
LockSize    - Size of the area to be locked
Output:
Status of the lock operation.
Notes:
This function will also clear the R/W attribute for the region
from LockAddr+LockSize to gMaxOpRomAddress; this is needed for
some OS drivers to be loaded properly (Win PCMCIA driver)


UnlockShadow in the CsmLib.c

Function : UnlockShadow

File: CsmLib.c
Description:
Opens the shadow region(s) for writing.
Input:
Address - starting address
Size    - size of the region
Output:
LockUnlockAddr - address of the first unlocked block
LockUnlockSize - unlocked address space
Function returns EFI_OUT_OF_RESOURCES if there is not enough room
in the shadow.


csmoem.mak

Description:
CSM OEM implementation makefile


CsmOpROM.c

Description:
CSM PCI ROM interface routines

The following functions are used in the file: CsmOpROM.c.

Function | Description
Check30ROM | Verifies whether the passed PCI ROM image is PCI 3.0 compatible. If so, returns the projected (runtime) size of this ROM.
CheckEnablePciSiblings | This function manages the ability of the Option ROM to control several PCI devices in the system. For example, SCSI Option ROM designed for the multi-channel SCSI adaptor usually controls all the channels even though they are different PCI functions of the same device. Likewise, NIC Option ROM may be able to control several NICs located on different PCI devices or even on different PCI buses.
CheckPciRom | Tests to see if a traditional PCI ROM exists for this device
ClpExecute | This is CLP execution protocol function that is called by any driver that needs to perform device configuration using Command Line Protocol.
CsmInstallRom | Executes a given ROM using parameters pre-defined as input in EFI_DISPATCH_OPROM_TABLE data structure.
ExecuteBcv | Checks if the platform allows BCV execution; if so, executes BCV and logs the status of HW interrupt changes.
FetchBbsBootDevices | Check PCI ROM for PnP structures and inserts BCV/BEV devices into BBS table.
FindAnyVga | Returns the first VGA controller handle from PciIo device list.
GetShadowRamAddress | Returns the available shadow RAM address out of the given range.
InitClp | This function is initializing and installing the CLP protocol.
InstallIsaRom | Executes ISA Option ROM
InstallPciRom | Shadows an OpROM
IsValidLegacyPciOpROM | Tests PCI ROM for Legacy PCI ROM compatibility.
PciRomAlreadyExecuted | Reports whether OpROM for a given PciIo already executed.
SaveOprom | This routine saves Oprom that was just executed to the next gSavedOprom data field; gSavedOprom is incremented.
ShadowAllLegacyOproms | Allows external agents to force loading of all legacy OpROMs. This function can be invoked before GetBbsInfo() to ensure all devices are counted.
UpdateEbdaMap | This routine is called after every OpROM (BBS or non-BBS) is executed. It updates the locations of EBDA in SAVED_PCI_ROM.ebdaAddr fields after OpROM expands EBDA.


Check30ROM in the CsmOpROM.c

Function : Check30ROM

File: CsmOpROM.c
Description:
Verifies whether the passed PCI ROM image is PCI 3.0 compatible.
If so, returns the projected (runtime) size of this ROM.
Output:
TRUE - image is PCI 3.0 compliant ROM, size is updated
FALSE - image is not PCI 3.0 compliant ROM, size remains untouched.


CheckPciRom in the CsmOpROM.c

Function : CheckPciRom

File: CsmOpROM.c
Description:
Tests to see if a traditional PCI ROM exists for this device
Input:
This        Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
PciHandle   The handle for this device. Type EFI_HANDLE is defined in
InstallProtocolInterface() in the EFI 1.10 Specification.
RomImage    Pointer to the ROM image.
RomSize     The size of the ROM image.
Flags       The type of ROM discovered. Multiple bits can be set, as follows:
   00 = No ROM
   01 = ROM Found
   02 = ROM is a valid legacy ROM
Output:
EFI_SUCCESS A traditional OpROM is available for this device.
EFI_UNSUPPORTED A traditional OpROM is not supported.


FetchBbsBootDevices in the CsmOpROM.c

Function : FetchBbsBootDevices

File: CsmOpROM.c
Description:
Check PCI ROM for PnP structures and inserts BCV/BEV devices
into BBS table.
Input:
Pointer to PCI ROM.
Output:
Number of devices installed.


FindAnyVga in the CsmOpROM.c

Function : FindAnyVga

File: CsmOpROM.c
Description:
Returns the first VGA controller handle from PciIo device list.
Input:
None
Output:
PCI VGA controller PciIo handle


InstallPciRom in the CsmOpROM.c

Function : InstallPciRom

File: CsmOpROM.c
Description:
Shadows an OpROM
Input:
This        Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
PciHandle   The PCI PC-AT* OpROM from this device's ROM BAR will be loaded
RomImage    A PCI PC-AT ROM image.  This argument is non-NULL if there is
   no hardware associated with the ROM and thus no PciHandle;
   otherwise it must be NULL. An example is the PXE base code.
Flags       The type of ROM discovered. Multiple bits can be set, as follows:
   00 = No ROM.
   01 = ROM found.
   02 = ROM is a valid legacy ROM.
DiskStart   Disk number of the first device hooked by the ROM. If DiskStart is
   the same as DiskEnd, no disks were hooked.
DiskEnd     Disk number of the last device hooked by the ROM.
RomShadowAddress    Shadow address of PC-AT ROM.
ShadowedRomSize     Size in bytes of RomShadowAddress.
Output:
EFI_SUCCESS     The OpROM was shadowed
EFI_UNSUPPORTED The PciHandle was not found


IsValidLegacyPciOpROM in the CsmOpROM.c

Function : IsValidLegacyPciOpROM

File: CsmOpROM.c
Description:
Tests PCI ROM for Legacy PCI ROM compatibility.
Output:
TRUE    - Image is valid
FALSE   - Image is not valid
Notes:
From PCI Fw Specification 3.0, 5.2.1.21. Backward Compatibility of Option ROMs Page # 86.
It is also possible to have two separate ROM images for the same PCI device: one for PCI 2.1
System Firmware and one for PCI 3.0 compliance. In this case, the PCI 2.1 Option ROM image
must appear first in the sequence of images. PCI 3.0 System Firmware will first search for a
PCI 3.0 Option ROM image and only use the PCI 2.1 Option ROM image if no PCI 3.0 Option ROM
image is found.


SaveOprom in the CsmOpROM.c

Function : SaveOprom

File: CsmOpROM.c
Description:
This routine saves Oprom that was just executed to the next
gSavedOprom data field; gSavedOprom is incremented.
Input:
Rom address
Address and size or runtime data taken during ROM initialization
Notes:
Saving Oprom data is only required for the option ROMs that
produce BCV because of early BCV execution; it should not be
called for non-BBS compliant OpROMs, for those OpROMs related
memory context will be the same til the system is booted.


ShadowAllLegacyOproms in the CsmOpROM.c

Function : ShadowAllLegacyOproms

File: CsmOpROM.c
Description:
Allows external agents to force loading of all legacy OpROMs.
This function can be invoked before GetBbsInfo() to ensure all
devices are counted.
Input:
This        Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
Output:
EFI_SUCCESS OpROMs are shadowed successfully.


UpdateEbdaMap in the CsmOpROM.c

Function : UpdateEbdaMap

File: CsmOpROM.c
Description:
This routine is called after every OpROM (BBS or non-BBS) is
executed. It updates the locations of EBDA in SAVED_PCI_ROM.ebdaAddr
fields after OpROM expands EBDA.
Input:
The size of EBDA created by the OpROM
Output:
None
Notes:
When this function is called SAVED_PCI_ROM structure will not have
the current OpROM information inserted; gSavedOprom is pointing to NULL
located right after the last valid entry (1st entry is also NULL).


CsmPlatform.h

Description:
CsmPlatform protocol declaration


csmsetup.c

Description:
CSM Setup related functions

The following functions are used in the file: csmsetup.c.

Function | Description
InitCsmStrings | This function is eLink'ed with the chain executed right before the Setup.


InitCsmStrings in the csmsetup.c

Function : InitCsmStrings

File: csmsetup.c
Description:
This function is eLink'ed with the chain executed right before
        the Setup.


CsmVideo.mak

Description:
CSM Video make file


LegacyBios.h

Description:
LegacyBios protocol declaration

The following functions are used in the file: LegacyBios.h.

Function | Description
AMICSM_GET_PCIBUS_XLAT_NUMBER | This function returns the PCI bus number translated according to Xlat table defined in BusNumXlat.inc. This translation file is generated by AMISDL using "BUSNUM_XLAT" output type.
EFI_LEGACY_BIOS_BOOT | Boots a traditional OS
EFI_LEGACY_BIOS_BOOT_UNCONVENTIONAL_DEVICE | This function is called when either booting to an unconventional device such as a PARTIES partition and/or executing hard disk diagnostics.
EFI_LEGACY_BIOS_CHECK_ROM | Tests to see if a traditional PCI ROM exists for this device
EFI_LEGACY_BIOS_COPY_LEGACY_REGION | This function is called when copying data to the region assigned by EFI_LEGACY_BIOS_PROTOCOL.GetLegacyRegion().
EFI_LEGACY_BIOS_FARCALL86 | This function performs a far call into Compatibility16 or traditional OpROM code at the specified Segment:Offset.
EFI_LEGACY_BIOS_GET_BBS_INFO | Presents BBS information to external agents.
EFI_LEGACY_BIOS_GET_LEGACY_REGION | This function is called when EFI needs to reserve an area in the 0xE0000 or 0xF0000 64 KB blocks.
EFI_LEGACY_BIOS_INSTALL_ROM | Shadows an OpROM
EFI_LEGACY_BIOS_INT86 | Issues a traditional software INT.
EFI_LEGACY_BIOS_PREPARE_TO_BOOT | This function is called when booting an EFI-aware OS with legacy hard disks. The legacy hard disks may or may not be the boot device but will be accessed by the EFI-aware OS.
EFI_LEGACY_BIOS_SHADOW_ALL_LEGACY_OPROMS | Allows external agents to force loading of all legacy OpROMs. This function can be invoked before GetBbsInfo() to ensure all devices are counted.
EFI_LEGACY_BIOS_UPDATE_KEYBOARD_LED_STATUS | Updates the BDA to reflect status of the Scroll Lock, Num Lock, and Caps Lock keys and LEDs.

The following data structures are used in the file: LegacyBios.h.

Variable | Description
AMICSM_PCIBUSNUM_XLAT_PROTOCOL | This protocol defines the function that returns the PCI according to the table generated by AMISDL out of the list of PCI-PCI bridges.
BBS_STATUS_FLAGS |
BBS_TABLE |
EFI_BYTE_REGS | These register set definitions are used in EFI_LEGACY_BIOS_INT86 and EFI_LEGACY_BIOS_FARCALL86 fuctions.
EFI_COMPATIBILITY16_TABLE |
EFI_DWORD_REGS | These register set definitions are used in EFI_LEGACY_BIOS_INT86 and EFI_LEGACY_BIOS_FARCALL86 fuctions.
EFI_EFLAGS_REG | These register set definitions are used in EFI_LEGACY_BIOS_INT86 and EFI_LEGACY_BIOS_FARCALL86 fuctions.
EFI_FLAGS_REG | These register set definitions are used in EFI_LEGACY_BIOS_INT86 and EFI_LEGACY_BIOS_FARCALL86 fuctions.
EFI_IA32_REGISTER_SET | These register set definitions are used in EFI_LEGACY_BIOS_INT86 and EFI_LEGACY_BIOS_FARCALL86 fuctions.
EFI_LEGACY_BIOS_PROTOCOL | Abstracts the traditional BIOS from the rest of EFI. The LegacyBoot() member function allows the BDS to support booting a traditional OS. EFI thunks drivers that make EFI bindings for BIOS INT services use all the other member functions.
EFI_WORD_REGS | These register set definitions are used in EFI_LEGACY_BIOS_INT86 and EFI_LEGACY_BIOS_FARCALL86 fuctions.
HDD_INFO |
UD_TABLE |
UDC_ATTRIBUTES |


AMICSM_GET_PCIBUS_XLAT_NUMBER in the LegacyBios.h

Function : AMICSM_GET_PCIBUS_XLAT_NUMBER

File: LegacyBios.h
Description:
This function returns the PCI bus number translated according
to Xlat table defined in BusNumXlat.inc. This translation file
is generated by AMISDL using "BUSNUM_XLAT" output type.
Input:
Build time PCI bus number - 1st coulmn of the xlat table
Output:
EFI_SUCCESS, real PCI bus number - 2nd column of the xlat table
EFI_NOT_FOUND, the requested bus is not found in the xlat table
EFI_INVALID_PARAMETER, if NULL pointer is supplied on input


AMICSM_PCIBUSNUM_XLAT_PROTOCOL in the LegacyBios.h

Variable : AMICSM_PCIBUSNUM_XLAT_PROTOCOL

File: LegacyBios.h
Fields:

Name | Type | Description
GetXlatPciBusNum | AMICSM_GET_PCIBUS_XLAT_NUMBER | Returns the translated bus number

Description:
This protocol defines the function that returns the PCI
according to the table generated by AMISDL out of the list
of PCI-PCI bridges.


BBS_STATUS_FLAGS in the LegacyBios.h

Variable : BBS_STATUS_FLAGS

File: LegacyBios.h
Fields:

Name | Type | Description
OldPosition | UINT16 | :4 Prior priority.
Reserved1 | UINT16 | :4 Reserved for future use.
Enabled | UINT16 | :1 If 0, ignore this entry.
Failed | UINT16 | :1 0-Not known if boot failure occurred; 1-Boot attempt failed.
MediaPresent | UINT16 | :2 State of media present, see notes.
Reserved2 | UINT16 | :4 Reserved for future use.

Notes:
MediaPresent field details:
00 = No bootable media is present in the device.
01 = Unknown if a bootable media present.
10 = Media is present and appears bootable.
11 = Reserved.


BBS_TABLE in the LegacyBios.h

Variable : BBS_TABLE

File: LegacyBios.h
Fields:

Name | Type | Description
BootPriority | UINT16 | The boot priority for this boot device.
Bus | UINT32 | The PCI bus for this boot device.
Device | UINT32 | The PCI device for this boot device.
Function | UINT32 | The PCI function for the boot device.
Class | UINT8 | The PCI class for this boot device..
SubClass | UINT8 | The PCI Subclass for this boot device.
MfgString | UINT32 | Segment:offset address of an ASCIIZ description.
DeviceType | UINT16 | BBS device type.
StatusFlags | BBS_STATUS_FLAGS | Status of this boot device.
BootHandler | UINT32 | Segment:Offset address of boot loader for IPL devices.
DescString | UINT32 | Segment:offset address of an ASCIIZ description string.
InitPerReserved | UINT32 | Reserved.
AdditionalIrq | Handler | UINT32 See notes for details.
AssignedDriveNumber | UINT8 | The drive number(0x80 -0x8?) assigned by the 16-bit code.
IBV1 | UINT32 | IBV specific field.
IBV2 | UINT32 | IBV specific field.

Notes:
The use of AdditionalIrq??Handler fields is IBV dependent. They can be
used to flag that an OpROM has hooked the specified IRQ. The OpROM
may be BBS compliant as some SCSI BBS-compliant OpROMs also hook IRQ
vectors in order to run their BIOS Setup.


EFI_BYTE_REGS in the LegacyBios.h

Variable : EFI_BYTE_REGS

File: LegacyBios.h
Description:
These register set definitions are used in EFI_LEGACY_BIOS_INT86
and EFI_LEGACY_BIOS_FARCALL86 fuctions.


EFI_COMPATIBILITY16_TABLE in the LegacyBios.h

Variable : EFI_COMPATIBILITY16_TABLE

File: LegacyBios.h
Fields:

Name | Type | Description
Signature | UINT32 | The string "$EFI"
TableChecksum | UINT8 | The value required such that byte checksum of TableLength equals zero.
TableLength | UINT8 | The length of this table.
EfiMajorRevision | UINT8 | The major EFI revision for which this table was generated.
EfiMinorRevision | UINT8 | The minor EFI revision for which this table was generated.
TableMajorRevision | UINT8 | The major revision of this table.
TableMinorRevision | UINT8 | The minor revision of this table.
Reserved | UINT16 | Reserved for future usage.
Compatibility16CallSegment | UINT16 | The segment of the entry point.
Compatibility16CallOffset | UINT16 | The offset of the entry point.
PnPInstallationCheckSegment | UINT16 | The segment of the PnP installation check structure.
PnPInstallationCheckOffset | UINT16 | The offset of the PnP installation check structure.
EfiSystemTable | UINT32 | The address of the EFI system resources table.
OemIdStringPointer | UINT32 | The address of an OEM-provided identifier string, 0-terminated.
AcpiRsdPtrPointer | UINT32 | The 32-bit physical address where ACPI RSD PTR is stored.
OemRevision | UINT16 | The OEM revision number. Usage is undefined.
E820Pointer | UINT32 | The 32-bit physical address where INT15 E820 data is stored.
E820Length | UINT32 | The length of the E820 data and is filled in by the EfiCompatibility code.
IrqRoutingTablePointer | UINT32 | The 32-bit physical address where the $PIR table is stored.
IrqRoutingTableLength | UINT32 | The length of the $PIR table and is filled in by the EfiCompatibility code.
MpTablePtr | UINT32 | The 32-bit physical address where the MP table is stored.
MpTableLength | UINT32 | The length of the MP table and is filled in by the EfiCompatibility code.
OemintSegment | UINT16 | The segment of the OEM-specific INT table/code.
OemIntOffset | UINT16 | The offset of the OEM-specific INT table/code.
Oem32Segment | UINT16 | The segment of the OEM-specific 32-bit table/code.
Oem32Offset | UINT16 | The offset of the OEM-specific 32-bit table/code.
Oem16Segment | UINT16 | The segment of the OEM-specific 16-bit table/code.
Oem16Offset | UINT16 | The offset of the OEM-specific 16-bit table/code.
TpmSegment | UINT16 | The segment of the TPM binary passed to 16-bit CSM.
TpmOffset | UINT16 | The offset of the TPM binary passed to 16-bit CSM.
IbvPointer | UINT32 | A pointer to a string identifying the independent BIOS vendor.
PciExpressBase | UINT32 | This field is the base value of the start of the PCI Express memory-mapped configuration registers.
LastpciBus | UINT8 | Maximum PCI bus number assigned.
LastOpromAddress | UINT32 | The last address that can be occupied by the Option ROM.

Notes:
1) The string "$EFI" denotes the start of the EfiCompatibility table. Byte 0 is
"I," byte 1 is "F," byte 2 is "E," and byte 3 is "$" and is normally accessed
as a DWORD or UINT32.
2) The E820Pointer, IrqRoutingTablePointer, and MpTablePtr values are generated
by calling the Compatibility16GetTableAddress() function and converted to
32-bit physical pointers.


EFI_DWORD_REGS in the LegacyBios.h

Variable : EFI_DWORD_REGS

File: LegacyBios.h
Description:
These register set definitions are used in EFI_LEGACY_BIOS_INT86
and EFI_LEGACY_BIOS_FARCALL86 fuctions.


EFI_EFLAGS_REG in the LegacyBios.h

Variable : EFI_EFLAGS_REG

File: LegacyBios.h
Description:
These register set definitions are used in EFI_LEGACY_BIOS_INT86
and EFI_LEGACY_BIOS_FARCALL86 fuctions.


EFI_FLAGS_REG in the LegacyBios.h

Variable : EFI_FLAGS_REG

File: LegacyBios.h
Description:
These register set definitions are used in EFI_LEGACY_BIOS_INT86
and EFI_LEGACY_BIOS_FARCALL86 fuctions.


EFI_IA32_REGISTER_SET in the LegacyBios.h

Variable : EFI_IA32_REGISTER_SET

File: LegacyBios.h
Description:
These register set definitions are used in EFI_LEGACY_BIOS_INT86
and EFI_LEGACY_BIOS_FARCALL86 fuctions.


EFI_LEGACY_BIOS_BOOT in the LegacyBios.h

Function : EFI_LEGACY_BIOS_BOOT

File: LegacyBios.h
Description:
Boots a traditional OS
Input:
This            Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
BootOption      The EFI device path from BootXXXX variable.
LoadOptionSize  Size of LoadOption.
LoadOption      The load option from BootXXXX variable.
Output:
EFI_DEVICE_ERROR    Failed to boot from any boot device and
memory is uncorrupted.
Notes:
This function normally never returns. It will either boot the OS
or reset the system if memory has been "corrupted" by loading a
boot sector and passing control to it.


EFI_LEGACY_BIOS_BOOT_UNCONVENTIONAL_DEVICE in the LegacyBios.h

Function : EFI_LEGACY_BIOS_BOOT_UNCONVENTIONAL_DEVICE

File: LegacyBios.h
Description:
This function is called when either booting to an unconventional
device such as a PARTIES partition and/or executing hard disk
diagnostics.
Input:
This
Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
Attributes
Flags used to interpret the rest of the input parameters. Type UDC_ATTRIBUTES
is defined in Compatibility16PrepareToBoot().
BbsEntry
The zero-based index into the BbsTable for the parent device. Type BBS_TABLE
is defined in Compatibility16PrepareToBoot().
BeerData
Pointer to the 128 bytes of raw Beer data.
ServiceAreaData
Pointer to the 64 bytes of raw service area data. It is up to the caller to
select the appropriate service area and point to it.
Output:
EFI_INVALID_PARAMETER   Either the Attribute and/or pointers do not match.


EFI_LEGACY_BIOS_CHECK_ROM in the LegacyBios.h

Function : EFI_LEGACY_BIOS_CHECK_ROM

File: LegacyBios.h
Description:
Tests to see if a traditional PCI ROM exists for this device
Input:
This        Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
PciHandle   The handle for this device. Type EFI_HANDLE is defined in
InstallProtocolInterface() in the EFI 1.10 Specification.
RomImage    Pointer to the ROM image.
RomSize     The size of the ROM image.
Flags       The type of ROM discovered. Multiple bits can be set, as follows:
       00 = No ROM
       01 = ROM Found
       02 = ROM is a valid legacy ROM
Output:
EFI_SUCCESS A traditional OpROM is available for this device.
EFI_UNSUPPORTED A traditional OpROM is not supported.


EFI_LEGACY_BIOS_COPY_LEGACY_REGION in the LegacyBios.h

Function : EFI_LEGACY_BIOS_COPY_LEGACY_REGION

File: LegacyBios.h
Description:
This function is called when copying data to the region
assigned by EFI_LEGACY_BIOS_PROTOCOL.GetLegacyRegion().
Input:
This    Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
LegacyMemorySize    Size in bytes of the memory to copy.
LegacyMemoryAddress The location within the region returned by
           EFI_LEGACY_BIOS_PROTOCOL.GetLegacyRegion().
LegacyMemorySourceAddress   Source of the data to copy.
Output:
EFI_SUCCESS The data was copied successfully.
EFI_ACCESS_DENIED   Either the starting or ending address is out of bounds.


EFI_LEGACY_BIOS_FARCALL86 in the LegacyBios.h

Function : EFI_LEGACY_BIOS_FARCALL86

File: LegacyBios.h
Description:
This function performs a far call into Compatibility16 or
traditional OpROM code at the specified Segment:Offset.
Input:
This        Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
Segment     Segment of 16-bit mode call.
Offset      Offset of 16-bit mode call.
Regs        The IA-32 registers, type EFI_IA32_REGISTER_SET
Stack       Caller-allocated stack that is used to pass arguments.
StackSize   Size of Stack in bytes.
Output:
FALSE   FarCall() completed. Status returned in Regs
TRUE    FarCall() was not completed.
Referrals:
EFI_IA32_REGISTER_SET


EFI_LEGACY_BIOS_GET_BBS_INFO in the LegacyBios.h

Function : EFI_LEGACY_BIOS_GET_BBS_INFO

File: LegacyBios.h
Description:
Presents BBS information to external agents.
Input:
This        Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
HddCount    Number of HDD_INFO structures.
HddInfo     Onboard IDE controller information.
BbsCount    Number of BBS_TABLE structures.
BbsTable    BBS entry.
Output:
EFI_SUCCESS


EFI_LEGACY_BIOS_GET_LEGACY_REGION in the LegacyBios.h

Function : EFI_LEGACY_BIOS_GET_LEGACY_REGION

File: LegacyBios.h
Description:
This function is called when EFI needs to reserve an area
in the 0xE0000 or 0xF0000 64 KB blocks.
Input:
This                Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
LegacyMemorySize    Requested size in bytes of the region.
Region              Requested region.
               00 = Either 0xE0000 or 0xF0000 blocks.
               Bit0 = 1 Specify 0xF0000 block
               Bit1 = 1 Specify 0xE0000 block
Alignment   Bit-mapped value specifying the address alignment of the requested
   region. The first nonzero value from the right is alignment.
Output:
LegacyMemoryAddress     Address assigned.
EFI_SUCCESS The requested region was assigned.
EFI_ACCESS_DENIED   The function was previously invoked.
Other   The requested region was not assigned.


EFI_LEGACY_BIOS_INSTALL_ROM in the LegacyBios.h

Function : EFI_LEGACY_BIOS_INSTALL_ROM

File: LegacyBios.h
Description:
Shadows an OpROM
Input:
This        Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
PciHandle   The PCI PC-AT* OpROM from this device's ROM BAR will be loaded
RomImage    A PCI PC-AT ROM image.  This argument is non-NULL if there is
no hardware associated with the ROM and thus no PciHandle; otherwise it
must be NULL. An example is the PXE base code.
Flags       The type of ROM discovered. Multiple bits can be set, as follows:
       00 = No ROM.
       01 = ROM found.
       02 = ROM is a valid legacy ROM.
DiskStart   Disk number of the first device hooked by the ROM. If DiskStart is
the same as DiskEnd, no disks were hooked.
DiskEnd     Disk number of the last device hooked by the ROM.
RomShadowAddress    Shadow address of PC-AT ROM.
ShadowedRomSize     Size in bytes of RomShadowAddress.
Output:
EFI_SUCCESS The OpROM was shadowed
EFI_UNSUPPORTED The PciHandle was not found


EFI_LEGACY_BIOS_INT86 in the LegacyBios.h

Function : EFI_LEGACY_BIOS_INT86

File: LegacyBios.h
Description:
Issues a traditional software INT.
Input:
This    -   Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
BiosInt -   The software INT requested.
Regs    -   The IA-32 registers.
Output:
FALSE   INT completed. Status returned in Regs.
TRUE    INT was not completed.
Referrals:
EFI_IA32_REGISTER_SET


EFI_LEGACY_BIOS_PREPARE_TO_BOOT in the LegacyBios.h

Function : EFI_LEGACY_BIOS_PREPARE_TO_BOOT

File: LegacyBios.h
Description:
This function is called when booting an EFI-aware OS with legacy
hard disks. The legacy hard disks may or may not be the boot
device but will be accessed by the EFI-aware OS.
Input:
This        Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
BbsCount    Number of BBS_TABLE structures.
BbsTable    BBS entry.
Output:
EFI_SUCCESS Boot is prepared successfully.


EFI_LEGACY_BIOS_PROTOCOL in the LegacyBios.h

Variable : EFI_LEGACY_BIOS_PROTOCOL

File: LegacyBios.h
Fields:

Name | Type | Description
Int86 | EFI_LEGACY_BIOS_INT86 | Performs traditional software INT.
FarCall86 | EFI_LEGACY_BIOS_FARCALL86 | Performs a 16-bit far call.
CheckPciRom | EFI_LEGACY_BIOS_CHECK_ROM | Checks if a traditional OpROM exists for this device.
InstallPciRom | EFI_LEGACY_BIOS_INSTALL_ROM | Loads a traditional OpROM in traditional OpROM address space.
LegacyBoot | EFI_LEGACY_BIOS_BOOT | Boots a traditional OS.
UpdateKeyboardLedStatus | EFI_LEGACY_BIOS_UPDATE_KEYBOARD_LED_STATUS | Updates BDA to reflect the current EFI keyboard LED status.
GetBbsInfo | EFI_LEGACY_BIOS_GET_BBS_INFO | Allows an external agent, such as BIOS Setup, to get the BBS data.
ShadowAllLegacyOproms | EFI_LEGACY_BIOS_SHADOW_ALL_LEGACY_OPROMS | Causes all legacy OpROMs to be shadowed.
PrepareToBoot | EFI_LEGACY_BIOS_PREPARE_TO_BOOT | Performs all actions prior to boot.
GetLegacyRegion | EFI_LEGACY_BIOS_GET_LEGACY_REGION | Allows EFI to reserve an area in the 0xE0000 or 0xF0000 block.
CopyLegacyRegion | EFI_LEGACY_BIOS_COPY_LEGACY_REGION | Allows EFI to copy data to the area specified by GetLegacyRegion.
BootUnconventionalDevice | EFI_LEGACY_BIOS_BOOT_UNCONVENTIONAL_DEVICE | Allows the user to boot off an unconventional device.

Description:
Abstracts the traditional BIOS from the rest of EFI. The
LegacyBoot() member function allows the BDS to support booting
a traditional OS. EFI thunks drivers that make EFI bindings for
BIOS INT services use all the other member functions.


EFI_LEGACY_BIOS_SHADOW_ALL_LEGACY_OPROMS in the LegacyBios.h

Function : EFI_LEGACY_BIOS_SHADOW_ALL_LEGACY_OPROMS

File: LegacyBios.h
Description:
Allows external agents to force loading of all legacy OpROMs.
This function can be invoked before GetBbsInfo() to ensure all
devices are counted.
Input:
This    Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
Output:
EFI_SUCCESS OpROMs are shadowed successfully.


EFI_LEGACY_BIOS_UPDATE_KEYBOARD_LED_STATUS in the LegacyBios.h

Function : EFI_LEGACY_BIOS_UPDATE_KEYBOARD_LED_STATUS

File: LegacyBios.h
Description:
Updates the BDA to reflect status of the Scroll Lock,
Num Lock, and Caps Lock keys and LEDs.
Input:
This    Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
Leds    Current LED status, as follows:
       Bit 0 - Scroll Lock         0 = Off
       Bit 1 - Num Lock
       Bit 2 - Caps Lock
Output:
EFI_SUCCESS The BDA was updated successfully.


EFI_WORD_REGS in the LegacyBios.h

Variable : EFI_WORD_REGS

File: LegacyBios.h
Description:
These register set definitions are used in EFI_LEGACY_BIOS_INT86
and EFI_LEGACY_BIOS_FARCALL86 fuctions.


HDD_INFO in the LegacyBios.h

Variable : HDD_INFO

File: LegacyBios.h
Fields:

Name | Type | Description
Status | UINT16 | Status of IDE device. See Notes for details.
Bus | UINT32 | PCI bus of IDE controller.
Device | UINT32 | PCI device of IDE controller.
Function | UINT32 | PCI function of IDE controller.
CommandBaseAddress | UINT16 | Command ports base address.
ControlBaseAddress | UINT16 | Control ports base address.
BusMasterAddress | UINT16 | Bus master address.
IdentifyDrive | ATAPI_IDENTIFY | Data that identifies the drive data.

Notes:
The values for the Status field are the following:
HDD_PRIMARY              0x01
HDD_SECONDARY            0x02
HDD_MASTER_ATAPI         0x04
HDD_SLAVE_ATAPI          0x08
HDD_MASTER_IDE           0x20
HDD_SLAVE_IDE            0x40
HDD_SATA_PATA            0x80
There is one HDD_INFO structure per IDE controller. The IdentifyDrive is
one per drive. Index 0 is master and index 1 is slave.


UD_TABLE in the LegacyBios.h

Variable : UD_TABLE

File: LegacyBios.h
Fields:

Name | Type | Description
Attributes | UDC_ATTRIBUTES | This field contains the bit-mapped attributes of the PARTIES information.
DeviceNumber | UINT8 | This field contains the zero-based device on which the selected ServiceDataArea is present.
BbsTableEntryNumberForParentDevice | UINT8 | This field contains the zero-based index into the BbsTable for the parent device.
BbsTableEntryNumberForBoot | UINT8 | This field contains the zero-based index into the BbsTable for the boot entry.
BbsTableEntryNumberForHddDiag | UINT8 | This field contains the zero-based index into the BbsTable for the HDD diagnostics entry.
BeerData | UINT8 | [128] The raw Beer data.
ServiceAreaData | UINT8 | [64] The raw data of selected service area.


UDC_ATTRIBUTES in the LegacyBios.h

Variable : UDC_ATTRIBUTES

File: LegacyBios.h
Fields:

Name | Type | Description
DirectoryServiceValidity | UINT8 | :1 This bit set indicates that the ServiceAreaData is valid.
RacbaUsedFlag | UINT8 | :1 This bit set indicates to use the RACBA only if DirectoryServiceValidity is 0.
ExecuteHddDiagnosticsFlag | UINT8 | :1 This bit set indicates to execute hard disk diagnostics.
Reserved | UINT8 | :5 Reserved for future use. Set to 0.


LegacyBiosExt.h

Description:
AMI extensions to LegacyBios protocol

The following data structures are used in the file: LegacyBiosExt.h.

Variable | Description
EFI_LEGACY_BIOS_EXT_PROTOCOL | Extends LegacyBios protocol with the AMI implementation specific CSM funcitons and data.


EFI_LEGACY_BIOS_EXT_PROTOCOL in the LegacyBiosExt.h

Variable : EFI_LEGACY_BIOS_EXT_PROTOCOL

File: LegacyBiosExt.h
Description:
Extends LegacyBios protocol with the AMI implementation specific
CSM funcitons and data.


LegacyBiosPlatform.h

Description:
LegacyBiosPlatform protocol declaration

The following functions are used in the file: LegacyBiosPlatform.h.

Function | Description
EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE | Returns a buffer of handles for the requested subfunction.
EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO | Finds the binary data or other platform information. Refer to the subfunctions for additional information.
EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE | Returns information associated with PCI IRQ routing.
EFI_LEGACY_BIOS_PLATFORM_HOOKS | Allows platform to perform any required action after a LegacyBios operation.
EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT | Prepares the attempt to boot a traditional OS.
EFI_LEGACY_BIOS_PLATFORM_SMM_INIT | Loads and registers the Compatibility16 handler with the EFI SMM code.
EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ | This function translates the given PIRQ back through all buses, if required, and returns the true PIRQ and associated IRQ.

The following data structures are used in the file: LegacyBiosPlatform.h.

Variable | Description
EFI_GET_PLATFORM_HANDLE_MODE | Mode definitions for EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE
EFI_GET_PLATFORM_HOOK_MODE | Mode definitions for EFI_LEGACY_BIOS_PLATFORM_HOOKS
EFI_GET_PLATFORM_INFO_MODE | Mode definitions for EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO
EFI_LEGACY_BIOS_PLATFORM_PROTOCOL | The EFI_LEGACY_BIOS_PLATFORM_PROTOCOL is used to abstract the platform-specific traditional hardware and or policy decisions from the generic EfiCompatibility code.
EFI_LEGACY_IRQ_PRIORITY_TABLE_ENTRY | EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE related definition
EFI_LEGACY_IRQ_ROUTING_ENTRY | EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE related definition
EFI_LEGACY_PIRQ_ENTRY | EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE related definition
EFI_LEGACY_PIRQ_TABLE_HEADER | EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE related definition


EFI_GET_PLATFORM_HANDLE_MODE in the LegacyBiosPlatform.h

Variable : EFI_GET_PLATFORM_HANDLE_MODE

File: LegacyBiosPlatform.h
Description:
Mode definitions for EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE


EFI_GET_PLATFORM_HOOK_MODE in the LegacyBiosPlatform.h

Variable : EFI_GET_PLATFORM_HOOK_MODE

File: LegacyBiosPlatform.h
Description:
Mode definitions for EFI_LEGACY_BIOS_PLATFORM_HOOKS


EFI_GET_PLATFORM_INFO_MODE in the LegacyBiosPlatform.h

Variable : EFI_GET_PLATFORM_INFO_MODE

File: LegacyBiosPlatform.h
Description:
Mode definitions for EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO


EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE in the LegacyBiosPlatform.h

Function : EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE

File: LegacyBiosPlatform.h
Description:
Returns a buffer of handles for the requested subfunction.
Input:
This    Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance.
Mode    Specifies what handle to return.
GetVgaHandle
GetIdeHandle
GetIsaBusHandle
GetUsbHandle
Type            Handle Modifier - Mode specific
HandleBuffer    Pointer to buffer containing all Handles matching the specified criteria.
       Handles are sorted in priority order. Type EFI_HANDLE is defined in
       InstallProtocolInterface() in the EFI 1.10 Specification.
HandleCount     Number of handles in HandleBuffer.
AdditionalData  Pointer to additional data returned - mode specific..
Output:
EFI_SUCCESS The handle is valid.
EFI_UNSUPPORTED Mode is not supported on this platform.
EFI_NOT_FOUND   The handle is not known.


EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO in the LegacyBiosPlatform.h

Function : EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO

File: LegacyBiosPlatform.h
Description:
Finds the binary data or other platform information.
Refer to the subfunctions for additional information.
Input:
This    Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance.
Mode    Specifies what data to return:
   GetMpTable
   GetOemIntData
   GetOem16Data
   GetOem32Data
   GetTpmBinary
   GetSystemRom
   GetPciExpressBase
   GetPmmSize
   GetPlatformEndRomShadowAddr
   EfiGetOpromVideoSwitchingMode
   EfiGetInterruptSaveRestoreTable

Table       Pointer to OEM legacy 16-bit code or data.
TableSize   Size of data.
Location    Location to place table. 0x00 - Either 0xE0000 or 0xF0000 64 KB blocks.
   Bit 0 = 1 0xF0000 64 KB block.
   Bit 1 = 1 0xE0000 64 KB block.
   Note: Multiple bits can be set.
Alignment   Bit-mapped address alignment granularity. The first nonzero bit from the
   right is the address granularity.
LegacySegment   Segment where EfiCompatibility code will place the table or data.
LegacyOffset    Offset where EfiCompatibility code will place the table or data.
Output:
EFI_SUCCESS     The data was returned successfully.
EFI_UNSUPPORTED Mode is not supported on this platform.
EFI_NOT_FOUND   Binary image not found.
Referrals:
EFI_GET_PLATFORM_INFO_MODE


EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE in the LegacyBiosPlatform.h

Function : EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE

File: LegacyBiosPlatform.h
Description:
Returns information associated with PCI IRQ routing.
Input:
This            Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance.

RoutingTable    Pointer to the PCI IRQ routing table. This location is the $PIR table
minus the header. The contents are described by the PCI IRQ Routing Table
Specification and consist of RoutingTableEntries of EFI_LEGACY_IRQ_ROUTING_ENTRY.

RoutingTableEntries     Number of entries in the PCI IRQ routing table.

LocalPirqTable          $PIR table. It consists of EFI_LEGACY_PIRQ_TABLE_HEADER,
immediately followed by RoutingTable.

PirqTableSize           Size of $PIR table.

LocalIrqPriorityTable   A priority table of IRQs to assign to PCI. This table
consists of IrqPriorityTableEntries of EFI_LEGACY_IRQ_PRIORITY_TABLE_ENTRY
and is used to prioritize the allocation of IRQs to PCI.

IrqPriorityTableEntries Number of entries in the priority table.
Output:
EFI_SUCCESS Data was returned successfully.
Referrals:
EFI_LEGACY_BIOS_PLATFORM_PROTOCOL, EFI_LEGACY_IRQ_ROUTING_ENTRY,
EFI_LEGACY_PIRQ_TABLE_HEADER, EFI_LEGACY_IRQ_PRIORITY_TABLE_ENTRY


EFI_LEGACY_BIOS_PLATFORM_HOOKS in the LegacyBiosPlatform.h

Function : EFI_LEGACY_BIOS_PLATFORM_HOOKS

File: LegacyBiosPlatform.h
Description:
Allows platform to perform any required action after a LegacyBios
operation.
Input:
DeviceHandle    List of PCI devices in the system.
ShadowAddress   First free OpROM area, after other OpROMs have been dispatched.
Compatibility16Table    Pointer to the Compatibility16 Table.
AdditionalData          Pointer to additional data returned - mode specific.
Output:
EFI_SUCCESS     The operation performed successfully.
EFI_UNSUPPORTED Mode is not supported on this platform.
EFI_SUCCESS     Mode specific.


EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT in the LegacyBiosPlatform.h

Function : EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT

File: LegacyBiosPlatform.h
Description:
Prepares the attempt to boot a traditional OS.
Input:
This            Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance.
BbsDevicePath   EFI Device Path from BootXXXX variable.
BbsTable        A list of BBS entries of type BBS_TABLE.
LoadOptionsSize Size of LoadOption in bytes.
LoadOptions     LoadOption from BootXXXX variable.
EfiToLegacyBootTable    Pointer to EFI_TO_COMPATIBILITY16_BOOT_TABLE.
Output:
EFI_SUCCESS Ready to boot.


EFI_LEGACY_BIOS_PLATFORM_PROTOCOL in the LegacyBiosPlatform.h

Variable : EFI_LEGACY_BIOS_PLATFORM_PROTOCOL

File: LegacyBiosPlatform.h
Fields:

Name | Type | Description
GetPlatformInfo | EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO | Gets binary data or other platform information.
GetPlatformHandle | EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE | Returns a buffer of all handles matching the requested subfunction.
SmmInit | EFI_LEGACY_BIOS_PLATFORM_SMM_INIT | Loads and initializes the traditional BIOS SMM handler.
PlatformHooks | EFI_LEGACY_BIOS_PLATFORM_HOOKS | Allows platform to perform any required actions after a LegacyBios operation.
GetRoutingTable | EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE | Gets $PIR table.
TranslatePirq | EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ | Translates the given PIRQ to the final value after traversing any PCI bridges.
PrepareToBoot | EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT | Final platform function before the system attempts to boot to a traditional OS.

Description:
The EFI_LEGACY_BIOS_PLATFORM_PROTOCOL is used to abstract the
platform-specific traditional hardware and or policy decisions
from the generic EfiCompatibility code.


EFI_LEGACY_BIOS_PLATFORM_SMM_INIT in the LegacyBiosPlatform.h

Function : EFI_LEGACY_BIOS_PLATFORM_SMM_INIT

File: LegacyBiosPlatform.h
Description:
Loads and registers the Compatibility16 handler with the EFI SMM code.
Input:
This     Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance.
EfiToCompatibility16BootTable    The boot table passed to the Compatibility16.
Output:
EFI_SUCCESS         The SMM code loaded.
EFI_DEVICE_ERROR    The SMM code failed to load.


EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ in the LegacyBiosPlatform.h

Function : EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ

File: LegacyBiosPlatform.h
Description:
This function translates the given PIRQ back through all
buses, if required, and returns the true PIRQ and associated IRQ.
Input:
This        Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance.
PciBus      PCI bus number for this device.
PciDevice   PCI device number for this device.
PciFunction PCI function number for this device.
Pirq        The PIRQ. PIRQ A = 0, PIRQ B = 1, and so on.
PirqIrq     IRQ assigned to the indicated PIRQ.
Output:
EFI_SUCCESS The PIRQ was translated.


EFI_LEGACY_IRQ_PRIORITY_TABLE_ENTRY in the LegacyBiosPlatform.h

Variable : EFI_LEGACY_IRQ_PRIORITY_TABLE_ENTRY

File: LegacyBiosPlatform.h
Fields:

Name | Type | Description
Irq | UINT8 | IRQ for this entry.
Used | UINT8 | Status of this IRQ

Description:
EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE related definition
Notes:
The field Used data definitions below:
PCI_UNUSED  0x00 - This IRQ has not been assigned to PCI.
PCI_USED    0xFF - This IRQ has been assigned to PCI.
LEGACY_USED 0xFE - This IRQ has been used by an SIO legacy device and
           cannot be used by PCI.


EFI_LEGACY_IRQ_ROUTING_ENTRY in the LegacyBiosPlatform.h

Variable : EFI_LEGACY_IRQ_ROUTING_ENTRY

File: LegacyBiosPlatform.h
Fields:

Name | Type | Description
Bus | UINT8 | PCI bus of the entry.
Device | UINT8 | PCI device of this entry.
PirqEntry | EFI_LEGACY_PIRQ_ENTRY | An IBV value and IRQ mask for PIRQ pins A through D.
Slot | UINT8 | If nonzero, the slot number assigned by the board manufacturer.
Reserved | UINT8 | Reserved for future use.

Description:
EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE related definition
Referrals:
EFI_LEGACY_PIRQ_ENTRY


EFI_LEGACY_PIRQ_ENTRY in the LegacyBiosPlatform.h

Variable : EFI_LEGACY_PIRQ_ENTRY

File: LegacyBiosPlatform.h
Fields:

Name | Type | Description
Pirq | UINT8 | If nonzero, a value assigned by the IBV.
IrqMask | UINT16 | If nonzero, the IRQs that can be assigned to this device.

Description:
EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE related definition


EFI_LEGACY_PIRQ_TABLE_HEADER in the LegacyBiosPlatform.h

Variable : EFI_LEGACY_PIRQ_TABLE_HEADER

File: LegacyBiosPlatform.h
Fields:

Name | Type | Description
Signature | UINT32 | "$PIR".
MinorVersion | UINT8 | 0x00.
MajorVersion | UINT8 | 0x01 for table version 1.0.
TableSize | UINT16 | 0x20 + RoutingTableEntries * 0x10.
Bus | UINT8 | PCI interrupt router bus.
DevFunc | UINT8 | PCI interrupt router device/function.
PciOnlyIrq | UINT16 | If nonzero, bit map of IRQs reserved for PCI.
CompatibleVid | UINT16 | Vendor ID of a compatible PCI interrupt router.
CompatibleDid | UINT16 | Device ID of a compatible PCI interrupt router.
Minport | UINT32 | If nonzero, a value passed directly to the IRQ miniport's Initialize function.
Reserved | UINT8 | [11] Reserved for future usage.
Checksum | UINT8 | This byte plus the sum of all other bytes in the LocalPirqTable equal 0x00.

Description:
EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE related definition


LegacyInterrupt.c

Description:
Initialize and provide a protocol to set PIRQ values

The following functions are used in the file: LegacyInterrupt.c.

Function | Description
CallbackBootScript | Saves the PIRQ registers to Boot Script
GetLocation | Return location of device controlling the Pirqs.
GetNumberPirqs | Return number of supported Pirqs.
InitializeLegacyInterrupt | Install Legacy Interrupt Protocol.


CallbackBootScript in the LegacyInterrupt.c

Function : CallbackBootScript

File: LegacyInterrupt.c
Description:
Saves the PIRQ registers to Boot Script
Input:
IN EFI_EVENT    Event
IN VOID         *Context
Output:
None


GetLocation in the LegacyInterrupt.c

Function : GetLocation

File: LegacyInterrupt.c
Description:
Return location of device controlling the Pirqs.
Input:
IN EFI_LEGACY_INTERRUPT_PROTOCOL    *This
OUT UINT8                           *Bus
OUT UINT8                           *Device
OUT UINT8                           *Function
Output:
Status of the operation
Notes:
Here is the control flow of this function:
1. Set Bus, Device, and Function.
2. Return EFI_SUCCESS.


GetNumberPirqs in the LegacyInterrupt.c

Function : GetNumberPirqs

File: LegacyInterrupt.c
Description:
Return number of supported Pirqs.
Input:
IN EFI_LEGACY_INTERRUPT_PROTOCOL    *This
OUT UINT8                           *NumberPirqs
Output:
Status of the operation
Notes:
Here is the control flow of this function:
1. Set NumberPirqs to number of supported Pirqs.
2. Return EFI_SUCCESS;


InitializeLegacyInterrupt in the LegacyInterrupt.c

Function : InitializeLegacyInterrupt

File: LegacyInterrupt.c
Description:
Install Legacy Interrupt Protocol.
Input:
IN EFI_HANDLE        ImageHandle
IN EFI_SYSTEM_TABLE  *SystemTable
Output:
EFI_STATUS
Notes:
Here is the control flow of this function:
1. Intialize Library.
2. Locate PciRootBridgeIo. If error, return error.
3. Install Legacy Interrupt protocol.
4. Return its Status.


LegacyInterrupt.dxs

Description:
Legacy Interrupt dependency file


LegacyInterrupt.h

Description:
Legacy Interrupt driver header file


LegacyInterrupt.mak

Description:
Legacy Interrupt make file


MBIOSEQU.EQU

The following data structures are used in the file: MBIOSEQU.EQU.

Variable | Description
e820_info_struc | Structure used to define E820 information by the BIOS as well as emodules. different available memory types are "!!!! only Following types are reported to OS !!!!" ram_os(01h) - memory type available to OS ram_res(02h) - memory type reserved by system and must not be used by OS ram_acpi_data(03h)- ACPI Reclaim data area ram_acpi_nvs(04h)- ACPI NVS area "!!!! FOR BIOS INTERNAL PURPOSE ONLY !!!!" ram_dummy(0FFh) Dummy entry for BIOS internal use. "!!!! Addition for memory above 4GB !!!!" ram_os_1M(081h) - memory type available to OS the upper bit means he granularity is 1MB. While reporting we have to convert memory in no of bytes and reset the upper bit for memory type.


e820_info_struc in the MBIOSEQU.EQU

Variable : e820_info_struc

File: MBIOSEQU.EQU
Fields:

Name | Type | Description
start_addr | DWORD | 32-bit start address
size_bytes | DWORD | size in bytes
mem_type | byte | memory type

Description:
Structure used to define E820 information by the BIOS as well
as emodules.

different available memory types are
"!!!! only Following types are reported to OS !!!!"
ram_os(01h)	-	 memory type available to OS
ram_res(02h)	-	 memory type reserved by system and
             must not be used by OS
ram_acpi_data(03h)-	 ACPI Reclaim data area
ram_acpi_nvs(04h)-	 ACPI NVS area

"!!!! FOR BIOS INTERNAL PURPOSE ONLY !!!!"
ram_dummy(0FFh)		 Dummy entry for BIOS internal use.
"!!!! Addition for memory above 4GB !!!!"
ram_os_1M(081h)	-	 memory type available to OS the upper
             bit means he granularity is 1MB.
             While reporting we have to convert
             memory in no of bytes and reset the
             upper bit for memory type.


MBIOSMAC.MAC

The following functions are used in the file: MBIOSMAC.MAC.

Function | Description
mBODY_CALL_PROC_FAR |
mBODY_CALL_PROC_NEAR |
mBODY_ID_AND_TBL_CSM_ENTRY_NEAR | This macro is used to declare a function entry with an ID and a NEAR function. The EXTERN declaration is done WITHIN the 16 bit segment. This is useful if the macro is used to create a binary using EXE2BIN; if EXTRERN is declared outside the segment, then EXE2BIN will not work.
mBODY_ID_AND_TBL_ENTRY_FAR |
mBODY_ID_AND_TBL_ENTRY_NEAR |
mBODY_JMP_PROC_FAR |
mBODY_JMP_PROC_NEAR |
mBODY_TBL_ENTRY_FAR |
mBODY_TBL_ENTRY_NEAR |
mEND_PROC_FAR |
mEND_PROC_NEAR |
mEND_PROC_WITH_JMP_FAR |
mEND_PROC_WITH_JMP_NEAR |
mEND_TBL |
mEXTERN_FAR |
mEXTERN_NEAR |
mSTART_PROC_FAR |
mSTART_PROC_NEAR |
mSTART_TBL |


mBODY_CALL_PROC_FAR in the MBIOSMAC.MAC

Function : mBODY_CALL_PROC_FAR

File: MBIOSMAC.MAC
Description:
Input:


mBODY_CALL_PROC_NEAR in the MBIOSMAC.MAC

Function : mBODY_CALL_PROC_NEAR

File: MBIOSMAC.MAC
Description:
Input:


mBODY_ID_AND_TBL_CSM_ENTRY_NEAR in the MBIOSMAC.MAC

Function : mBODY_ID_AND_TBL_CSM_ENTRY_NEAR

File: MBIOSMAC.MAC
Description:
This macro is used to declare a function entry with an ID and
        a NEAR function. The EXTERN declaration is done WITHIN the 16 bit segment.
        This is useful if the macro is used to create a binary using EXE2BIN;
        if EXTRERN is declared outside the segment, then EXE2BIN will not work.
Notes:
EXTERN definition only for functions (Prog. Guide pg 253)


mBODY_ID_AND_TBL_ENTRY_FAR in the MBIOSMAC.MAC

Function : mBODY_ID_AND_TBL_ENTRY_FAR

File: MBIOSMAC.MAC
Description:
Input:


mBODY_ID_AND_TBL_ENTRY_NEAR in the MBIOSMAC.MAC

Function : mBODY_ID_AND_TBL_ENTRY_NEAR

File: MBIOSMAC.MAC
Description:
Input:


mBODY_JMP_PROC_FAR in the MBIOSMAC.MAC

Function : mBODY_JMP_PROC_FAR

File: MBIOSMAC.MAC
Description:
Input:


mBODY_JMP_PROC_NEAR in the MBIOSMAC.MAC

Function : mBODY_JMP_PROC_NEAR

File: MBIOSMAC.MAC
Description:
Input:


mBODY_TBL_ENTRY_FAR in the MBIOSMAC.MAC

Function : mBODY_TBL_ENTRY_FAR

File: MBIOSMAC.MAC
Description:
Input:


mBODY_TBL_ENTRY_NEAR in the MBIOSMAC.MAC

Function : mBODY_TBL_ENTRY_NEAR

File: MBIOSMAC.MAC
Description:
Input:


mEND_PROC_FAR in the MBIOSMAC.MAC

Function : mEND_PROC_FAR

File: MBIOSMAC.MAC
Description:
Input:


mEND_PROC_NEAR in the MBIOSMAC.MAC

Function : mEND_PROC_NEAR

File: MBIOSMAC.MAC
Description:
Input:


mEND_PROC_WITH_JMP_FAR in the MBIOSMAC.MAC

Function : mEND_PROC_WITH_JMP_FAR

File: MBIOSMAC.MAC
Description:
Input:


mEND_PROC_WITH_JMP_NEAR in the MBIOSMAC.MAC

Function : mEND_PROC_WITH_JMP_NEAR

File: MBIOSMAC.MAC
Description:
Input:


mEND_TBL in the MBIOSMAC.MAC

Function : mEND_TBL

File: MBIOSMAC.MAC
Description:
Input:


mEXTERN_FAR in the MBIOSMAC.MAC

Function : mEXTERN_FAR

File: MBIOSMAC.MAC
Description:
Input:


mEXTERN_NEAR in the MBIOSMAC.MAC

Function : mEXTERN_NEAR

File: MBIOSMAC.MAC
Description:
Input:


mSTART_PROC_FAR in the MBIOSMAC.MAC

Function : mSTART_PROC_FAR

File: MBIOSMAC.MAC
Description:
Input:


mSTART_PROC_NEAR in the MBIOSMAC.MAC

Function : mSTART_PROC_NEAR

File: MBIOSMAC.MAC
Description:
Input:


mSTART_TBL in the MBIOSMAC.MAC

Function : mSTART_TBL

File: MBIOSMAC.MAC
Description:
Input:


OemPir.dat

Description:
This file includes the PCI related tables generated by AMISDL

The following tables are used in the file: OemPir.dat.

Table | Description
ms_irq_routing_table | The information below is used for two purposes: 1. PCI IRQ routing during POST 2. Runtime dynamic IRQ routing (using Int 1A functions B10E / B10F) The IRQ routing table should contain one entry for each on-board PCI device or PCI slot. Chipset devices such as host bridges and ISA bridges do not need an entry. A generic BIOS can contain a few unused entries that BCP can use when adapting a generic BIOS to a customized BIOS for a motherboard containing on board devices such as PCI IDE, PCI SCSI, or PCI Network chips. BCP can also use a blank entry if a motherboard OEM decides to put an extra PCI slot on their board. The rth_pci_device_limit byte should be set to the total number of entries that are present including any blank entries. The rth_pci_device_count byte should be set to the number of non-blank entries (entries that are actually used in this BIOS). The rth_pci_dedicated_irqs word is a bitmask of IRQs that are dedicated to the PCI bus. (Bit 0 = IRQ 0, ..., Bit 15 = IRQ 15) In most cases this word will be set to all 0's. This word may be used in systems that implement IRQ routing with jumpers. The fields in each table entry are discussed below: - PCI Bus Number: Most boards contain only a single PCI bus, so this byte should usually be set to 0. If a board has multiple PCI busses, then this byte should be set to indicate which bus the device or slot is on. - Dev Num: This field should be set to a slot's or device's address on the PCI bus shifted left by three bits (the device number should be in bits 7:3 and bits 2:0 should be 000). - Int A Pin, Chipset Reg: This field should be set to the chipset register number that controls this slot's (or device's) Int A Pin. The value in this field is basically arbitrary, the value is returned by the function rth_pci_get_irq_reg. Slots and devices that share the same chipset interrupt signal should have the same value for this field. For example: if Slot 1's Int A pin and Slot 2's Int B pin are both connected to the same chipset interrupt signal, then the Chipset Reg value for Slot 1 Int A should match Slot 2 Int B. The core BIOS (and configuration software) need this information to know how IRQs are shared between slots. If a slot or device has nothing connected to its Int A pin, then this field should be set to 0. If a slot or device has its Int A pin hardwired directly to an IRQ, then set this field to 0Fxh (where x is 0-F for IRQ 0 - IRQ 15). This is useful if a motherboard has a PCI IDE chip that has its Int A pin hardwired to IRQ 14. - Int A Pin, Bitmap of IRQs Routeable to Pin: This field should be set to indicate which IRQs the chipset is capable of routing to the slot's (or device's) Int A pin. If the value for Chipset Reg (see above) was set to 0, then set all bits in this field to 0 also. If the value for Chipset Reg was set to 0Fxh to indicate a hardwired connection to a certain IRQ, then only one bit corresponding to that IRQ should be set in this field. - Int B,C,D Pin, Chipset Reg: These fields work exactly like the Chipset Reg field for Int A Pin (see above). - Int B,C,D Pin, Bitmap of IRQs Routeable to Pin: These fields work exactly like the corresponding field for Int A Pin (see above). - Physical Slot Number: This field should be set to the slot number of a PCI slot as it appears to the end user. Numbers like 1, 2, 3, 4 should be used. On board PCI devices such as PCI IDE chips should have this field set to 0 to indicate that the device is not a removable card that is plugged into a slot. Configuration software can use this value to translate a PCI device number (0 - 1F) to a value that is meaningful to an end user. - Reserved Byte: Always set to 0.


ms_irq_routing_table in the OemPir.dat

Table : ms_irq_routing_table

File: OemPir.dat
Segment: PCIDATA_SEG
Description:
The information below is used for two purposes:
     1. PCI IRQ routing during POST
     2. Runtime dynamic IRQ routing (using Int 1A functions
        B10E / B10F)

The IRQ routing table should contain one entry for each
on-board PCI device or PCI slot.  Chipset devices such as host
bridges and ISA bridges do not need an entry.  A generic BIOS
can contain a few unused entries that BCP can use when adapting
a generic BIOS to a customized BIOS for a motherboard containing
on board devices such as PCI IDE, PCI SCSI, or PCI Network chips.
BCP can also use a blank entry if a motherboard OEM decides to
put an extra
PCI slot on their board.

The rth_pci_device_limit byte should be set to the total number
of entries that are present including any blank entries.

The rth_pci_device_count byte should be set to the number of
non-blank entries (entries that are actually used in this BIOS).

The rth_pci_dedicated_irqs word is a bitmask of IRQs that are
dedicated to the PCI bus.  (Bit 0 = IRQ 0, ..., Bit 15 = IRQ
15)  In most cases this word will be set to all 0's.  This
word may be used in systems that implement IRQ routing with
jumpers.

The fields in each table entry are discussed below:

- PCI Bus Number: Most boards contain only a single PCI bus,
so this byte should usually be set to 0.  If a board has
multiple PCI busses, then this byte should be set to indicate
which bus the device or slot is on.

- Dev Num: This field should be set to a slot's or device's
address on the PCI bus shifted left by three bits (the device
number should be in bits 7:3 and bits 2:0 should be 000).

- Int A Pin, Chipset Reg: This field should be set to the
chipset register number that controls this slot's (or device's)
Int A Pin.  The value in this field is basically arbitrary,
the value is returned by the function rth_pci_get_irq_reg.
Slots and devices that share the same chipset interrupt signal
should have the same value for this field.
For example:
if Slot 1's Int A pin and Slot 2's Int B pin are both connected
to the same chipset interrupt signal, then the Chipset Reg
value for Slot 1 Int A should match Slot 2 Int B.  The core
BIOS (and configuration software) need this information to
know how IRQs are shared between slots.  If a slot or device
has nothing connected to its Int A pin, then this field should
be set to 0.  If a slot or device has its Int A pin hardwired
directly to an IRQ, then set this field to 0Fxh (where x is
0-F for IRQ 0 - IRQ 15).  This is useful if a motherboard has
a PCI IDE chip that has its Int A pin hardwired to IRQ 14.

- Int A Pin, Bitmap of IRQs Routeable to Pin: This field should
be set to indicate which IRQs the chipset is capable of routing
to the slot's (or device's) Int A pin. If the value for Chipset
Reg (see above) was set to 0, then set all bits in this field
to 0 also.  If the value for Chipset Reg was set to 0Fxh to
indicate a hardwired connection to a certain IRQ, then only one
bit corresponding to that IRQ should be set in this field.

- Int B,C,D Pin, Chipset Reg: These fields work exactly like
the Chipset Reg field for Int A Pin (see above).

- Int B,C,D Pin, Bitmap of IRQs Routeable to Pin: These fields
work exactly like the corresponding field for Int A Pin (see above).

- Physical Slot Number: This field should be set to the slot
number of a PCI slot as it appears to the end user.  Numbers
like 1, 2, 3, 4 should be used.  On board PCI devices such as
PCI IDE chips should have this field set to 0 to indicate that
the device is not a removable card that is plugged into a slot.
Configuration software can use this value to translate a PCI
device number (0 - 1F) to a value that is meaningful to an end
user.

- Reserved Byte: Always set to 0.
Notes:


PciInfo.asm

Description:
This file includes the PCI related tables generated by AMISDL


PciInterrupts.c

Description:
PCI Interrupt routing functions

The following functions are used in the file: PciInterrupts.c.

Function | Description
CheckP2PBridge | This function verifies whether device is P2P bridge which is not listed in BusNumXlat table, e.g. bridge is on PCI Add-on card. For this bridge we create a new entry in AddonPciBusTable which will be used for PCI IRQ routing for the devices that are located behind this bridge.
CreateAddonBusEntry | This function inserts a new entry into AddonPciBusTable.
GetIsaIrqs | Returns the ISA interrupt mask
GetXlatPciBusNumber | This function returns the PCI bus number translated according to Xlat table defined in BusNumXlat.inc. This translation file is generated by AMISDL using "BUSNUM_XLAT" output type.
InitPrt | Initialize PCI IRQ routing table
Intx2Pirq | This function is similar to TranslatePirq with the additional output of IrqMask. See TranslatePirq description.
PciIoNotifyCallback | PciIo notification callback. It serves two purposes: 1) Updates bus numbers in BusNumXlat table and in $PIR table. For this the routine uses PciIo to get PCI loaction of the handle; then it will match the found dev/fun against BusNumXlat table and fill global RootBridges data and update bus numbers in $PIR table. 2) Programs PCI IRQ register if: - device requires IRQ to be assigned (reg 3D is 1..3) - PCI bus information is updated in $PIR table (step 1 has been completed) - device is present in IRQ routing table When all these conditions are met, then IRQ is assigned to this device according to the PCI IRQ priorities; then IRQ is programmed in PCI register 3C
ProgramPciIrq | This function assigns IRQ to a PCI device. It programs PCI IRQ register if: - device requires IRQ to be assigned (reg 3D is 1..3) - PCI bus information is updated in $PIR table (step 1 has been completed) - device is present in IRQ routing table When all these conditions are met, then IRQ is assigned to this device according to the PCI IRQ priorities; then IRQ is programmed in PCI register 3C
RoutePciIrq | This routine selects the IRQ from the list of allowed PCI interrupts, picks the best interrupt number according to interrupt priority table and programs the PCI interrupt router.
UpdatePrt | This function updates $PIR table with the actual PCI bus numbers.


CheckP2PBridge in the PciInterrupts.c

Function : CheckP2PBridge

File: PciInterrupts.c
Description:
This function verifies whether device is P2P bridge which is
not listed in BusNumXlat table, e.g. bridge is on PCI Add-on card.
For this bridge we create a new entry in AddonPciBusTable which
will be used for PCI IRQ routing for the devices that are located
behind this bridge.
Input:
PciIo       pointer to EFI_PCI_IO_PROTOCOL protocol associated with this device
Bus, Dev    PCI bus location for this device
Output:
EFI_SUCCESS     Device is P2P bridge; if bus generated by this bridge is not
   described in $PIR table, then another entry in AddonPciBusTable
   is created.
EFI_NOT_FOUND   Device is not P2P bridge.


CreateAddonBusEntry in the PciInterrupts.c

Function : CreateAddonBusEntry

File: PciInterrupts.c
Description:
This function inserts a new entry into AddonPciBusTable.
Input:
Bus      - new bus number
PirqData - pointer to the new PIRQ data array
Output:
EFI_SUCCESS     Entry has been created successfully.


GetIsaIrqs in the PciInterrupts.c

Function : GetIsaIrqs

File: PciInterrupts.c
Description:
Returns the ISA interrupt mask
Input:
None
Output:
ISA interrupt mask


GetXlatPciBusNumber in the PciInterrupts.c

Function : GetXlatPciBusNumber

File: PciInterrupts.c
Description:
This function returns the PCI bus number translated according
to Xlat table defined in BusNumXlat.inc. This translation file
is generated by AMISDL using "BUSNUM_XLAT" output type.
Input:
Build time PCI bus number - 1st coulmn of the xlat table
Output:
EFI_SUCCESS, real PCI bus number - 2nd column of the xlat table
EFI_NOT_FOUND, the requested bus is not found in the xlat table
EFI_INVALID_PARAMETER, if NULL pointer is supplied on input.


InitPrt in the PciInterrupts.c

Function : InitPrt

File: PciInterrupts.c
Description:
Initialize PCI IRQ routing table
Input:
iBiosPlatform - pointer to EFI_LEGACY_BIOS_PLATFORM_PROTOCOL
Output:
PCI IRQ routing table initialization status
Notes:
1) BusNumXlat table is generated by AMISDL and requires the actual PCI bus
number fields to be updated. Actual PCI bus numbers can not be obtained at
this time due to the following:
- BusNumXlat table provides PCI dev/fun information for the PCI Host Bridge(s),
whereas PciRootBridgeIo does not give PCI dev/fun information; in case of
several PCI Root Bridges, PCI location ambiguity can not be resolved at this
time.
- PCI Dev/Fun information for PCI Host bridge(s) is not available until
PCI Bus driver installs PciIo on PCI Host Bridge devices' handles.

2) In order to match PCI Root Bridge(s) against the BusNumXlat table, we
will register callback notification function that will be called every
time PciIo protocol is installed. This would identify every PCI RootBridge's
PCI location(dev/fun), allow to match this PCI location against XlatBusNum table,
traverse through XlatBusNum table entry and update the appropriate bus number
fields in $PIR table.

3) This driver must be made dependent on PciRootBridge driver since it expects
the valid information about PCI root bridges.


Intx2Pirq in the PciInterrupts.c

Function : Intx2Pirq

File: PciInterrupts.c
Description:
This function is similar to TranslatePirq with the additional
output of IrqMask. See TranslatePirq description.
Input:
This        Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance.
PCI bus, device and function number for this device.
Pirq        The PIRQ. PIRQ A = 0, PIRQ B = 1, and so on.
PirqIrq     IRQ assigned to the indicated PIRQ.
IrqMask     Mask of IRQs that could be assigned to this register
Output:
EFI_SUCCESS     The PIRQ was translated.
EFI_NOT_FOUND   The device was not in the table.
EFI_NOT_READY   The interrupt translation table is not ready.
EFI_INVALID_PARAMETER   Wrong input


PciIoNotifyCallback in the PciInterrupts.c

Function : PciIoNotifyCallback

File: PciInterrupts.c
Description:
PciIo notification callback. It serves two purposes:
1) Updates bus numbers in BusNumXlat table and in $PIR table. For
this the routine uses PciIo to get PCI loaction of the handle;
then it will match the found dev/fun against BusNumXlat table
and fill global RootBridges data and update bus numbers in
$PIR table.
2) Programs PCI IRQ register if:
   - device requires IRQ to be assigned (reg 3D is 1..3)
   - PCI bus information is updated in $PIR table (step 1
     has been completed)
   - device is present in IRQ routing table
When all these conditions are met, then IRQ is assigned to this
device according to the PCI IRQ priorities; then IRQ is programmed
in PCI register 3C
Input:
Event - event signaled by the DXE Core upon PciIo installation
Context - event context
Output:
Nothing


ProgramPciIrq in the PciInterrupts.c

Function : ProgramPciIrq

File: PciInterrupts.c
Description:
This function assigns IRQ to a PCI device. It programs PCI
IRQ register if:
   - device requires IRQ to be assigned (reg 3D is 1..3)
   - PCI bus information is updated in $PIR table (step 1
     has been completed)
   - device is present in IRQ routing table
When all these conditions are met, then IRQ is assigned to this
device according to the PCI IRQ priorities; then IRQ is programmed
in PCI register 3C
Input:
PCI Bus, Device and Function number of the PCI device


RoutePciIrq in the PciInterrupts.c

Function : RoutePciIrq

File: PciInterrupts.c
Description:
This routine selects the IRQ from the list of allowed PCI
interrupts, picks the best interrupt number according to
interrupt priority table and programs the PCI interrupt
router.
Input:
Int - zero based index in the list of router registers for INTA, INTB,...
Irq - new interrupt number
IrqMask - IRQ bit mask, bits are set for the interrupts that are not allowed
Output:
EFI_SUCCESS if interrupt is routed
EFI_ABORTED if routing register is already programmed
Notes:
This routine can not be called externally. It is to be
called after TranslatePirq returns the Rirq register is
not programmed.


UpdatePrt in the PciInterrupts.c

Function : UpdatePrt

File: PciInterrupts.c
Description:
This function updates $PIR table with the actual PCI bus numbers.


thunk.c

Description:
32/64 bit to 16 bit code thunk implementation

The following functions are used in the file: thunk.c.

Function | Description
FarCall86 | Executes 16 bit code starting from a given address
GetPs2SimpleTextInProtocolInterface | This function returns the SimpleTextIn protocol interface
InitializeThunk | 16-bit thunk initialization routine. It calls 16 bit code to do the address fixups within 16-bit code.
Int86 | Executes BIOS interrupt routine
LoadRealModeFile | Code that loads 16-bit thunk code at a particular address
SetKbcPresenceInMiscInfo | Updates CSM16_NO_KBC_PRESENT_BIT of MiscInfoAddress accordingly by checking if the KbcEmulation is Enabled or Disabled.


FarCall86 in the thunk.c

Function : FarCall86

File: thunk.c
Description:
Executes 16 bit code starting from a given address
Input:
This        LegacyBiosProtocol instance pointer
Segment, Offset     Starting address of the 16 bit routine
Regs        CPU register values to pass to the routine
Stack       Stack pointer with the possible data to be passed to the routine
StackSize   Size of the stack passed to the routine
Output:
TRUE        Call was not executed
FALSE       Call completed. Caller will see Regs for status


GetPs2SimpleTextInProtocolInterface in the thunk.c

Function : GetPs2SimpleTextInProtocolInterface

File: thunk.c
Description:
This function returns the SimpleTextIn protocol interface


InitializeThunk in the thunk.c

Function : InitializeThunk

File: thunk.c
Description:
16-bit thunk initialization routine. It calls 16 bit code to
do the address fixups within 16-bit code.
Input:
The instance of BIOS_INFO pointer
Output:
Status of the initialization completion


Int86 in the thunk.c

Function : Int86

File: thunk.c
Description:
Executes BIOS interrupt routine
Input:
LegacyBios protocol instance pointer
BiosInt     Interrupt number
Regs        CPU register values to pass to the interrupt handler
Output:
TRUE        Interrupt was not executed
FALSE       INT completed. Caller will see Regs for status
Referrals:
EFI_IA32_REGISTER_SET


LoadRealModeFile in the thunk.c

Function : LoadRealModeFile

File: thunk.c
Description:
Code that loads 16-bit thunk code at a particular address
Input:
16-bit binary file GUID
Address to load the binary to
Output:
Status of the load operation


x86thunk.asm

Description:
x86 CPU thunk functions


x86thunk.mak

Description:
This file has a set of rules to create a binary that will
        be copied into lower memory that will give control to CSM16
        code.


Function by Segment

By Segment

The following is a list of the segments.
For a list in alphabetical order, see In Alphabetical Order.
For a list by file name, see By File Name.

  • PCIDATA_SEG


PCIDATA_SEG

The following tables are used in the segment: PCIDATA_SEG.

Table | Description
ms_irq_routing_table | The information below is used for two purposes: 1. PCI IRQ routing during POST 2. Runtime dynamic IRQ routing (using Int 1A functions B10E / B10F) The IRQ routing table should contain one entry for each on-board PCI device or PCI slot. Chipset devices such as host bridges and ISA bridges do not need an entry. A generic BIOS can contain a few unused entries that BCP can use when adapting a generic BIOS to a customized BIOS for a motherboard containing on board devices such as PCI IDE, PCI SCSI, or PCI Network chips. BCP can also use a blank entry if a motherboard OEM decides to put an extra PCI slot on their board. The rth_pci_device_limit byte should be set to the total number of entries that are present including any blank entries. The rth_pci_device_count byte should be set to the number of non-blank entries (entries that are actually used in this BIOS). The rth_pci_dedicated_irqs word is a bitmask of IRQs that are dedicated to the PCI bus. (Bit 0 = IRQ 0, ..., Bit 15 = IRQ 15) In most cases this word will be set to all 0's. This word may be used in systems that implement IRQ routing with jumpers. The fields in each table entry are discussed below: - PCI Bus Number: Most boards contain only a single PCI bus, so this byte should usually be set to 0. If a board has multiple PCI busses, then this byte should be set to indicate which bus the device or slot is on. - Dev Num: This field should be set to a slot's or device's address on the PCI bus shifted left by three bits (the device number should be in bits 7:3 and bits 2:0 should be 000). - Int A Pin, Chipset Reg: This field should be set to the chipset register number that controls this slot's (or device's) Int A Pin. The value in this field is basically arbitrary, the value is returned by the function rth_pci_get_irq_reg. Slots and devices that share the same chipset interrupt signal should have the same value for this field. For example: if Slot 1's Int A pin and Slot 2's Int B pin are both connected to the same chipset interrupt signal, then the Chipset Reg value for Slot 1 Int A should match Slot 2 Int B. The core BIOS (and configuration software) need this information to know how IRQs are shared between slots. If a slot or device has nothing connected to its Int A pin, then this field should be set to 0. If a slot or device has its Int A pin hardwired directly to an IRQ, then set this field to 0Fxh (where x is 0-F for IRQ 0 - IRQ 15). This is useful if a motherboard has a PCI IDE chip that has its Int A pin hardwired to IRQ 14. - Int A Pin, Bitmap of IRQs Routeable to Pin: This field should be set to indicate which IRQs the chipset is capable of routing to the slot's (or device's) Int A pin. If the value for Chipset Reg (see above) was set to 0, then set all bits in this field to 0 also. If the value for Chipset Reg was set to 0Fxh to indicate a hardwired connection to a certain IRQ, then only one bit corresponding to that IRQ should be set in this field. - Int B,C,D Pin, Chipset Reg: These fields work exactly like the Chipset Reg field for Int A Pin (see above). - Int B,C,D Pin, Bitmap of IRQs Routeable to Pin: These fields work exactly like the corresponding field for Int A Pin (see above). - Physical Slot Number: This field should be set to the slot number of a PCI slot as it appears to the end user. Numbers like 1, 2, 3, 4 should be used. On board PCI devices such as PCI IDE chips should have this field set to 0 to indicate that the device is not a removable card that is plugged into a slot. Configuration software can use this value to translate a PCI device number (0 - 1F) to a value that is meaningful to an end user. - Reserved Byte: Always set to 0.


Functions in Alphabetical Order

In Alphabetical Order

The following topics provide a list in alphabetical order.
For a list by file name, see By File Name.
For a list by segment, see By Segment.

  • A
  • B
  • C
  • D
  • E
  • F
  • G
  • H
  • I
  • L
  • M
  • P
  • R
  • S
  • T
  • U


Functions in Alphabetical Order

A

Function | Description
AddBbsEntry | This function adds given BBS entry to a BBS table.
AllConnectedCallback | This function is executed after all drivers have been connected.
AMICSM_GET_PCIBUS_XLAT_NUMBER | This function returns the PCI bus number translated according to Xlat table defined in BusNumXlat.inc. This translation file is generated by AMISDL using "BUSNUM_XLAT" output type.

Data Structure | Description
AMICSM_PCIBUSNUM_XLAT_PROTOCOL | This protocol defines the function that returns the PCI according to the table generated by AMISDL out of the list of PCI-PCI bridges.
AMIIRQ_HEADER | AMI IRQ Routing Table Header Structure

Built on 16:20:51 08/05/14


Functions in Alphabetical Order

B

Function | Description
BspPrepareToBoot | Prepares the attempt to boot a traditional OS.
BspUpdatePrt | This function is called from PciInterrupts.c when PCI Interrupt routing table is ready for copying to shadow memory. Do the final updates of the routing information.
BuildDevicePath | Builds device path for this device

Data Structure | Description
BBS_STATUS_FLAGS |
BBS_TABLE |
BIOS_INFO | This structure is not specified in CSM specification. It defines the useful fields for the global variable to be used throughout POST.

Built on 16:20:51 08/05/14


Functions in Alphabetical Order

C

Function | Description
CallbackBootScript | Saves the PIRQ registers to Boot Script
Check30ROM | Verifies whether the passed PCI ROM image is PCI 3.0 compatible. If so, returns the projected (runtime) size of this ROM.
CheckEnablePciSiblings | This function manages the ability of the Option ROM to control several PCI devices in the system. For example, SCSI Option ROM designed for the multi-channel SCSI adaptor usually controls all the channels even though they are different PCI functions of the same device. Likewise, NIC Option ROM may be able to control several NICs located on different PCI devices or even on different PCI buses.
CheckOemPciSiblings | This function checks whether a given PCI device can be controlled by one of the Option ROMs that have been already executed.
CheckP2PBridge | This function verifies whether device is P2P bridge which is not listed in BusNumXlat table, e.g. bridge is on PCI Add-on card. For this bridge we create a new entry in AddonPciBusTable which will be used for PCI IRQ routing for the devices that are located behind this bridge.
CheckPciRom | Tests to see if a traditional PCI ROM exists for this device
ChecksumCSM16Header | Calculates and updates a checksum field of $EFI header.
ClearFreeMemory | This function goes through system memory map and clears memory that is not allocated within the given range.
ClpExecute | This is CLP execution protocol function that is called by any driver that needs to perform device configuration using Command Line Protocol.
Compatibility16Boot | Causes the Compatibility16 BIOS to boot. The Compatibility16 code is Read/Only.
Compatibility16DispatchOprom | Allows the Compatibility16 code rehook INT13, INT18, and/or INT19 after dispatching a legacy OpROM.
Compatibility16GetTableAddress | Finds a free area in the 0xFxxxx or 0xExxxx region of the specified length and returns the address of that region.
Compatibility16InitializeYourself | Causes the Compatibility16 code to do any internal initialization required. The EFI_TO_COMPATIBILITY16_INIT_TABLE pointer is passed into this function.
Compatibility16InstallPciHandler | Enables the EfiCompatibility module to install an interrupt handler for PCI mass media devices that do not have an OpROM associated with them. An example is SATA
Compatibility16PrepareToBoot | Allows the Compatibility16 code to perform any final actions before booting. The Compatibility16 code is read/write.
Compatibility16RetrieveLastBootDevice | Allows the Compatibility16 code to get the last device from which a boot was attempted. This is stored in CMOS and is the priority number of the last attempted boot device.
Compatibility16SetKeyboardLeds | Enables the EfiCompatibility module to do any nonstandard processing of keyboard LEDs or state.
Compatibility16UpdateBbs | Causes the Compatibility16 BIOS to perform any drive number translations to match the boot sequence.
ConnectCsmSimpleIn | This function Connect the CsmSimpleIn handle
ConnectSerialIO | Connect all the serial IO that was disconnected before.
CopyLegacyRegion | This function is called when copying data to the region assigned by EFI_LEGACY_BIOS_PROTOCOL.GetLegacyRegion().
CopyLegacyTable | This fuction allocates CSM16 memory within E0000..FFFFF and then copies the passed data into allocated region.
CreateAddonBusEntry | This function inserts a new entry into AddonPciBusTable.
Csm16Configuration | This is LegacyBiosExt interface function that manages CSM16 configuration settings.
CsmBlockIoEntryPoint | This is the CsmBlockIo driver entry point. It installs gCsmBlockIoDriverBinding protocol
CsmBlockIoFlushBlocks | BlockIo protocol function that flushes data onto the device
CsmBlockIoStart | Installs BlockIoProtocol using INT13 services produced by Option ROM
CsmBlockIoStop | Installs IdeControllerProtocol
CsmBlockIoSupported | This is a binding protocol function. It checks whether or not this driver supports the given controller
CsmEntryPoint | CSM driver entry point
CsmInstallRom | Executes a given ROM using parameters pre-defined as input in EFI_DISPATCH_OPROM_TABLE data structure.
CsmSimpleInInputReadEfiKey | Reads the next keystroke from the input device and returns data in the form of AMI_EFI_KEY_DATA structure. This routine is a part of AmiEfiKeycode protocol implementation.
CsmSimpleInInputReadKey | Returns a EFI_INPUT_KEY Key if possible.
CsmSimpleInInputReadKeyEx | Reads the next keystroke from the input device and returns data in the form of EFI_KEY_DATA structure. This routine is a part of SimpleTextInEx protocol implementation.
CsmSimpleInInputRegisterKeyNotify | Register a notification function for a particular keystroke for the input device.
CsmSimpleInInputReset | In our implementation, this function does nothing.
CsmSimpleInInputResetEx | In our implementation, this function does nothing.
CsmSimpleInInputSetState | Set certain state for the input device. Paremeters: This - A pointer to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL_EX instance. KeyToggleState - Pointer to the EFI_KEY_TOGGLE_STATE to set the state for the input device.
CsmSimpleInInputUnRegisterKeyNotify | Removes the notification which was previously registered by CsmSimpleInInputRegisterKeyNotify.
CsmSimpleInToggleState | Get the Key Toggle State from the BDA Paremeters: KeyToggleState - Pointer to the EFI_KEY_TOGGLE_STATE to set the state for the input device.

Data Structure | Description
CSM_BLOCK_IO_DEV | CSM BlockIo device properies
CSM_LEGACY_DRIVE | Hard drive data structure

Built on 16:20:51 08/05/14


Functions in Alphabetical Order

D

Function | Description
DisconnectSerialIO | Disconnect the All the Serial io Handles

Data Structure | Description
DEVICE_PRODUCER_DATA_HEADER |
DEVICE_PRODUCER_FLOPPY |
DEVICE_PRODUCER_PARALLEL |
DEVICE_PRODUCER_SERIAL |

Built on 16:20:51 08/05/14


Functions in Alphabetical Order

E

Function | Description
Edd11CsmReadBlocks | Read device using EDD1.1 read function
Edd11CsmWriteBlocks | Write device using EDD1.1 write function
Edd30CsmReadBlocks | Read device using EDD3.0 read function
Edd30CsmWriteBlocks | Write device using EDD3.0 write function
EFI_LEGACY_BIOS_BOOT | Boots a traditional OS
EFI_LEGACY_BIOS_BOOT_UNCONVENTIONAL_DEVICE | This function is called when either booting to an unconventional device such as a PARTIES partition and/or executing hard disk diagnostics.
EFI_LEGACY_BIOS_CHECK_ROM | Tests to see if a traditional PCI ROM exists for this device
EFI_LEGACY_BIOS_COPY_LEGACY_REGION | This function is called when copying data to the region assigned by EFI_LEGACY_BIOS_PROTOCOL.GetLegacyRegion().
EFI_LEGACY_BIOS_FARCALL86 | This function performs a far call into Compatibility16 or traditional OpROM code at the specified Segment:Offset.
EFI_LEGACY_BIOS_GET_BBS_INFO | Presents BBS information to external agents.
EFI_LEGACY_BIOS_GET_LEGACY_REGION | This function is called when EFI needs to reserve an area in the 0xE0000 or 0xF0000 64 KB blocks.
EFI_LEGACY_BIOS_INSTALL_ROM | Shadows an OpROM
EFI_LEGACY_BIOS_INT86 | Issues a traditional software INT.
EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE | Returns a buffer of handles for the requested subfunction.
EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO | Finds the binary data or other platform information. Refer to the subfunctions for additional information.
EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE | Returns information associated with PCI IRQ routing.
EFI_LEGACY_BIOS_PLATFORM_HOOKS | Allows platform to perform any required action after a LegacyBios operation.
EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT | Prepares the attempt to boot a traditional OS.
EFI_LEGACY_BIOS_PLATFORM_SMM_INIT | Loads and registers the Compatibility16 handler with the EFI SMM code.
EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ | This function translates the given PIRQ back through all buses, if required, and returns the true PIRQ and associated IRQ.
EFI_LEGACY_BIOS_PREPARE_TO_BOOT | This function is called when booting an EFI-aware OS with legacy hard disks. The legacy hard disks may or may not be the boot device but will be accessed by the EFI-aware OS.
EFI_LEGACY_BIOS_SHADOW_ALL_LEGACY_OPROMS | Allows external agents to force loading of all legacy OpROMs. This function can be invoked before GetBbsInfo() to ensure all devices are counted.
EFI_LEGACY_BIOS_UPDATE_KEYBOARD_LED_STATUS | Updates the BDA to reflect status of the Scroll Lock, Num Lock, and Caps Lock keys and LEDs.
EnableOemPciSiblings | This function enables devices on PCI bus that can be controlled by the Option ROM associated with the given PCI device.
EnablePciDevices | This function enables all PCI devices before legacy boot
ExecuteBcv | Checks if the platform allows BCV execution; if so, executes BCV and logs the status of HW interrupt changes.

Data Structure | Description
e820_info_struc | Structure used to define E820 information by the BIOS as well as emodules. different available memory types are "!!!! only Following types are reported to OS !!!!" ram_os(01h) - memory type available to OS ram_res(02h) - memory type reserved by system and must not be used by OS ram_acpi_data(03h)- ACPI Reclaim data area ram_acpi_nvs(04h)- ACPI NVS area "!!!! FOR BIOS INTERNAL PURPOSE ONLY !!!!" ram_dummy(0FFh) Dummy entry for BIOS internal use. "!!!! Addition for memory above 4GB !!!!" ram_os_1M(081h) - memory type available to OS the upper bit means he granularity is 1MB. While reporting we have to convert memory in no of bytes and reset the upper bit for memory type.
EDD_DEVICE_ADDRESS_PACKET | Device address packet used during EDD data transfers
EFI_ADDON_PCIBUS_TABLE | Table that holds the information about the buses generated by P2P bridges that are not listed in $PIR table
EFI_BYTE_REGS | These register set definitions are used in EFI_LEGACY_BIOS_INT86 and EFI_LEGACY_BIOS_FARCALL86 fuctions.
EFI_COMPATIBILITY16_TABLE |
EFI_DISPATCH_OPROM_TABLE |
EFI_DWORD_REGS | These register set definitions are used in EFI_LEGACY_BIOS_INT86 and EFI_LEGACY_BIOS_FARCALL86 fuctions.
EFI_EFLAGS_REG | These register set definitions are used in EFI_LEGACY_BIOS_INT86 and EFI_LEGACY_BIOS_FARCALL86 fuctions.
EFI_FLAGS_REG | These register set definitions are used in EFI_LEGACY_BIOS_INT86 and EFI_LEGACY_BIOS_FARCALL86 fuctions.
EFI_GET_PLATFORM_HANDLE_MODE | Mode definitions for EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE
EFI_GET_PLATFORM_HOOK_MODE | Mode definitions for EFI_LEGACY_BIOS_PLATFORM_HOOKS
EFI_GET_PLATFORM_INFO_MODE | Mode definitions for EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO
EFI_IA32_REGISTER_SET | These register set definitions are used in EFI_LEGACY_BIOS_INT86 and EFI_LEGACY_BIOS_FARCALL86 fuctions.
EFI_LEGACY_BIOS_EXT_PROTOCOL | Extends LegacyBios protocol with the AMI implementation specific CSM funcitons and data.
EFI_LEGACY_BIOS_PLATFORM_PROTOCOL | The EFI_LEGACY_BIOS_PLATFORM_PROTOCOL is used to abstract the platform-specific traditional hardware and or policy decisions from the generic EfiCompatibility code.
EFI_LEGACY_BIOS_PROTOCOL | Abstracts the traditional BIOS from the rest of EFI. The LegacyBoot() member function allows the BDS to support booting a traditional OS. EFI thunks drivers that make EFI bindings for BIOS INT services use all the other member functions.
EFI_LEGACY_INSTALL_PCI_HANDLER |
EFI_LEGACY_IRQ_PRIORITY_TABLE_ENTRY | EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE related definition
EFI_LEGACY_IRQ_ROUTING_ENTRY | EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE related definition
EFI_LEGACY_PIRQ_ENTRY | EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE related definition
EFI_LEGACY_PIRQ_TABLE_HEADER | EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE related definition
EFI_TO_COMPATIBILITY16_BOOT_TABLE | Data structure passed to Compatibility16InitializeYourself function.
EFI_TO_COMPATIBILITY16_INIT_TABLE | Data structure passed to Compatibility16InitializeYourself function.
EFI_WORD_REGS | These register set definitions are used in EFI_LEGACY_BIOS_INT86 and EFI_LEGACY_BIOS_FARCALL86 fuctions.

Built on 16:20:51 08/05/14


Functions in Alphabetical Order

F

Function | Description
FarCall86 | Executes 16 bit code starting from a given address
FetchBbsBootDevices | Check PCI ROM for PnP structures and inserts BCV/BEV devices into BBS table.
FindAnyVga | Returns the first VGA controller handle from PciIo device list.
FindCompatibility16Table | This function identifies the validity of CSM16 binary by searching "$EFI" and verifying table checksum and returs the location of $EFI table
FindEmbeddedRom | This function searches for ROM within the data previously loaded from the main FV image and returns its pointer and size.

Built on 16:20:51 08/05/14


Functions in Alphabetical Order

G

Function | Description
Get16BitFuncAddress | LegacyBiosExt API, returns the entry point of 16-bit function which was added using "CsmOem16Functions" eLink
GetBbsInfo | Presents BBS information to external agents.
GetBbsTable | This function returns a pointer to the BBS table and the number of entries.
GetComPortResource | Returns COM port base address and interrupt
GetCustomPciIrqMask | This function is called from PciInterrupts.ProgramPciIrq() before programming PCI register 3C. This function is given the PciIo of the device and a list of possible IRQ choices for this device. The possible IRQs are given in a form of UINT16 IRQ mask, where 1 is a masked IRQ level. This function can modify this list and return EFI_SUCCESS. A caller then will AND the existing mask with the one returned by this function. Note that this way the existing list can only be shrunk, not extended.
GetDriveHandle | This function searches for the IDE mass storage device handle in the list of handles and returns the one that matches with the given IdentifyDrive information.
GetDriveParameters | Executes INT13 function 48 to get hard disk parameters
GetEmbeddedRom | This function calls FindEmbeddedRom to search for onboard Option ROM.
GetGateA20Information | This function is called from LegacyBios entry point and it returns the board specific information related to the way of controlling GateA20. Two different aspects of GateA20 control can be returned by this function: 1) Line GA20 can be activated/deactivated through KBC's GPIO (command D1), or through Port92 (Bit2). 2) Deactivation of GA20 is be desirable at all, any CSM16 function related to deactivation will be skipped.
GetInt13DeviceParameters | Get hard drive parameters using INT13 function 8
GetInt13Extensions | Executes INT13 func 41 to check EDD extensions
GetIsaIrqs | Returns the ISA interrupt mask
GetLegacyRegion | This function is called when EFI needs to reserve an area in the 0xE0000 or 0xF0000 64 KB blocks.
GetLocation | Return location of device controlling the Pirqs.
GetLptResource | Returns LPT base address and interrupt
GetNmiInformation | This function is called from LegacyBios entry point and it returns the board specific information related to NMI.
GetNumberPirqs | Return number of supported Pirqs.
GetOemIntData | Gets the OEM INT custom data
GetOpromVideoSwitchingMode | This function is called from LEGACY_BIOS.InstallPciRom() before and after OpROM execution. It allows OEM override the default video mode switching policy during OpROM execution.
GetPlatformEmbeddedRom | This function is called from FindEmbeddedRom and allows OEM to have a custom code that looks for a binary. By default all addon ROMs are packed as BINFILE section. This function may be needed if binary is packed in a way that is different from default (for example it can be FFS file, etc.).
GetPlatformHandle | Returns a buffer of handles for the requested subfunction.
GetPlatformInfo | Finds the binary data or other platform information. Refer to the subfunctions for additional information.
GetPlatformPciEmbeddedRom | This function is called from CheckPciRom and allows OEM to have a custom code that looks for a binary.
GetPs2SimpleTextInProtocolInterface | This function returns the SimpleTextIn protocol interface
GetRoutingTable | Returns information associated with PCI IRQ routing.
GetShadowRamAddress | Returns the available shadow RAM address out of the given range.
GetSioDeviceStatus | Returns present/absent status of SIO device.
GetXlatPciBusNumber | This function returns the PCI bus number translated according to Xlat table defined in BusNumXlat.inc. This translation file is generated by AMISDL using "BUSNUM_XLAT" output type.

Built on 16:20:51 08/05/14


Functions in Alphabetical Order

H

Function | Description
HaltApsBeforeBoot | This call is halting APs before giving control to Legacy OS.

Data Structure | Description
HDD_INFO |

Built on 16:20:51 08/05/14


Functions in Alphabetical Order

I

Function | Description
InitBlockIo | Initializes BlockIo protocol for a given device
InitClp | This function is initializing and installing the CLP protocol.
InitCompatibility16 | This function reads Compatibility16 binary into the pre-defined shadow memory region, executes InitializeYourself function and initializes Thunk data structures.
InitCsmBoard | CSM BSP driver entry point, it will instantinate LEGACY_BIOS_PLATFORM_PTOTOCOL interface
InitCsmSimpleIn | CSM SimpleIn driver entry point,
InitCsmStrings | This function is eLink'ed with the chain executed right before the Setup.
InitializeCsm16MiscInfo | This function initialize AMI specific CSM16 data: POST/RT variables in CSM16 based on Setup settings, OEM porting overridesIt will be skipped in case of non-AMI CSM16 binary.
InitializeLegacyInterrupt | Install Legacy Interrupt Protocol.
InitializeLegacyMemory | This function initializes CSM related memory regions
InitializeOem16 | Initialize OEM interrupts and update CSM16 OEM int pointer
InitializeOemInt | Initialize OEM interrupts and update CSM16 OEM int pointer
InitializePortingHooks | Initialize the data areas for Chipset/OEM 16 bit and 32 bit routines and interrupt handlers.
InitializeThunk | 16-bit thunk initialization routine. It calls 16 bit code to do the address fixups within 16-bit code.
InitPrt | Initialize PCI IRQ routing table
InsertBbsEntryAt | This function is an extension of AddBbsEntry function; it allows to add a BBS_ENTRY at a particular location or add a new entry and return its new location.
InstallIsaRom | Executes ISA Option ROM
InstallPciRom | Shadows an OpROM
Int86 | Executes BIOS interrupt routine
Intx2Pirq | This function is similar to TranslatePirq with the additional output of IrqMask. See TranslatePirq description.
IsAMICSM16 | This function checks whether the CSM16 image is made by AMI.
IsSioDevicePluggedIn | Returns connect status of certain SIO device.
IsValidLegacyPciOpROM | Tests PCI ROM for Legacy PCI ROM compatibility.

Built on 16:20:51 08/05/14


Functions in Alphabetical Order

L

Function | Description
LegacyBoot | Boots a traditional OS
LegacyCsmReadBlocks | Read device using INT13 function 2
LegacyCsmWriteBlocks | Write device using INT13 function 3
LoadRealModeFile | Code that loads 16-bit thunk code at a particular address
LockShadow | Locks the shadow region(s).

Data Structure | Description
LEGACY_DEVICE_FLAGS |

Built on 16:20:51 08/05/14


Functions in Alphabetical Order

M

Function | Description
mBODY_CALL_PROC_FAR |
mBODY_CALL_PROC_NEAR |
mBODY_ID_AND_TBL_CSM_ENTRY_NEAR | This macro is used to declare a function entry with an ID and a NEAR function. The EXTERN declaration is done WITHIN the 16 bit segment. This is useful if the macro is used to create a binary using EXE2BIN; if EXTRERN is declared outside the segment, then EXE2BIN will not work.
mBODY_ID_AND_TBL_ENTRY_FAR |
mBODY_ID_AND_TBL_ENTRY_NEAR |
mBODY_JMP_PROC_FAR |
mBODY_JMP_PROC_NEAR |
mBODY_TBL_ENTRY_FAR |
mBODY_TBL_ENTRY_NEAR |
mEND_PROC_FAR |
mEND_PROC_NEAR |
mEND_PROC_WITH_JMP_FAR |
mEND_PROC_WITH_JMP_NEAR |
mEND_TBL |
mEXTERN_FAR |
mEXTERN_NEAR |
mSTART_PROC_FAR |
mSTART_PROC_NEAR |
mSTART_TBL |

Table | Description
ms_irq_routing_table | The information below is used for two purposes: 1. PCI IRQ routing during POST 2. Runtime dynamic IRQ routing (using Int 1A functions B10E / B10F) The IRQ routing table should contain one entry for each on-board PCI device or PCI slot. Chipset devices such as host bridges and ISA bridges do not need an entry. A generic BIOS can contain a few unused entries that BCP can use when adapting a generic BIOS to a customized BIOS for a motherboard containing on board devices such as PCI IDE, PCI SCSI, or PCI Network chips. BCP can also use a blank entry if a motherboard OEM decides to put an extra PCI slot on their board. The rth_pci_device_limit byte should be set to the total number of entries that are present including any blank entries. The rth_pci_device_count byte should be set to the number of non-blank entries (entries that are actually used in this BIOS). The rth_pci_dedicated_irqs word is a bitmask of IRQs that are dedicated to the PCI bus. (Bit 0 = IRQ 0, ..., Bit 15 = IRQ 15) In most cases this word will be set to all 0's. This word may be used in systems that implement IRQ routing with jumpers. The fields in each table entry are discussed below: - PCI Bus Number: Most boards contain only a single PCI bus, so this byte should usually be set to 0. If a board has multiple PCI busses, then this byte should be set to indicate which bus the device or slot is on. - Dev Num: This field should be set to a slot's or device's address on the PCI bus shifted left by three bits (the device number should be in bits 7:3 and bits 2:0 should be 000). - Int A Pin, Chipset Reg: This field should be set to the chipset register number that controls this slot's (or device's) Int A Pin. The value in this field is basically arbitrary, the value is returned by the function rth_pci_get_irq_reg. Slots and devices that share the same chipset interrupt signal should have the same value for this field. For example: if Slot 1's Int A pin and Slot 2's Int B pin are both connected to the same chipset interrupt signal, then the Chipset Reg value for Slot 1 Int A should match Slot 2 Int B. The core BIOS (and configuration software) need this information to know how IRQs are shared between slots. If a slot or device has nothing connected to its Int A pin, then this field should be set to 0. If a slot or device has its Int A pin hardwired directly to an IRQ, then set this field to 0Fxh (where x is 0-F for IRQ 0 - IRQ 15). This is useful if a motherboard has a PCI IDE chip that has its Int A pin hardwired to IRQ 14. - Int A Pin, Bitmap of IRQs Routeable to Pin: This field should be set to indicate which IRQs the chipset is capable of routing to the slot's (or device's) Int A pin. If the value for Chipset Reg (see above) was set to 0, then set all bits in this field to 0 also. If the value for Chipset Reg was set to 0Fxh to indicate a hardwired connection to a certain IRQ, then only one bit corresponding to that IRQ should be set in this field. - Int B,C,D Pin, Chipset Reg: These fields work exactly like the Chipset Reg field for Int A Pin (see above). - Int B,C,D Pin, Bitmap of IRQs Routeable to Pin: These fields work exactly like the corresponding field for Int A Pin (see above). - Physical Slot Number: This field should be set to the slot number of a PCI slot as it appears to the end user. Numbers like 1, 2, 3, 4 should be used. On board PCI devices such as PCI IDE chips should have this field set to 0 to indicate that the device is not a removable card that is plugged into a slot. Configuration software can use this value to translate a PCI device number (0 - 1F) to a value that is meaningful to an end user. - Reserved Byte: Always set to 0.


Functions in Alphabetical Order

P

Function | Description
PatchHwInterrupt | Saves HW interrupt vector used by this device
PciIoNotifyCallback | PciIo notification callback. It serves two purposes: 1) Updates bus numbers in BusNumXlat table and in $PIR table. For this the routine uses PciIo to get PCI loaction of the handle; then it will match the found dev/fun against BusNumXlat table and fill global RootBridges data and update bus numbers in $PIR table. 2) Programs PCI IRQ register if: - device requires IRQ to be assigned (reg 3D is 1..3) - PCI bus information is updated in $PIR table (step 1 has been completed) - device is present in IRQ routing table When all these conditions are met, then IRQ is assigned to this device according to the PCI IRQ priorities; then IRQ is programmed in PCI register 3C
PciRomAlreadyExecuted | Reports whether OpROM for a given PciIo already executed.
PlatformHooks | Allows platform to perform any required action after a LegacyBios operation.
PrepareToBoot | This function is called when booting an EFI-aware OS with legacy hard disks. The legacy hard disks may or may not be the boot device but will be accessed by the EFI-aware OS.
ProgramPciIrq | This function assigns IRQ to a PCI device. It programs PCI IRQ register if: - device requires IRQ to be assigned (reg 3D is 1..3) - PCI bus information is updated in $PIR table (step 1 has been completed) - device is present in IRQ routing table When all these conditions are met, then IRQ is assigned to this device according to the PCI IRQ priorities; then IRQ is programmed in PCI register 3C


Functions in Alphabetical Order

R

Function | Description
RemoveBbsEntryAt | This function removes BBS entry from BBS table.
RemoveDecodingForShadow | This function will clear the R/W attribute for the region from DecodeAddr to gMaxOpRomAddress; this is needed for some OS drivers to be loaded properly (Win PCMCIA driver).
RestoreHwInterrupt | Restores HW interrupt saved by PatchHwInterrupt
RoutePciIrq | This routine selects the IRQ from the list of allowed PCI interrupts, picks the best interrupt number according to interrupt priority table and programs the PCI interrupt router.


Functions in Alphabetical Order

S

Function | Description
SaveOprom | This routine saves Oprom that was just executed to the next gSavedOprom data field; gSavedOprom is incremented.
SetINT0F_E0000 | Change INT0F Vector To E000 Segment
SetKbcPresenceInMiscInfo | Updates CSM16_NO_KBC_PRESENT_BIT of MiscInfoAddress accordingly by checking if the KbcEmulation is Enabled or Disabled.
ShadowAllLegacyOproms | Allows external agents to force loading of all legacy OpROMs. This function can be invoked before GetBbsInfo() to ensure all devices are counted.
ShadowServiceRoms | Executes Option ROMs that are not associated with PCI device, e.g. PXE base code image.
SignalProtocolEvent | Internal function that installs/uninstall protocol with a specified GUID and NULL interface. Such protocols can be used as event signaling mechanism.
SmmInit | Loads and registers the Compatibility16 handler with the EFI SMM code. In also updates EFI_TO_COMPATIBILITY16_BOOT_TABLE.SmmTable.

Data Structure | Description
SMM_ATTRIBUTES |
SMM_ENTRY |
SMM_FUNCTION |
SMM_TABLE | SMM Table definitions; SMM table has a header that provides the number of entries. Following the header is a variable length amount of data.


Functions in Alphabetical Order

T

Function | Description
TranslatePirq | This function translates the given PIRQ back through all buses, if required, and returns the true PIRQ and associated IRQ.


Functions in Alphabetical Order

U

Function | Description
UnlockShadow | Opens the shadow region(s) for writing.
UpdateCsm16Configuration | This function updates Csm16BootTable and BDA. It can be called multiple times during POST as the new hardware is discovered and configured.
UpdateEbdaMap | This routine is called after every OpROM (BBS or non-BBS) is executed. It updates the locations of EBDA in SAVED_PCI_ROM.ebdaAddr fields after OpROM expands EBDA.
UpdateKeyboardLedStatus | Updates the BDA to reflect status of the Scroll Lock, Num Lock, and Caps Lock keys and LEDs.
UpdatePciLastBus | In a multiple root-complex platform, the CSM16 routine "rth_pci_get_last_bus" needs to return the correct bus number. For example, in a 2 IOH system, the base bus #s for IOH0 can be 0 and IOH1 can be 80h. It should not be assumned there is only one root-complex and return the correct bus # (max bus of first IOH), for the card is plugged into the 2nd IOH. This function creates a callback notification event for EfiPciRootBridgeProtocol GUID installation. The callback function then will process the list of root bridges and will update the LastPciBus field of EFI_COMPATIBILITY16_TABLE accordingly.
UpdatePciLastBusCallback | This callback function then will process the list of root bridges and will update the LastPciBus field of EFI_COMPATIBILITY16_TABLE accordingly.
UpdatePrt | This function updates $PIR table with the actual PCI bus numbers.

Data Structure | Description
UD_TABLE |
UDC_ATTRIBUTES |


General Information


Copyright

American Megatrends, Inc.
5555 Oakbrook Parkway
Suite 200
Norcross, GA 30093 (USA)

Copyright (c) 1999-2011 American Megatrends, Inc. All Rights Reserved.

This publication contains proprietary information, which is protected by copyright. No part of this publication may be reproduced, transcribed, stored in a retrieval system, translated into any language or computer language, or transmitted in any form whatsoever without the prior written consent of the publisher, American Megatrends, Inc.

American Megatrends, Inc. retains the right to update, change, modify this publication at any time, without notice.

For Additional Information

Call American Megatrends BIOS Sales Department at 1-800-828-9264 for additional information.

Limitations of Liability

In no event shall American Megatrends be held liable for any loss, expenses, or damages of any kind whatsoever, whether direct, indirect, incidental, or consequential, arising from the design or use of this product or the support materials provided with the product.

Limited Warranty

No warranties are made, either expressed or implied, with regard to the contents of this work, its merchantability, or fitness for a particular use. American Megatrends assumes no responsibility for errors and omissions or for the uses made of the material contained herein or reader decisions based on such use.

Trademark and Copyright Acknowledgments

All product names used in this publication are for identification purposes only and are trademarks of their respective Companies.


HaltApsBeforeBoot in the CSM.c

Function : HaltApsBeforeBoot

File: CSM.c
Description:
This call is halting APs before giving control to Legacy OS.
Input:
None


InitializeCsm16MiscInfo in the CSM.c

Function : InitializeCsm16MiscInfo

File: CSM.c
Description:
This function initialize AMI specific CSM16 data: POST/RT variables in
CSM16 based on Setup settings, OEM porting overridesIt will be skipped
in case of non-AMI CSM16 binary.
Notes:
Shadow regions are unlocked.


UpdatePciLastBus in the CSM.c

Function : UpdatePciLastBus

File: CSM.c
Description:
In a multiple root-complex platform, the CSM16 routine "rth_pci_get_last_bus"
needs to return the correct bus number. For example, in a 2 IOH system, the
base bus #s for IOH0 can be 0 and IOH1 can be 80h. It should not be assumned
there is only one root-complex and return the correct bus # (max bus of first IOH),
for the card is plugged into the 2nd IOH.

This function creates a callback notification event for EfiPciRootBridgeProtocol GUID
installation. The callback function then will process the list of root bridges and
will update the LastPciBus field of EFI_COMPATIBILITY16_TABLE accordingly.


CheckOemPciSiblings in the CsmBsp.c

Function : CheckOemPciSiblings

File: CsmBsp.c
Description:
This function checks whether a given PCI device can be controlled by one of
the Option ROMs that have been already executed.
Input:
PciIo           PCI I/O protocol of the device whose Option ROM is about to
   execute
ExecutedRom     Pointer to the last element of EXECUTED_PCI_ROM structure
Output:
EFI_UNSUPPORTED Function is not implemented, use the default
   device match criteria
EFI_SUCCESS     Device can be managed by one of the loaded ROMs


EnableOemPciSiblings in the CsmBsp.c

Function : EnableOemPciSiblings

File: CsmBsp.c
Description:
This function enables devices on PCI bus that can be controlled by the Option
ROM associated with the given PCI device.
Input:
PciIo   PCI I/O protocol of the device whose Option ROM is about to execute
Output:
EFI_UNSUPPORTED     Function is not implemented
EFI_SUCCESS         Function has enabled all related devices
Notes:
If OEM code can not decide for ALL related devices, it may enable only devices
it knows about, and still return EFI_UNSUPPORTED. In this case CSM Core will
finish the job.


GetCustomPciIrqMask in the CsmBsp.c

Function : GetCustomPciIrqMask

File: CsmBsp.c
Description:
This function is called from PciInterrupts.ProgramPciIrq()
before programming PCI register 3C. This function is given
the PciIo of the device and a list of possible IRQ choices
for this device.
The possible IRQs are given in a form of UINT16 IRQ mask,
where 1 is a masked IRQ level.
This function can modify this list and return EFI_SUCCESS.
A caller then will AND the existing mask with the one returned
by this function. Note that this way the existing list can
only be shrunk, not extended.
Input:

PciIo       PciIo protocol of the device

IrqMask     The current bit mask of IRQ levels available for this device
Output:

ModifiedIrqMask     The value that a caller will use to OR with the existing
       mask.

EFI_SUCCESS         Function is returning a valid ModifiedIrqMask

EFI_UNSUPPORTED     Function is not ported for this PciIo, value returned
       in ModifiedIrqMask will be ignored.


GetGateA20Information in the CsmBsp.c

Function : GetGateA20Information

File: CsmBsp.c
Description:
This function is called from LegacyBios entry point and it
returns the board specific information related to the way of
controlling GateA20. Two different aspects of GateA20 control
can be returned by this function:
1) Line GA20 can be activated/deactivated through KBC's GPIO
  (command D1), or through Port92 (Bit2).
2) Deactivation of GA20 is be desirable at all, any CSM16
  function related to deactivation will be skipped.
Input:
None
Output:
GateA20Info:
   BIT0    0 - GA20 controlled through KBC
           1 - GA20 controlled through Port92
   BIT1    0 - Do not skip GA20 deactivation
           1 - Skip GA20 deactivation
EFI_SUCCESS         GateA20Info has valid bits 0 and 1

EFI_UNSUPPORTED     Function is not supported, GateA20Info information
       is invalid; CSM core will use the default GA20 policy.

Note:       Skipping GA20 deactivation is needed when APs are running above
1MB; if GA20 is inactive, then any access >1MB may be invalid.
At the same time, keeping GA20 active all the time may fail the
applications that test GA20 enable/disable functionality. It may
also affect some applications that rely on GA20 being inactive
after legacy boot.


GetNmiInformation in the CsmBsp.c

Function : GetNmiInformation

File: CsmBsp.c
Description:
This function is called from LegacyBios entry point and it returns the board
specific information related to NMI.
Input:
None
Output:
NMI information:
BIT0    0 - NMI should be kept disabled
1 - enable NMI
EFI_SUCCESS         GateA20Info has valid bits 0 and 1
EFI_UNSUPPORTED     Function is not supported, NMI information is invalid; CSM
       will use the default NMI policy.


GetOpromVideoSwitchingMode in the CsmBsp.c

Function : GetOpromVideoSwitchingMode

File: CsmBsp.c
Description:
This function is called from LEGACY_BIOS.InstallPciRom()
before and after OpROM execution. It allows OEM override the
default video mode switching policy during OpROM execution.
Input:

PciIo               PciIo protocol of the device associated with the OpROM;
       This is an optional field, if NULL then it is ignored.

TextSwitchingMode   The current text switching mode. Possible values are:
           0 - switching to text mode is needed;
           1 - switching is needed, restoration is not;
           2 - neither switching nor restoration is needed.
Output:

SetTxtSwitchingMode The mode that will be used for this OpROM. The valid
       values are 0, 1, and 2. The meaning is the same as
       TextSwitchingMode (above).

EFI_SUCCESS         The value of SetTxtSwithcingMode is updated according
       to the platform policy and will be used for video mode
       switching for the given PciIo's Option ROM.

EFI_UNSUPPORTED     The value of SetTxtSwitchingMode is not valid.
Notes:
This function can change the policy of video swithcing for selected
Option ROMs by looking up the PCI VID/DID. It also can change this
policy for all OpROMs.

Use SetTxtSwitchingMode value to adjust the platform policy. For
example, value equal to 1 probably indicates the end of the boot
process, when system is already in text mode and switching back
is not desired. In this case platform may choose not to interfere
with the default policy. This can be done by either returning
EFI_UNSUPPORTED or returning EFI_SUCCESS with SetTxtSwitchingMode
equal to TextSwitchingMode.

Returning EFI_SUCCESS must be carefully considered. If function
returns EFI_SUCCESS, please make sure SetTxtSwitchingMode is
assigned the valid values: 0, 1, 2 and 3. If the wrong value is
assigned, then video switching policy will fail.

The default implementation simply returns EFI_SUCCESS with the
SetTxtSwitchingMode set to the value passed in TextSwitchingMode.


GetPlatformEmbeddedRom in the CsmBsp.c

Function : GetPlatformEmbeddedRom

File: CsmBsp.c
Description:
This function is called from FindEmbeddedRom and allows OEM to have a custom
code that looks for a binary. By default all addon ROMs are packed as BINFILE
section. This function may be needed if binary is packed in a way that is
different from default (for example it can be FFS file, etc.).
Input:
Same as in FindEmbeddedRom function.
Output:
EFI_NOT_FOUND   No ROM found, or function is not implemented.
EFI_SUCCESS     ROM is found, output is the same as in FindEmbeddedRom
   function.


GetPlatformPciEmbeddedRom in the CsmBsp.c

Function : GetPlatformPciEmbeddedRom

File: CsmBsp.c
Description:
This function is called from CheckPciRom and allows OEM to
have a custom code that looks for a binary.
Input:
Same as in FindEmbeddedRom function.
Output:
EFI_UNSUPPORTED - Function is not implemented
EFI_NOT_FOUND   - No ROM found
EFI_SUCCESS     - ROM is found, output is the same as
                 in FindEmbeddedRom function.


UpdatePciLastBusCallback in the CsmHwInfo.c

Function : UpdatePciLastBusCallback

File: CsmHwInfo.c
Description:
This callback function then will process the list of root bridges
and will update the LastPciBus field of EFI_COMPATIBILITY16_TABLE
accordingly.


RemoveBbsEntryAt in the CsmLib.c

Function : RemoveBbsEntryAt

File: CsmLib.c
Description:
This function removes BBS entry from BBS table.
Input:
This        - Instance of LegacyBiosExt protocol.
EntryNumber - Entry index to be removed.
Output:
EFI_INVALID_PARAMETER - EntryNumber exceeds the current table.
EFI_NOT_FOUND - Entry does not exist.
EFI_SUCCESS - Entry has been successfully removed.


RemoveDecodingForShadow in the CsmLib.c

Function : RemoveDecodingForShadow

File: CsmLib.c
Description:
This function will clear the R/W attribute for the region
from DecodeAddr to gMaxOpRomAddress; this is needed for
some OS drivers to be loaded properly (Win PCMCIA driver).
Input:
DecodeAddr    - Starting address of the area to remove the decoding
Output:
Status of the decoding operation.
Notes:


SignalProtocolEvent in the CsmLib.c

Function : SignalProtocolEvent

File: CsmLib.c
Description:
Internal function that installs/uninstall protocol
        with a specified GUID and NULL interface.
Such protocols can be used as event signaling mechanism.
Input:
ProtocolGuid Pointer to the protocol GUID
Output:
None


CheckEnablePciSiblings in the CsmOpROM.c

Function : CheckEnablePciSiblings

File: CsmOpROM.c
Description:
This function manages the ability of the Option ROM to control several PCI
devices in the system.
For example, SCSI Option ROM designed for the multi-channel SCSI adaptor
usually controls all the channels even though they are different PCI
functions of the same device. Likewise, NIC Option ROM may be able to control
several NICs located on different PCI devices or even on different PCI buses.
Input:
PciIo       - PCI I/O protocol of the PCI device whose Option ROM is about
 to be executed
PciCfgData  - byte array of device's PCI configuration space (registers 0..3f)
Output:
EFI_SUCCESS         - Option ROM is okay execute
EFI_ALREADY_STARTED - Option ROM must be skipped
Notes:
Function code flow:
1) Execute OEM porting hook to see if OEM overrides the default device enable
policy. If so, return EFI_ALREADY_STARTED.
2) Enable all function of the given PciIo.
3) Enable all PCI devices with the same VID/DID as in given PciIo.
4) Return EFI_SUCCESS indicating "greenlight" for Option ROM execution.


ClpExecute in the CsmOpROM.c

Function : ClpExecute

File: CsmOpROM.c
Description:
This is CLP execution protocol function that is called by any driver that
needs to perform device configuration using Command Line Protocol.
Input:
PciIo               Command Line Protocol instance pointer
CmdInputLine        Pointer to a null-terminated input string
CmdResponseBuffer   Pointer to command output buffer
CmdStatus           CLP command execution status
Output:
EFI_SUCCESS         Execution succeeded, result is in CmdStatus
Any other value     Error status of the execution


CsmInstallRom in the CsmOpROM.c

Function : CsmInstallRom

File: CsmOpROM.c
Description:
Executes a given ROM using parameters pre-defined as input in
EFI_DISPATCH_OPROM_TABLE data structure.
Input:
CoreBiosInfo    The pointer to the BIOS_INFO variable
PciIo           PCI IO handle, NULL for non-PCI ROMs
Csm16DOT        ROM execution input parameters
NextRomAddress  The location in the shadow that will have the run-time image
   of the ROM
IsVga           Video ROM indicator
Output:
NewRomSize          Run-time size of the ROM, in Bytes
ProcessBootDevices  Indicator of the new bootable devices found during
       ROM execution


ExecuteBcv in the CsmOpROM.c

Function : ExecuteBcv

File: CsmOpROM.c
Description:
Checks if the platform allows BCV execution; if so, executes BCV and logs
the status of HW interrupt changes.


GetShadowRamAddress in the CsmOpROM.c

Function : GetShadowRamAddress

File: CsmOpROM.c
Description:
Returns the available shadow RAM address out of the given range.
Input:
UINT32    *AddrMin      Min address
UINT32    AddrMax       Max address
UINT32    Size          Range size, in Bytes
UINT32    Alignment     Range alignment
Output:
EFI_SUCCESS             AddrMin variable contains the available address
EFI_OUT_OF_RESOURCES    The requested memory range is not available in
               the shadow RAM
Notes:
This function does not reserve or allocate memory in the shadow RAM


InitClp in the CsmOpROM.c

Function : InitClp

File: CsmOpROM.c
Description:
This function is initializing and installing the CLP protocol.
Input:
Handle      PCI device handle
Csm16DOT    Option ROM related data structure
Output:
EFI_SUCCESS         CLP protocol successfully installed
EFI_UNSUPPORTED     CLP protocol can not be installed on this device


InstallIsaRom in the CsmOpROM.c

Function : InstallIsaRom

File: CsmOpROM.c
Description:
Executes ISA Option ROM
Input:
This        Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
RomAddress  Location of the Option ROM
Output:
EFI_SUCCESS             ROM was successfully executed
EFI_OUT_OF_RESOURCES    Shadow RAM full, ROM was not executed


PciRomAlreadyExecuted in the CsmOpROM.c

Function : PciRomAlreadyExecuted

File: CsmOpROM.c
Description:
Reports whether OpROM for a given PciIo already executed.


CsmSimpleIn.c

Description:
Implements the SimpleTextIn protocol for the Csm.

The following functions are used in the file: CsmSimpleIn.c.

Function | Description
ConnectCsmSimpleIn | This function Connect the CsmSimpleIn handle
CsmSimpleInInputReadEfiKey | Reads the next keystroke from the input device and returns data in the form of AMI_EFI_KEY_DATA structure. This routine is a part of AmiEfiKeycode protocol implementation.
CsmSimpleInInputReadKey | Returns a EFI_INPUT_KEY Key if possible.
CsmSimpleInInputReadKeyEx | Reads the next keystroke from the input device and returns data in the form of EFI_KEY_DATA structure. This routine is a part of SimpleTextInEx protocol implementation.
CsmSimpleInInputRegisterKeyNotify | Register a notification function for a particular keystroke for the input device.
CsmSimpleInInputReset | In our implementation, this function does nothing.
CsmSimpleInInputResetEx | In our implementation, this function does nothing.
CsmSimpleInInputSetState | Set certain state for the input device. Paremeters: This - A pointer to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL_EX instance. KeyToggleState - Pointer to the EFI_KEY_TOGGLE_STATE to set the state for the input device.
CsmSimpleInInputUnRegisterKeyNotify | Removes the notification which was previously registered by CsmSimpleInInputRegisterKeyNotify.
CsmSimpleInToggleState | Get the Key Toggle State from the BDA Paremeters: KeyToggleState - Pointer to the EFI_KEY_TOGGLE_STATE to set the state for the input device.
InitCsmSimpleIn | CSM SimpleIn driver entry point,


ConnectCsmSimpleIn in the CsmSimpleIn.c

Function : ConnectCsmSimpleIn

File: CsmSimpleIn.c
Description:
This function Connect the CsmSimpleIn handle
Input:
IN EFI_EVENT Event - signalled event
IN VOID *Context - pointer to event context
Output:
VOID


CsmSimpleInInputReadEfiKey in the CsmSimpleIn.c

Function : CsmSimpleInInputReadEfiKey

File: CsmSimpleIn.c
Description:
Reads the next keystroke from the input device and
   returns data in the form of AMI_EFI_KEY_DATA structure.
   This routine is a part of AmiEfiKeycode protocol
   implementation.


CsmSimpleInInputReadKey in the CsmSimpleIn.c

Function : CsmSimpleInInputReadKey

File: CsmSimpleIn.c
Description:
Returns a EFI_INPUT_KEY Key if possible.
Input:
IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL   *This
OUT EFI_INPUT_KEY                   *Key
Output:
EFI_STATUS


CsmSimpleInInputReadKeyEx in the CsmSimpleIn.c

Function : CsmSimpleInInputReadKeyEx

File: CsmSimpleIn.c
Description:
Reads the next keystroke from the input device and
   returns data in the form of EFI_KEY_DATA structure.
   This routine is a part of SimpleTextInEx protocol
   implementation.


CsmSimpleInInputRegisterKeyNotify in the CsmSimpleIn.c

Function : CsmSimpleInInputRegisterKeyNotify

File: CsmSimpleIn.c
Description:
Register a notification function for a particular
   keystroke for the input device.
Input:
This - A pointer to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL_EX
           instance.
   KeyData - Key value
   KeyNotificationFunction- Pointer to the Notification Function
   NotificationHandle - Handle to be unregisterd

Output           None


CsmSimpleInInputReset in the CsmSimpleIn.c

Function : CsmSimpleInInputReset

File: CsmSimpleIn.c
Description:
In our implementation, this function does nothing.
Input:
IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL    *This
IN BOOLEAN                  ExtendedVerification
Output:
EFI_STATUS


CsmSimpleInInputResetEx in the CsmSimpleIn.c

Function : CsmSimpleInInputResetEx

File: CsmSimpleIn.c
Description:
In our implementation, this function does nothing.
Input:
IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL    *This
IN BOOLEAN                  ExtendedVerification
Output:
EFI_STATUS


CsmSimpleInInputSetState in the CsmSimpleIn.c

Function : CsmSimpleInInputSetState

File: CsmSimpleIn.c
Description:
Set certain state for the input device.

Paremeters:      This - A pointer to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL_EX
           instance.
   KeyToggleState - Pointer to the EFI_KEY_TOGGLE_STATE to
           set the state for the input device.


CsmSimpleInInputUnRegisterKeyNotify in the CsmSimpleIn.c

Function : CsmSimpleInInputUnRegisterKeyNotify

File: CsmSimpleIn.c
Description:
Removes the notification which was previously
   registered by CsmSimpleInInputRegisterKeyNotify.
Input:
This - A pointer to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL_EX
           instance.
   NotificationHandle - Handle to be unregisterd

Output           None


CsmSimpleInToggleState in the CsmSimpleIn.c

Function : CsmSimpleInToggleState

File: CsmSimpleIn.c
Description:
Get the Key Toggle State from the BDA

Paremeters:
   KeyToggleState - Pointer to the EFI_KEY_TOGGLE_STATE to
           set the state for the input device.


InitCsmSimpleIn in the CsmSimpleIn.c

Function : InitCsmSimpleIn

File: CsmSimpleIn.c
Description:
CSM SimpleIn driver entry point,
Input:
Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT
Output:
The status of CSM board initalization


CsmVideoPolicy.h

Description:
CSM Video Policy Protocol Declaration


Untitled Document

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~ The list of older CSM16 releases ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

CSM16 label 74 January 10 2014
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bfi.asm, int19.asm
EIP149769 - LegacyToEfi boot feature made optional, added point-of-no-return functionality

CSM16 label 72 August 13 2013
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
int19.asm, bbsc.asm, bfi.asm, mbiosequ.equ, bfiinit.asm
EIP132753, EIP132595 - LegacyToEfi boot support

CSM16 label 71 December 14 2012
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bfiinit.asm, bfiport.asm
EIP102771: added API to restore USB hard drive connection order; currently used by FWBOOT module

bfi.asm
EIP93796: during legacy boot "cls" command does not always clear the screen
EIP92261: during legacy boot the indicator of 101/102 keyboard must be set in 40:96

bbs.equ
EIP105453: the value of IPLPT_MAX_COUNT is increased to 40

int19.asm
EIP102765: MBR validation needs to be improved: RHEL disk utility might initialize LBA0 with DWORD pattern 33 CC 55 AA
EIP106090: CPU flat mode lost inside INT19 boot loop

patches.sdl
EIP94481: CSM16 Furball build fails

CSM16 label 70 June 27, 2012
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

bfi.asm
EIP86718: CSM16 code attempts to write to read-only region (F000)

bfiport.asm
EIP86521: CSM16 memory manager improvement: changed the algorithm in AllocateMemoryInE000OrF000 function

CSM16 label 69 December 22, 2011
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
int19.asm
EIP74972: Modified the range of MBR validation; checking for zeroes is done from offset 0 to 1B7

bfi.equ, bfibbs.asm, bfiata.asm, bfiisr.asm, core.mak, core.sdl, coredef.mak, cf.asm, disr.asm, hd.asm, i13c.asm, int13.asm, int13isr.asm, jmp.asm, bbs.equ, int13pnp.equ, tiano16.mak
EIP74971: Support for 6 IDE Controllers

hdapi.inc
EIP77222: Fixed function 48h returns wrong number of sectors if HDD supports 48-bit LBA but the size is smaller than 8GB. The size read might be changed by the SET MAX command.  When its size < 8.4GB the num_sectors becomes invalid and it should not be used for 48-bit LBA HDDs.

bfiinit.asm, pmm.asm, pmm.equ
EIP76821: Added permanent PMM allocation support for <1MB regions

cdatapi.inc
EIP75928: Clearing 40:8E added to clear_interrupt routines

nruntime.asm
EIP73969: added checking for FF when reading BusMaster port in ide_irq_isr_extra function

CSM16 label 68 October 3, 2011
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bfiisr.asm
EIP69156: INT1A, function B10E destroys interrupt flag (cli).
EIP70905: INT15, function D042 error exit path corrected to preserve all CPU flags except CF.

bfibbs.asm
EIP70382: during IPLDT preparations look in the AdditionalInt field, create BEV device if these fields are non-zero.

CSM16 label 67 August 16, 2011
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bfibbs.asm
EIP64251: Added a call to switch to big real mode after Option ROM execution.

EIP66440: When boot is attempted from boot override or pop-up menu and the boot device is not the first in the list within a group, then boot fails.
 Root cause: device map (e.g. HdMap) does not match IPLDT: if the device is second within a group, it will be the first in IPLDT
 Solution: modified MardDevicesToSkip routine to properly initialize device map

int74.asm
EIP62792: disable keyboard during INT74 processing

int19.asm
EIP61746: MBR sector may contain non-0 data at 1B0..1BF. Changed the boot validation code accordingly

CSM16 label 66 June 16, 2011
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bfiport.asm, bfi.asm
EIP55913(updated): LastOpromAddress location restored so that it follows "$EFI" structure. This resolves compatibility issues.

bfiport.asm
EIP62017: removed setting NMI enable information, it is done outside CSM16

bfi.asm
Correction in Boot_FAR, set video mode parameters corrected

bfibbs.asm
Modified HandleNonBBSOptionROM_FAR to support non-PnP ROMs that trap INT18/INT19.

CSM16 label 65 March 15, 2011
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Reporting CLP support
- Stack reassignment in INT_18. EIP23235
- EIP49897: Undoing warm boot related changes (EIP38426 and EIP40588): go_to_big_real_mode call will be moved to warm boot module.
- EIP55913: LastOpromAddress removed the code that initializes the location and the size of free E000 memory. It is intended to be updated from CSM32
- BfiInit:
--- E820 map was reported before the 1st entry is populated.
--- Added the reporting of the location of stack_ptr_reverse_thunk variable in InitializeYourself call.
- Modification in InitBbs function. EIP46978
- BfiUsb:
--- Reporting of the HC PCI location in USB INT13 fn 48. EIP51927
--- Added EDD functions as they are required for WinPE FDD emulated device boot. EIP52743, 49524

CSM16 label 64 October 19, 2010
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
int17.asm
EIP39688: [ Pressing Ctrl+P from DOS causes hang in DOS] in Los Lunas EV ( Desktop )

pmm.asm
Added checking for permanent memory allocation request.

rt-pci.asm
Added CH output in bios_present function according to PCI3.0 requirements.

biosdata.asm, ms.asm
EIP39228, EIP40121: added a code to avoid mouse data transfers when legacy mouse driver is not active.

csp.asm, bfi.asm
EIP38426, EIP40588: warmboot related changes.

rt-pci30.inc
EIP42178: Bugfix in pci30_read_cfg_x.

bfi.asm
added stack_ptr_reverse_thunk variable.

bfiport.asm
skip installing INT74 for legacy free systems.

bfiisr.asm
EIP44759: INT15_E820 function modification: removed checking for a "buffer too big" condition.

bfiusb.asm
EIP41547: error out on zero sector size.

bfiinit.asm
- Added the reporting of the location of stack_ptr_reverse_thunk variable in InitializeYourself call.
- Extended LEGACY16_TO_EFI_DATA_TABLE_STRUC structure.

CSM16 label 63 June 17, 2010
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Removed changes related to FASTBOOT

BFI.ASM
- EIP38042: Boot_FAR clears the screen if needed.

BFIUSB.ASM
- EIP39276(EIP33312): WinPE 2.0 Cannot boot when Partition Size >= 256GB on USB HDD
   Root Cause: USB INT 13h AH=42h function has LBA 28bit limit (MAX limit=255GB).
   Solution: Change LBA limit to 32bit.
- EIP38127: Aptio INT13 func48 fail. Updated the BufferSize and DevicePath length to EDD 3.0b.
- EIP35977: Bugfix in UpdateDeviceGeometryUsingUsbData: media geometry was not reported correctly when media is not present while the device is being detected.

BBSC.ASM
- EIP38450: Removed the default INT13 installation when no mass storage is connected.

BFIATA.ASM
- EIP38127: Aptio INT13 func48 fail. Updated code to report 32bit xfer and block mode xfer.

BFIISR.ASM
- EIP37735: Change in "Check$PirTable" function: "$PIR" is divided into two parts so that some "validation" tools won't be fooled by the presence of unexpected "$PIR" in the BIOS.

OUT.ASM, CDR.ASM
- EIP39788: Display proper messages for ElTorito CDs

Version 61, 8 January 2010
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
OEMCFG.ASM: Modifications in timer_interrupt_int8, function made similar to the current Core8 implementation.
INT19.ASM:
- Added enable_disable_nmi_far after accessing CMOS to preserve the NMI enable.
- Added support for Fastboot. Stores boot device index in CMOS register 0x38.

BFIPORT.ASM:
- Added UpdateUsbKbLed function, EIP#31467
- Added code to skip mouse detection on FAST Boot

BIOSLIB.ASM: EIP24106: Disable NMI while accessing CMOS.

Version 60
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
OEMCFG.ASM:
Undoing the change in timer_interrupt_int8 made on 03/26/09. It has chipset specific code and causes "when CMOS is cleared with the jumper and booted into setup, the System Date's year would be wrong" problem.

BFIPORT.ASM, MBIOSEQU.EQU:
Adding CSM16 OEM hook called on a write to LBA0 when virus protection is enabled.

INT15.ASM:
Bugfix in INT15 fn 87 related to rt_cmos_skip_ga20_deactivation_bit

CDR.ASM
- CDROMInvokeAPI - added checking for valid API; this fixes the problem of "accidental" CDROM code execution. This happens when WinPE PXE loader is executed prior to an attempt to boot to CD (CDR_BEV has an init code for CDROMInvokeAPI data structures)
- Change in CDRLoadCDROMBootImage related to the situation where CD with boot catalog size/4 != 0; EIP#25305

Version 59
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
BFIBBS.ASM:
Removed Tracker#194620 changes as it cause other issues and it's not needed to fix the tracker 194620. EIP#24123

BFIPORT.ASM:
NMI disabled SetMemoryInfoInCmos as NMI Handler is not avilable. EIP#24106

Version 58
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
KBC.ASM
Modified the change made in ver 57 related to KBC output buffer read routine. Originally reported in EIP22161. Previously added timeout was not implemented correctly and caused problems with PS/2 mouse functionality.

Version 57
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
AHCI INT13:
Bugfixes related to FreeDOS installation. Relevant EIPs: 22812 and 22958.

USB INT13:
Hotplug devices information is properly obtained on INT13 entry.

BFIPORT.ASM:
Undone the change made on 8/18/06: EIP#15429.

KBC.ASM:
Prevent dead loop in ob_full_read function. EIP22161.

AFD.ASM, CDATAPI.INC:
AFD code is updated and made in sync with Core8.

JMP.ASM:
Reserved 20h bytes at F000:E130 and 20h bytes at F000:E7F0.EIP11854

Version 56
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RT-PCI.ASM, BFI.ASM
- RT call get_last_pci_bus is modified to return the value from $EFI structure.

BFIBBS.ASM
- Fix for Tracker#194620 "Boot order mismatch when the first boot device isn't bootable".

OEMCFG.ASM
- Removed Y2K checking from timer interrupt

BFIPORT.ASM
- Bugfix in GetMouseInformation.

Version 55
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
JMP.ASM, CF.ASM
- AMI address and copyright message corrected

CSP.ASM
- Removed OEM functions for enable and disable GA20

NRUNTIME.ASM
- Modified disable_addr_bit_20 - added option to skip disabling GA20.

INT15.ASM
- Added option to skip disabling GA20 after executing function 87h.

UI13PNP.ASM, BFIUSB.ASM
- USB INT13 code is made optional, built as a separate binary UI13.BIN

BFI.ASM
- Sorted out the GA20 control methods - KBC or Port92; only one left active depending on the bit FAST_GATE_A20_BIT in cs:misc_info.

Version 54 - EPSD internal release, most of the features of ver 53 undone.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Version 53
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
BFI.ASM
- Fixed the CPU mode issue during boot: TCPA call was unloading big real mode descriptors

BFIATA.ASM, TIANOBSP.SDL
- FLOPTICAL support made optional

BFIBBS.ASM, BFIISR.ASM
- EIP16613: added BAID BCV #11 (0-based) for 12-th BAID device

BFIUSB.ASM, AINT13.ASM
- Added VDS support; needed for USB INT13 and AHCI INT13 when CPU paging is on (EMM386)

BFIUSB.EQU, JMP.ASM, INT16.INC
- Added a call that updates USB keybard LEDs when PS/2 keyboard LEDs are changed

CDR.ASM
- EIP10510: Change in CDR_BEV - save and restore IRQ status during CDRLoadCDROMBootImage

CSP.ASM, MBIOSEQU.EQU
- EIP#15997: added OEM16 functions to control GA20

Version 52
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
OUT.ASM
- Fixed PrtScn key INT05 functionality

BFI.ASM, BFIPORT.ASM
- Added code to clear base memory before executing INT19
- Added a choice of booting in Big Real mode or Normal Real mode, controlled through BIT5 of rt_cmos_byte variable

BFIBBS.ASM
- Change in MarkDevicesToSkip routine that updates boot priorities in BBS table
- Bugfix in GenerateBbsBootOrder routine

BFIUSB.ASM
- Code cleanup, getting it ready for independent USB INT13 implementation

JMP.ASM
- Company's address updated

- AHCI module update
- SREDIR module update

Version 51
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
BFIPORT.ASM
- Modified GetMouseInformation function to return mouse related information according to the input provided in EFI_TO_LEGACY16_BOOT_TABLE_STRUC structure.

BFI.ASM, MBIOSEQU.EQU
- Modified CSM16 entry point, added csm16proc call to provide the OEM hook for checking for the KBC presence.
- Disable GA20 through KBC before boot; it is kept enabled through Port92.
- Serial redirection module is updated to the latest label "SREDIR_CSM36.10".

Version 50
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
BIOSDATA.ASM
- AttemptedIplBitmap (64bits) added to remember which device was attempted. Migrated from core8.

INT19.ASM
- Do not retry the boot failed devices again.
- The AttemptedIplBitmap bit will be reset for floppy to retry again.

CDATAPI.INC
- EIP13878 - When the AMT IDE-R CD Boot is requested along with SOL,system does
not boot from the remote CD. If AMT IDE-R CD Boot is requested without SOL, it
works fine.

NRUNTIME.ASM
- reverted the change in ide_irq_isr_extra routine

BFI.ASM
- Bugfix in csm16proc; situation with no OEM16 data was not handled properly

BFI.EQU
- Modified LEGACY16_TO_EFI_DATA_TABLE_STRUC structure: added field wBaidRmdVectorCntOfs that will return the offset of baid_rmd_vector_cnt variable.

BFIPORT.ASM, BFIUSB.ASM, BFIISR.ASM, BFIBBS.ASM
- Isolated USB code in BFIUSB.ASM

BFIINIT.ASM
- Initialized LEGACY16_TO_EFI_DATA_TABLE_STRUC.wBaidRmdVectorCntOfs with the offset of baid_rmd_vector_cnt variable.

INT19.ASM
- Removed drive reset (INT13 func 0) from read_floppy_winchester routine.

Version 49
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
BFIUSB.ASM, BFIUSB.EQU
- Support for 720K floppy; requires a change in USB driver as well.

PMM.ASM
(EIP14012) PMM function 0 length=0 did not return the maximum free memory size
in some cases. find_largest_free_memory failed to use top of conventional memory
if the last entry of PMM is out of range.

Version 48
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
BfiBbs.c:
- Added CheckDoNotBootDevices_FAR to create placeholders for the devices with DO_NOT_BBOT_FROM priorities.

INT19.ASM, MBIOSEQU.EQU:
- Added BeforeCallingBootVector_FAR function call.

AHCI:
Changed to the latest Core8 AHCI source reference; to be used with AHCI label "4.6.3_AhciSrc_008".

Version 47
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
BFI.ASM
- Load big real mode descriptors before INT19

BFIINIT.ASM
- PMM initialization bugfix; if memory is 2GB or more, high memory PMM area was not initialized

BFIISR.ASM
- Changed Boot Failure message to match Core8, more clean and meaningful

HDPARAM.EQU
- Extended the PATH field of ExtI13DriveInfo by 8 bytes, according to EDD3.0

AHCI modifications:
ACDR.ASM
- Added call AhciCDGetLastStatus to implement the proper delay for CDROMs that respond slowly

ACDR.ASM, AINT13.ASM
- Reassign stack to avoid problems related to caller's stack size (too tight)

AINT13.ASM
- INT13 func 48 - changed buffer size by 8 bytes, according to EDD3.0
- Function 30: added the following subfunctions:
-- F5 - SECURITY_FREEZE_LOCK
-- F2 - SECURITY_UNLOCK
-- E7 - FLUSH_CACHE

- Added support for S3 resume

Version 46
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
KBC.ASM
- undone modification from Ver 45 related to ob_full timeout

AINT13.ASM, AINT13.EQU
- changes related to S3 and security support in AHCI

TCPA change: Don't log events if TCPA is deactivated
TCPA change: Set and Release Locality after every call
TCPA change: If TCPA Shutdown; Reset is required for the TCPA legacy calls to become available
TCPA change: Remove measurement of Separators from Legacy aspect to EFI aspect of TCG module

Version 45
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
INT13ISR.ASM, HDPARAM.EQU
- Extended the buffer reported by INT13 func 48 according to EDD3.0

INT13ISR.ASM
- Reduced the usage of stack in HW interrupt handler

KBC.ASM
- Changed ob_full routine from infinite loop to timed-out loop

BBSVT.ASM
- Modified INT13 return path so that FN26 will not restore DX

AHCIACC.ASM
- Added WaitForFisRecRun_API routine in CSM16 API

BFIBBS.ASM
- FLEXBOOT related modifications

Version 44
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Compliance with CSM Specification ver 0.97

BFI.EQU, BFIUSB.ASM, BFIBBS.ASM
- Report USB Host Controller PCI Bus/Dev/Func in BBS table as well as in INT13 func 48
- USB INT13 func 50 implemented

BFIBBS.ASM
- Patch for TSE when it boots through Boot Override, and priorities for other-than-boot-from devices are set to DONOT_BOOT_FROM

AINT13.ASM, AINT13.EQU
- Implementation of INT13 func 30 to support Intel TurboMemory in AHCI mode

CDAPI.INC
- Bugfix in CDRInt13hFunction50 that implements INT13 func 50D7 call

Version 43
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RT-PCI.ASM
- undone the change that would make get_last_bus always return 0
RT.ASM
- return UNSUPPORTED for unsupported RT functions

Version 42
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RT.ASM
- modified the method of execution of PnP functions external to CSM16; the earlier implementation failed for 16-bit protected mode PnP calls.
BFI.ASM
- GA20 is kept enabled before booting.
- AcquireUsbKeyboard call added in the end of PrepareToBoot function.
BFIISR.ASM
- Int1AIsr modified for 16-bit protected call support.
BFIINIT.ASM
- Added initialization of LEGACY16_TO_EFI_DATA_TABLE_STRUC PTR.wAddedPnpFunctionsOfs.
BFIUSB.ASM
- Added probe port 64h to AcquireUsbKeyboard and ReleaseUsbKeyboard that is needed for KBC emulation driver.
BFIBBS.ASM
- Changes related to EIP11433.
-- description of EIP11433:
    Realtek offboard NIC card should be displayed as "Legacy Network" and not in Hard Disk Drives type in TSE.
- Modification in NvCmosInit; this fixes the booting issue whith multiple CDROM drives configurations.

Version 41
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
INT19.ASM
- Change in init_fdd_qty routine that sets bit 0 of 40:10 in case of network boot.
JMP.ASM
- Placed an offset of Legacy16Data at F000:FF4C.
- Placed a call to CSM16_PROC at F000:FF70
INT13ISR.ASM
- Bugfix in init_fn48_buffer function.
BFI.ASM
- Removed the code that discards the data in the keyboard output data buffer.
BFIBBS.ASM
- Bugfix in CreateIPLDT_FAR routine that did not work for the priority set to BBS_LOWEST_PRIORITY (0xFFFD)
BFIUSB.ASM
- Added INT13 func 15 for USB HDD type reporting
TIANOBSP.SDL
- Removed INT1587_SCRATCH_PORT token override so that the default port 81h is used
FURBALL10.VEB
- Added AHCI module
RT.ASM
- PnP func 60 call is restored after it got removed in version 38
BFIBBS.ASM, BFIPORT.ASM
- Removed EnableKeyboard call as it causes unnesessary delay, enabling/disabling PS/2 keyboard is done in PS/2 keyboard driver.
BFI.EQU
- Added two new fields in LEGACY16_TO_EFI_DATA_TABLE_STRUC structure:
  wCdrBevOffset and wCDROMSupportAPIOfs that allows the addition of external legacy CDROM support drivers.
CDR.ASM
- Modification in CDRInvokeCDROMAPI that allows API routines to be FAR, not NEAR
CDATAPI.INC, BFIUSB.ASM
- CDROM API routines made FAR
MBIOSEQU.EQU
- Added CSM16_OEM_AHCI_ACCESSHBA API equate.

Version 40
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CDATAPI.INC
- Fix for EIP 9583, restore/unmask CD interrupt
RT.ASM
- PnP functions 55..57 are directed to possible OEM implementation
BFI.ASM
- Removed memory manager uninstall from PrepareToBoot, it causes problems if memory is allocated after PrepareToBoot is called
BFIPORT.ASM, BFIINIT.ASM
- Added and initialized dSmiFlashTableAddress field in LEGACY16_TO_EFI_DATA_TABLE_STRUC structure
INT19.ASM
- Added CSM16_OEM_ON_BOOT_FAIL call

Version 39
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ZIP emulation (FDD/HDD) code added
- Bugfix in ConfigureHddParameter routine Tracker#31477, bug was introduced in ver 37 (BFIATA.ASM)
- Added make_led_on call in Boot_FAR to sync keyboard's LEDs with BDA
- Removed SMBIOS PnP code, implemented in SMBIOS EFI driver
- Added CSM16_OEM_BEFORE_SWSMI and CSM16_OEM_AFTER_SWSMI calls
- Added HDD-emulated ZIP(ATAPI) initialization in InitAtaAtapiDevices
- Serial Redirection module updated to label SREDIR_CSM36.04

Version 38
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
BFIBBS.ASM, BBSC.ASM
 - bugfix in handling non-BBS compliant Option ROMs, introduction of I19_TRAP bit in misc_info
HD.ASM
 - In WREAD routine address alignment checking is changed from WORD to DWORD
RT.ASM, BFIPORT.ASM, BFIISR.ASM
 - PnP functions 50..52 implementation
SREDIR module source is updated

Version 37    8 June 07
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
BFI.ASM, CF.EQU
 - Added checking for no_usbmass_boot_bit bit
 - Removed initialization of BDA:kb_stat_flag
CF.ASM
 - Changed the initialization value of misc_info flag
BFIPORT.ASM
 - Added check_virus routine that prevents the writes to HDD's MBR if needed
BFIATA.ASM
 - Bugfix in ConfigureHddParameter routine
BBSC.ASM
 - Bugfix in dim_func_CDROM routine that did not consider CDROMs created by OpROMs
BFIUSB.ASM
 - Added 15 microseconds delay after generating software SMI

Version 36      9 May 07
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
BFIPORT.ASM:
 Added BBS runtime function 60h that is required for several NIC OpROMs to be able to produce BEV.

BFIATA.ASM:
 Change that allows booting to all the HDD, even those partitioned by other BIOSes with different translation algorithm.

Added Legacy Serial Redirection eModule, build process generates SREDIR.BIN

Version 35      23 March 07
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PMM.ASM:
  1) Fixed system hangs with Adaptec Host Raid Card (ASC-48300); pmm_allocate_memory did not balance the stack before exit when OpROM calls PMM multiple times with the same, non-anonymous handle.
  2) Fixed the algorithm used in find_free_memory routine when PMM memory map is fragmented.

BFI.EQU, BFIATA.ASM:
  Fixed a problem with booting to XP in AHCI mode

Version 34      23 Feb 07
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- (BFIBBS.ASM, BFIISR.ASM) Implementation of BBS_DO_NOT_BOOT_FROM boot priority: devices marked with this boot priority will be excluded from INT19 loop and will still be available as INT13 devices

- (BFIISR.ASM) Modification in INT15 function E820: calculate the output buffer size considering the caller can:
 1) request the size smaller than the size of the entry
 2) request the size bigger than the size of the entry
This works around the problem of versions of Tiano that initialize E820 entries that are 4 bytes smaller than the ones defined in ACPI3.0.

- Removed InitAtaAtapiDevice call from PrepareToBoot to speed up the boot process. The code was unnecessarily reset the drives using INT13 func 0 (ATA) and reset ATAPI devices (ATAPI).

- (BFIATA.ASM) Added the code in PrepareToBoot that would enable nIEN on all IDE channels

- (BFIATA.ASM) Adjustment of INT41 and INT46 if needed: they need to be swapped in case the 1st drive (80h) is slave and 2nd drive (81h) is a master on the same channel

- (HDAPI.INC) Modification in validate_set_task_file that should error (02) if number of blocks more than 7F even for 48-bit enabled drives.

Version 33 ( Oleg Ilyasov, ami, 24 Jan 07  11:06am)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Undone the v32 modification in BFIINIT.ASM that does INT74 early setup. It is moved to DispatchOptionRom funcion in BFIBBS.ASM
- Added the code in the booting sequence that would jump directly to the INT19 vector and don't wait for user input if the corresponding bit in MISC_INFO was set

Version 32 ( Oleg Ilyasov, ami, 22 Dec 06  9:43am)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
INT9.ASM: bugfix in the legacy free key processing path.
BFIINIT.ASM: int74 early initialization.
BFIUSB.ASM, BFIUSB.EQU, BFIBBS.ASM: Adding USB device handles to BBS table.
BFI.ASM, BFI.EQU: Support for CSM Specification 0.96; switch driven, default is set to 0.95 currently supported by EPSD

Version 31 ( Oleg Ilyasov, AMERICAN MEGATRENDS INC, 27 Oct 06  3:42pm)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fix for IDE-R/SOL combination issue (CDATAPI.INC) The root cause of the issue is in the IDER/SOL firmware: if SOL interrupt occurs in the middle of IDER transfer, then the transferred data is corrupted, although the data transfer operation is reported as successful.

BfiUsb.asm:
USB SW SMI will not use CPU register to pass the pointer to the input parameters, it will use EBDA for this

CDATAPI.INC
Modification in clear_interrupt_if_needed routine. Before clearing interrupt make sure other interrupts are masked.

RT.ASM
PnP functions 50..57 returns UNSUPPORTED, not INVALID_PARAMETER. This cures some PnP hungry applications.

Version 30 ( Oleg Ilyasov, AMERICAN MEGATRENDS INC, 2 Oct 06  9:53am)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Version 29 breaks the fix made in v28 (#2). Changes undone.

Version 29 ( Oleg Ilyasov, AMERICAN MEGATRENDS INC, 25 Sep 06  9:43am)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TCPA support update.

Version 28 ( Oleg Ilyasov, AMERICAN MEGATRENDS INC, 18 Aug 06  5:35pm)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1) 20h bytes is reserved in F000 for SMBIOS header; the amount of code we had to reserve this area was about the same size and it is removed now.
2) fix in enable_addr_bit_20/disable_addr_bit_20 routines is undone; it was found UNDI code executed by SNP16 driver makes the system reset if these routines are functional. Here is the sequence of events that causes failure: a) NIC OpROM requests high memory from PMM, PMM request is granted b) UNDI code executes INT 15 func 87 (move block) c) UNDI code directly addresses memory above 1 MB. The problem is INT 15 func 87 in the end will disable GateA20 so UNDI starts trashing memory.
3) The amount of space available for allocation has been increased by more than 2K. The first available for allocation address is F000:CB00. See Ver28CleanupLog.txt for the reference.

Version 27 ( Oleg Ilyasov, AMERICAN MEGATRENDS INC, 2 Aug 06  12:57pm)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- added support for both legacy and legacy free projects that will use the same CSM16 binary
- bugfix in BFIPORT.ASM::CheckAndRestoreInterruptVectors - properly handle interrupts that have their handlers in EBDA
- bugfix in int15 function 24 that enables/disables GateA20

Version 26 ( Oleg Ilyasov, AMERICAN MEGATRENDS INC, 6 Jun 06  9:02am)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- INT13 function 25 is added
- UpdateKeyMonitorData in INT9.ASM is modified to use proper EBDA

Ver 26 additional comment ( Oleg Ilyasov, AMERICAN MEGATRENDS INC, 6 Jun 06  10:06am)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DF (CPU direction flag) is cleared at the CSM16 entry point.

Version 25 ( Oleg Ilyasov, AMERICAN MEGATRENDS INC, 8 May 06  8:29am)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Memory map reporting through Int15 func E820 made compliant with ACPI 3.0.

Version 24 ( Oleg Ilyasov, AMERICAN MEGATRENDS INC, 28 Apr 06  10:09am)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
BBS_VECTOR_MAX_COUNT increased from 16 to 32.
File: BBS.EQU

Version 23 ( Oleg Ilyasov, AMERICAN MEGATRENDS INC, 25 Apr 06  2:48pm)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
BBSC.ASM: Modification in dim_7_proc_connect_BCV that would not confuse SCSI HDD that is not responding with floppy.

Version 22 ( Oleg Ilyasov, AMERICAN MEGATRENDS INC, 30 Mar 06  10:48am)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- GetTable API function (#6) is extended to return OEM data buffer within FE000..FFFFF
- RT32 module made optional
- Bugfix in CreateIPLDT function that would allow more than 20 bootable devices

Version 21 ( Oleg Ilyasov, AMERICAN MEGATRENDS INC, 13 Mar 06  5:20pm)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- TCPA source compilation made selectable through TCPA_SUPPORT SDL token.

Version 19 and 20 ( Oleg Ilyasov, AMERICAN MEGATRENDS INC, 10 Mar 06  4:59pm)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19: TCPA support in INT 1A
20: Bugfix in legacy floppy controller reset code: FD.INC

Version 17 and 18 ( Oleg Ilyasov, AMERICAN MEGATRENDS INC, 28 Feb 06  11:30am)

Version 17
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- new feature: monitor key support

Version 18
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Unified version that can be used for different CSM Specification versions. No separate projects required for this, only changing the TBL_MJ token in .SDL file and rebuilding the project will be sufficient to support three CSM  Specification versions: 0.91, 0.94b and 0.95.
- Bugfix in creation of IPLD table out of EFI BBS table when the 5th/6th channel is populated with the drives.


Untitled Document

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~ The list of older CSM32 releases ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

label 4.6.5.3_CSM.7.72_81 August 14, 2013
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
New features added in this label:
    Support for Legacy2Efi module
    Onboard PCI Option ROM loading is moved outside CSM into PCI bus driver; this feature made dependent on version of PCI bus driver

EIP addressed in this label:
- csm.c, legacybiosext.h, amilegacy16.bin
    EIP132753 - Support for Legacy2Efi module

- csm.c
    EIP121303 - UEFI Win7 hibernation wake up may fail (amount of BS memory is limited by MS)
    EIP117874 - Modified AllConnectedCallback function event is based on TPL_NOTIFY
    EIP120105 - Incorrect 'CSM16LocationAttribute' passed to CopyLegacyTable()

- csmoprom.c
    EIP125092 - Support for PCI ROM 2.1+3.0
    EIP111209 - ISA boot devices controlled by the Option ROM are added to the boot list

- CsmLib.c
    EIP123915 - BBS table update in CSM should be atomic operation (extra reentrance guards added)
    EIP118727 - Onboard PCI Option ROM loading is moved outside CSM

- uefibiosvideo.c
    EIP119388 - CppCheck error correction (uninitialized variable in UefiBiosVideo)

- CsmInt13.c, CsmBlockIo.c
    EIP125560 - Support Boot Sector Virus Protection for CSM Disabled Mode

- rt32.c
    EIP130418 - Correction in RT32 entry point calculation

label 4.6.3.1_CSM.7.71_80 December 31, 2012
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
New features added in this label:
    Video panels that have limited EDID information will be supported by CSM Video driver: added "Detailed EDID Timing" parser
    Legacy Region protocol interface and implementation is moved from CSM module to the NorthBridge; other modules that need to manipulate PAM registers do not depend on CSM any more (EIP70217)

EIP addressed in this label:
- csm.c
    EIP89376 - Support to return EFI_SECURITY_VIOLATION from EFI_LEGACY_BIOS_PROTOCOL.LegacyBoot when secure boot is on
    EIP108682 - Invalid Error Code from CSM Functions: use EFI_ERROR_BIT macro instead of BIT31
    EIP105734 - PCI Resource Issue with PLX Bridges: Bridge stays disabled on LegacyBoot
    EIP93685 - Clear CSM used resources when it is disabled
    EIP92416 - LegacyBiosExt protocol is rearranged so that newely added functions are in the end of the protocol structure

- csmoprom.c
    EIP104052 - Support for generic Option ROMs with PCI3.0 headers
    EIP100790 - ConnectSerialIO is moved after Video is reconnected
    EIP92895 - Event-based PreProcessOpRom replacement for AptioV

- csmhwinfo.c
    EIP109283 - PCI RT32 last bus improperly calculated

- pciinterrupts.c
    EIP99683 - Analyze all errors returned by Intx2Pirq function

- csmlib.c
    EIP105801 - FindEmbeddedRom improperly calls Check30ROM, output parameter might be invalid

- thunk.c
    EIP99561 - KbcEmulation enabled in Int86 call but NO_KBC_PRESENT_BIT bit not set properly

- x86thunk.asm
    EIP109554 - Update CSM thunk to use private GDT instead of GDT on entry point
    EIP95386 - CR3 register save/restore

- uefibiosvideo.c
    EIP96659 - Framebuffersize calculation is not done based on each mode configuration
    EIP102886 - Enabling 4GB Decoding in PCI settings causes system to hang at checkpoint B2
    EIP102919 - EDID information parser does not return FALSE if no valid EDID timing is found
    EIP108990 - UEFI BIOS Video driver needs to report more available video modes
    EIP110657 - EDID information parser modification (extension of EIP108990)

label 4.6.3.1_CSM.7.70_79 July 20, 2012
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
EIP addressed in this label:
    EIP90257 - Improve the method of clearing low memory (0..640K) during CSM initialization: skip the allocated memory blocks
    EIP83856 - Improve the algorithm of checking for the Video devices: Option ROM in a multifunctional PCI device that contains VGA as on of the functions was not properly managed
Note: because of this change the eLink CSM_INIT_LEGACY_MEMORY_FUNCTIONS has been removed
    EIP91376 - Increased the default value for maximum PCI Option ROMs to 32
    EIP86770 - Added ExecuteBcv function. Note: this also resolves EIP72804.
    EIP82449 - During LegacyBoot some EBDA locations might be destroyed: corrected the calculation of the size of allocated EBDA
    EIP81041 - Re-entrance support for Farcall86 and Int86 protocol functions

label 4.6.3.1_CSM.7.69_78 December 30, 2011
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
New features added in this label:
  EIP74971 - Implemented legacy support for six IDE controllers, up to twenty four IDE devices
  EIP76821 - Added permanent PMM allocation support for <1MB regions

EIP addressed in this label:
  EIP78921 - CsmBlockIo should create device handle in BBS table
  EIP79228 - Implement CSM_INT19_TRAP_IMMEDIATE_ACTION functionality
  EIP77045 - Changed the values to be loaded to the segment registers from static number (8) to a dynamic number that represents a valid descriptor
  EIP77755 - Modified CreateAddonBusEntry function to return if requested bus # is already present in AddonPciBusTable
  EIP74894 - In some cases OEM logo partially remains on the screen during EFI boot popup menu
  EIP77897 - Using More then one ISA PnP Card with an Option ROM that have  overlapping Memory ranges only one Option ROM will be run

label 4.6.3.1_CSM.7.68_77 October 19, 2011
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
New features added in this label:
  EIP68606 - Implemented CSM Opt-out support; controlled through the new SDL token CSM_OPTOUT_IMPLEMENTED
  EIP58687 - Updated the implementation of EFI_BLOCK_IO_PROTOCOL as described in UEFI specification v 2.3.1, page 12.8
  EIP57506 - Added INT10_TRUST_EDID_INFORMATION token to address the issues with Video Option ROMs that do not return proper EDID information
  EIP56524 - Support for LEGACY_REGION2_PROTOCOL
  EIP72331 - Added CSM_INIT_LEGACY_MEMORY_FUNCTIONS eLink for custom memory initialization

General Bug Fixes:
  EIP60317 - Do not enable PCI siblings for VGA
  EIP61986 - Post Screen corruption occurs while loading multiple Option ROMS
  EIP59628 - BDA is not initialized correctly, reporting the maximum of 2 comports in the system with 4 comports
  EIP65882 - Added checking for OPROM_MULTIPLE_MODULEID in FindEmbeddedRom, PCI3.0 Option ROM section
  EIP49352 - Modifications in CsmBlockIo.Supported function to properly handle onboard RAID controller
  EIP58631 - Modifications in UefiBiosVideo.Stop function to actually stop video controller
  EIP65494 - CPU exception 0xD when using SDVO card: UefiBiosVidceo driver was trying to free  the VbeFrameBuffer memory after its being freed
  EIP70382 - Clear keyboard status in BDA after FarCall86 execution

EIP addressed in this label:
  EIP62285 - Immediate INT19 execution call added
  EIP66636 - Validation of legacy Option ROM modified: some Option ROMs are not properly report last image indicator (Adaptec SCSI BIOS v4.31.4 (c) 2007)
  EIP59632 - Removed the break from for loop in UpdateCsm16Configuration; this allows to finish all COM data initialization
  EIP61035, EIP65224 - When AMIDebugger is using COM port, system halts in DisconnectSerialIO()
  EIP54911 - CsmBlockIo driver Start function modified to return the proper value

label 4.6.3.1_CSM.7.65_76 April 14, 2011
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
New features added in this label:
  - All porting functions defined in CsmBsp.c have been replaced with eLinks.
    OEM code does not have to be present in CsmBsp.c, making this file private.
    Instead, OEMs can implement their code in OEM files and link these files with CspLib.
    Note: this feature is optional, should OEMs choose to keep CsmBsp.c private, no modifications would be necessary for the existing code. (EIP50327)

  - Improvements in the video thunk driver (EIP55943,52264):
    - video output speed is increased after BLT function optimization
    - added support for 16-bit video modes

  - $EFI structure in AMI's CSM16 had LastOpromAddress field that is outside of the scope of CSM specification; it has been removed.

General Bug Fixes:
  EIP49781 - Setup strings misspelling corrections
  EIP48212 - The improved implementation of CheckEnablePciSiblings; it enables all PCI devices with the same VID/DID because most of the Option ROMs expect that
  EIP56792 - The meaning and functionality of FLEX_BOOT token is depreciated, it has been replaced with the new BDS boot device grouping features available in Core 4.06.04.

Note: For backward compatibility the functionality of FLEX_BOOT token remains unchanged if Core version is less than 4.06.04.

EIP addressed in this label:
  EIP54262 - Modification CheckPciRom that sometimes does not return the proper PCI ROM Status
  EIP51947 - Change the handling of Option ROMs that trap INT19
  EIP47379 - For multiple images in the Option ROM, if the 1st image in not IA32 type, the IA32 image will not be found
  EIP50206 - Calls to Get16BitFuncAddress() can hang the system when CSM_OEM_SUPPORT is disabled: disabling CSM_OEM_SUPPORT and calling Get16BitFuncAddress() will hang the system because gCsm16FuncAddress is NULL (uninitialized) and gCsm16FuncAddress is dereferenced
  EIP48471 - COM Port addresses are not filled in correctly in BDA when COM 0(First COM port) disabled in setup
  EIP44553 - PCI recovery card is disabled during its Option ROM execution
  EIP52322 - Projects with two or more PCI 3.0 embedded ROMs: if ROM's Device List all support one device, only one option ROM would be invoked
  EIP50111 - TPL asserts in some legacy free projects during LegacyBoot

label 4.6.3.1_CSM.7.64_75 November 18, 2010
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This is bugfix release that fixes the CSM thunk issues on 32-bit projects.
  EIP48242 - Fixed thunk problems for IA32 projects.
  EIP47997 - Project tag updated in F000:F4F0.
  CSMOPROM.C - Modified CsmInstallRom function to use correct PciIo.
  PCIINTERRUPTS.C - PCI_TRACE macro replaced with TRACE.
  CSMHWINFO.C - Added CloseEvent call in UpdateLastPciBus callback function.

label 4.6.3.1_CSM.7.64_74 October 29, 2010
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This is bugfix release that affects the headless systems support.
  EIP47186 - function FindAnyVga was returning EFI_SUCCESS in case of headless system.

label 4.6.3.1_CSM.7.64_73 October 22, 2010
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

New features:
  - Reverse thunk implementation; porting guide is updated with the reverse thunk usage information
  - Introduction of the video switching policy, see the detail of CSM_DEFAULT_VMODE_SWITCHING token

List of EIPs affected by the release (in the ascending order):
  26277, 35156, 37977, 39089, 39395, 39674, 39733, 39752, 39768, 40711, 40907, 42178, 42457, 43050, 44674


SetKbcPresenceInMiscInfo in the thunk.c

Function : SetKbcPresenceInMiscInfo

File: thunk.c
Description:
Updates CSM16_NO_KBC_PRESENT_BIT of MiscInfoAddress accordingly
by checking if the KbcEmulation is Enabled or Disabled.
Input:
Output:
EFI_STATUS
Referrals:


CSM Release Notes

AMI CSM16 Component Release Notes

Component Information

Component Name | CSM16
Component Type | Legacy16 binary
Release Date | August 16th, 2011
Source Control Label | 8.00.10.00.0x.67
Source Control Location (BIN) | Alaska:/SOURCE/Modules/CSM/Generic/CSM16
Source Control Location (SRC) | Alaska:/CSM16/Complete Project/Furball10.64K
Component Description
This component, termed as "CSM16" or "EfiCompatibility16", is a runtime part of a traditional legacy BIOS.
Source downloading note
While downloading the CSM16 source, VeB will show the following two warning messages:
Warning #1

Warning #2

  • Warning1: This happens on any Core8 project that includes Core source includes as a module part; it is CIF/VEB specific limitation
  • Warning2: This happens when one file belongs to two different modules. In CSM16 source files BFIUSB.ASM and BFIUSB.EQU belong to two different modules. This was needed to be able either to include USB INT13 with the main CSM16 binary, or to create a separate binary. Current Aptio4 code uses a separate binary, however several Aptio3 projects use it as part of CSM16 binary. So for now we have to keep it in two different parts at the same time (and have only one copy on the SS).
    • Revision History

    Version 64, October 20, 2010
    • EIP39688 :: int17.asm
      • Pressing Ctrl+P from DOS causes hang in DOS] in Los Lunas EV ( Desktop )

    • pmm.asm
      • Added checking for permanent memory allocation request

    • EIP39228, EIP40121 :: biosdata.asm, ms.asm
      • Added a code to avoid mouse data transfers when legacy mouse driver is not active

    • EIP38426, EIP40588 :: csp.asm, bfi.asm
      • Warmboot related changes

    • EIP42178 :: rt-pci30.inc
      • Bugfix in pci30_read_cfg_x

    • bfi.asm
      • Added stack_ptr_reverse_thunk variable

    • bfiport.asm
      • Skip installing INT74 for legacy free systems

    • EIP44759 :: bfiisr.asm
      • INT15_E820 function modification: removed checking for a "buffer too big" condition

    • EIP41547 :: bfiusb.asm
      • USB INT13 errors out on zero sector size

    • bfiinit.asm
      • Added the reporting of the location of stack_ptr_reverse_thunk variable in InitializeYourself call
      • Extended LEGACY16_TO_EFI_DATA_TABLE_STRUC structure

    Version 63, June 16, 2010
    • Removed changes related to FASTBOOT.
    • EIP38042: Boot_FAR clears the screen if needed.
    • EIP39276(EIP33312): WinPE 2.0 Cannot boot when Partition Size >= 256GB on USB HDD
      • Root Cause: USB INT 13h AH=42h function has LBA 28bit limit (MAX limit=255GB).
      • Solution: Change LBA limit to 32bit.
    • EIP38127: Aptio INT13 func48 fail. Updated the BufferSize and DevicePath length to EDD 3.0b.
    • EIP35977: Bugfix in UpdateDeviceGeometryUsingUsbData: media geometry was not reported correctly when media is not present while the device is being detected.
    • EIP38450: Removed the default INT13 installation when no mass storage is connected.
    • EIP38127: Aptio INT13 func48 fail. Updated code to report 32bit xfer and block mode xfer.
    • EIP37735: Change in "Check$PirTable" function: "$PIR" is divided into two parts so that some "validation" tools won't be fooled by the presence of unexpected "$PIR" in the BIOS.
    • EIP39788: Display proper messages for ElTorito CDs.

    Version 62, 5 February 2010
    • Bugfix in the FastBoot related changes added in the previous label.

    Version 61, 8 January 2010
    • OEMCFG.ASM: Modifications in timer_interrupt_int8, function made similar to the current Core8 implementation.
    • INT19.ASM:
      • Added enable_disable_nmi_far after accessing CMOS to preserve the NMI enable.
      • Added support for Fastboot. Stores boot device index in CMOS register 0x38.
    • BFIPORT.ASM:
      • Added UpdateUsbKbLed function, EIP#31467
      • Added code to skip mouse detection on FAST Boot
    • BIOSLIB.ASM: EIP24106: Disable NMI while accessing CMOS.

  • TCPA label TCPA_CSM16.55_07:
    • Tcpa.asm: Added measurement of BEV and BCV strings
    • Tcpa.asm: Changed for status check to return that we support TCG 1.21 specs (Conventional BIOS specs)
    • Tcpa_api.asm: Prevent logging of EV_NO_ACTION events to any PCR except 0
    • TPM32.INC: Update status check structure
    • Legdummy.asm: Added dummy function for tcpa_ReportBev_Bcv
    • mpdrv12.asm: Changes for fixing Buffer overflow condition when a small buffer is passed on transmit calls
    • tpm12.asm: Set Cmd Ready Bit before returning from pasthrough command call

  • SD label SD_CSM16.59_03
    • Ami Sign on Message added through SDL token
    • SDIO option rom variables moved to EBDA
    • Coding Standard followed
    • Ebda Memory allocation error checking done

  • Legacy Redirection label SREDIR_CSM53.20:
    • EIP 24065 and 24167: Serial redirection selection of 80X24 or 80X25 implemented based on setup question instead of BUILD token
    • Ref to EIP 24065 Comments #18 and #41 to have ideas on 24065 attached sredir source code overwrites the 24167 attached sredir.bin.

    Version 60, 23 September 2009
  • OEMCFG.ASM: Undoing the change in timer_interrupt_int8 made on 03/26/09. It has chipset specific code and causes "when CMOS is cleared with the jumper and booted into setup, the System Date's year would be wrong" problem.
  • BFIPORT.ASM, MBIOSEQU.EQU: Adding CSM16 OEM hook called on a write to LBA0 when virus protection is enabled.
  • INT15.ASM: Bugfix in INT15 fn 87 related to rt_cmos_skip_ga20_deactivation_bit
  • CDR.ASM
    • CDROMInvokeAPI - added checking for valid API; this fixes the problem of "accidental" CDROM code execution. This happens when WinPE PXE loader is executed prior to an attempt to boot to CD (CDR_BEV has an init code for CDROMInvokeAPI data structures)
    • Change in CDRLoadCDROMBootImage related to the situation where CD with boot catalog size/4 != 0; EIP#25305

    • Version 59, 16 July 2009
  • BFIBBS.ASM: Removed Tracker#194620 changes as it cause other issues and it's not needed to fix the tracker 194620; EIP#24123
  • BFIPORT.ASM: Nmi disabled SetMemoryInfoInCmos as Nmi Handler is not avilable; EIP#24106

    • Version 58, 20 June 2009
  • Modified the change made in ver 57 related to KBC output buffer read routine. Originally reported in EIP22161. Previously added timeout was not implemented correctly and caused problems with PS/2 mouse functionality.

    • Version 57, 15 June 2009
    • AHCI INT13
      • Bugfixes related to FreeDOS installation.Relevant EIPs: 22812 and 22958.
    • USB INT13
      • Hotplug devices information is properly obtained on INT13 entry.
    • BFIPORT.ASM
      • Undone the change made on 8/18/06: EIP15429.
    • KBC.ASM
      • Prevent dead loops in ob_full_read function. EIP22161.
    • AFD.ASM, CDATAPI.INC
      • AFD code is updated and made in sync with Core8.
    • JMP.ASM
      • Reserved 20h bytes at F000:E130 and 20h bytes at F000:E7F0.EIP11854.

    Version 56, 2 April 2009
    • RT-PCI.ASM, BFI.ASM
      • RT call get_last_pci_bus is modified to return the value from $EFI structure.
    • BFIBBS.ASM
      • Fix for Tracker#194620 "Boot order mismatch when the first boot device isn't bootable".
    • OEMCFG.ASM
      • Removed Y2K checking from timer interrupt.

    Version 55, 9 December 2008
    • JMP.ASM, CF.ASM
      • AMI address and copyright message corrected
    • CSP.ASM
      • OEM functions for enable and disable GA20, originally added in ver 53 for EIP#15997, are moved from CSM16 to LegacyBiosPlatform hook
    • NRUNTIME.ASM
      • Modified disable_addr_bit_20 - added option to skip disabling GA20
    • INT15.ASM
      • Added option to skip disabling GA20 after executing function 87h
    • UI13PNP.ASM, BFIUSB.ASM
      • USB INT13 code is made optional, built as a separate binary UI13.BIN
    • BFI.ASM
      • Sorted out the GA20 control methods - KBC or Port92; only one left active depending on the bit FAST_GATE_A20_BIT in cs:misc_info
    • BFIPORT.ASM
      • Undone the change made in Ver. 51 related to PS/2 mouse detection
    • Note: version 54 is skipped; it is internal customer release
    Version 53, 17 October 08
    • BFI.ASM
      • Fixed the CPU mode issue during boot: TCPA call was unloading big real mode descriptors
    • BFIATA.ASM, TIANOBSP.SDL
      • FLOPTICAL support made optional
    • BFIBBS.ASM, BFIISR.ASM
      • EIP16613: added BAID BCV #11 (0-based) for 12-th BAID device
    • BFIUSB.ASM, AINT13.ASM
      • Added VDS support; needed for USB INT13 and AHCI INT13 when CPU paging is on (EMM386)
    • BFIUSB.EQU, JMP.ASM, INT16.INC
      • Added a call that updates USB keybard LEDs when PS/2 keyboard LEDs are changed
    • CDR.ASM
      • EIP10510: Change in CDR_BEV - save and restore IRQ status during CDRLoadCDROMBootImage
    • CSP.ASM, MBIOSEQU.EQU
      • EIP#15997: added OEM16 functions to control GA20
    Version 52, 23 September 08
    • OUT.ASM
      • Fixed PrtScn key INT05 functionality.
    • BFI.ASM, BFIPORT.ASM
      • Added code to clear base memory before executing INT19.
      • Added a choice of booting in Big Real mode or Normal Real mode, controlled through BIT5 of rt_cmos_byte variable.
    • BFIBBS.ASM
      • Change in MarkDevicesToSkip routine that updates boot priorities in BBS table.
      • Bugfix in GenerateBbsBootOrder routine.
    • BFIUSB.ASM
      • Code cleanup, getting it ready for independent USB INT13 implementation.
    • JMP.ASM
      • Company's address changed.
    • AHCI module updated to the label "AHCI.12_CSM16.52_05".
    • Serial redirection module is updated to the latest label "SREDIR_CSM36.13".
    Version 51, 12 August 08
    • BFIPORT.ASM
      • Modified GetMouseInformation function to return mouse related information according to the input provided in EFI_TO_LEGACY16_BOOT_TABLE_STRUC structure.
    • BFI.ASM, MBIOSEQU.EQU
      • Modified CSM16 entry point, added csm16proc call to provide the OEM hook for checking for the KBC presence.
      • Disable GA20 through KBC before boot; it is kept enabled through Port92.
    • Serial redirection module is updated to the latest label "SREDIR_CSM36.10".
    Version 50, 30 June 08
    • BIOSDATA.ASM
      • AttemptedIplBitmap (64bits) added to remember which device was attempted. Migrated from core8.
    • INT19.ASM:
      • Do not retry the boot failed devices again.
      • The AttemptedIplBitmap bit will be reset for floppy to retry again.
      • Removed drive reset (INT13 func 0) from read_floppy_winchester routine.
    • CDATAPI.INC:
      • When the AMT IDE-R CD Boot is requested along with SOL,system does not boot from the remote CD. If AMT IDE-R CD Boot is requested without SOL, it works fine.
    • NRUNTIME.ASM:
      • Reverted the change in ide_irq_isr_extra routine.
    • BFI.ASM:
      • Bugfix in csm16proc; situation with no OEM16 data was not handled properly.
    • BFI.EQU:
      • Modified LEGACY16_TO_EFI_DATA_TABLE_STRUC structure: added field wBaidRmdVectorCntOfs that will return the offset of baid_rmd_vector_cnt variable.
    • BFIPORT.ASM, BFIUSB.ASM, BFIISR.ASM, BFIBBS.ASM:
      • Isolated USB code in BFIUSB.ASM
    • BFIINIT.ASM:
      • Initialized LEGACY16_TO_EFI_DATA_TABLE_STRUC.wBaidRmdVectorCntOfs with the offset of baid_rmd_vector_cnt variable.
    Version 49, 14 June 08
    • BFIUSB.ASM, BFIUSB.EQU:
      • Support for 720K floppy; Note:requires a change in USB driver as well.
    • PMM.ASM:
      • (EIP14012) PMM function 0 length=0 did not return the maximum free memory size in some cases. find_largest_free_memory failed to use top of conventional memory if the last entry of PMM is out of range.
    Version 48, 10 June 08
    • BfiBbs.asm:
      • Added CheckDoNotBootDevices_FAR to create placeholders for the devices with DO_NOT_BBOT_FROM priorities.
    • INT19.ASM, MBIOSEQU.EQU:
      • Added BeforeCallingBootVector_FAR function call.
    • AHCI
      • Changed to the latest Core8 AHCI source reference; to be used with AHCI label "4.6.3_AhciSrc_008".
    Version 47, 9 May 08
    • Load big real mode descriptors before INT19
    • PMM initialization bugfix; if memory is 2GB or more, high memory PMM area was not initialized
    • Changed Boot Failure message to match Core8, more clean and meaningful
    • Extended the PATH field of ExtI13DriveInfo by 8 bytes, according to EDD3.0
    • AHCI: Added call AhciCDGetLastStatus to implement the proper delay for CDROMs that respond slowly
    • AHCI: Reassign stack to avoid problems related to caller's stack size (too tight)
    • AHCI: INT13 func 48 - changed buffer size by 8 bytes, according to EDD3.0
    • Function 30: added the following subfunctions:
      • F5 - SECURITY_FREEZE_LOCK
      • F2 - SECURITY_UNLOCK
      • E7 - FLUSH_CACHE
    • AHCI: Added support for S3 resume
    Version 46, 14 April 08
    • undone modification from Ver 45 related to ob_full timeout
    • AHCI change: S3 and security support in AHCI
    • TCPA change: Don't log events if TCPA is deactivated
    • TCPA change: Set and Release Locality after every call
    • TCPA change: If TCPA Shutdown; Reset is required for the TCPA legacy calls to become available
    • TCPA change: Remove measurement of Separators from Legacy aspect to EFI aspect of TCG module
    Version 45
    • Extended the buffer reported by INT13 func 48 according to EDD3.0
    • Reduced the usage of stack in HW interrupt handler
    • Changed ob_full routine from infinite loop to timed-out loop
    • Modified INT13 return path so that FN26 will not restore DX
    • Added WaitForFisRecRun_API routine in CSM16 API
    • FLEXBOOT related modifications
    Version 44
    • Compliance with CSM Specification ver 0.97
    • Report USB Host Controller PCI Bus/Dev/Func in BBS table as well as in INT13 func 48
    • USB INT13 func 50 implemented
    • Patch for TSE when it boots through Boot Override, and priorities for other-than-boot-from devices are set to DONOT_BOOT_FROM
    • Implementation of INT13 func 30 to support Intel TurboMemory in AHCI mode
    • Bugfix in CDRInt13hFunction50 that implements INT13 func 50D7 call
    Version 43, 15 January 08
      Note: version 42 was only released for internal validation, below are the notes for 42 and 43
    • modified the method of execution of PnP functions external to CSM16; the earlier implementation failed for 16-bit protected mode PnP calls
    • GA20 is kept enabled before booting
    • AcquireUsbKeyboard call added in the end of PrepareToBoot function
    • Int1AIsr modified for 16-bit protected call support
    • Added initialization of LEGACY16_TO_EFI_DATA_TABLE_STRUC PTR.wAddedPnpFunctionsOfs
    • Added probe port 64h to AcquireUsbKeyboard and ReleaseUsbKeyboard that is needed for KBC emulation driver
    • Changes related to EIP11433; description of EIP11433: offboard NIC card should be displayed as "Legacy Network" and not in Hard Disk Drives type in TSE
    • Modification in NvCmosInit; this fixes the booting issue whith multiple CDROM drives configurations
    Version 41, 4 December 07
    • Change in init_fdd_qty routine that sets bit 0 of 40:10 in case of network boot
    • Placed an offset of Legacy16Data at F000:FF4C
    • Placed a call to CSM16_PROC at F000:FF70
    • Bugfix in init_fn48_buffer function
    • Removed the code that discards the data in the keyboard output data buffer
    • Bugfix in CreateIPLDT_FAR routine that did not work for the priority set to BBS_LOWEST_PRIORITY (0xFFFD)
    • Added INT13 func 15 for USB HDD type reporting
    • Removed INT1587_SCRATCH_PORT token override so that the default port 81h is used
    • Added AHCI module
    • PnP func 60 call is restored after it got removed in version 38
    • Removed EnableKeyboard call as it causes unnesessary delay, enabling/disabling PS/2 keyboard is done in PS/2 keyboard driver
    • Added two new fields in LEGACY16_TO_EFI_DATA_TABLE_STRUC structure: wCdrBevOffset and wCDROMSupportAPIOfs that allows the addition of external legacy CDROM support drivers
    • Modification in CDRInvokeCDROMAPI that allows API routines to be FAR, not NEAR
    • Added CSM16_OEM_AHCI_ACCESSHBA API definition
    Version 40, 28 September 07
    • Fix for EIP 9583, restore/unmask CD interrupt
    • PnP functions 55..57 are directed to possible OEM implementation
    • Removed memory manager uninstall from PrepareToBoot, it causes problems if memory is allocated after PrepareToBoot is called
    • Added and initialized dSmiFlashTableAddress field in LEGACY16_TO_EFI_DATA_TABLE_STRUC structure
    • Added CSM16_OEM_ON_BOOT_FAIL call
    Version 39, 21 August 07
    • ZIP emulation (FDD/HDD) code added
    • Bugfix in ConfigureHddParameter routine Tracker#31477, bug was introduced in ver 37
    • Added make_led_on call in Boot_FAR to sync keyboard's LEDs with BDA
    • Removed SMBIOS PnP code, implemented in SMBIOS EFI driver
    • Added CSM16_OEM_BEFORE_SWSMI and CSM16_OEM_AFTER_SWSMI calls
    • Added HDD-emulated ZIP(ATAPI) initialization in InitAtaAtapiDevices
    • Serial Redirection module updated to label SREDIR_CSM36.04
    Version 38, 13 July 07
    • bugfix in handling non-BBS compliant Option ROMs, introduction of I19_TRAP bit in misc_info
    • WREAD routine address alignment checking is changed from WORD to DWORD
    • PnP functions 50..52 implementation
    • SREDIR module source is updated
    Version 37, 8 June 07
    • Added checking for no_usbmass_boot_bit bit
    • Removed initialization of BDA:kb_stat_flag
    • Changed the initialization value of misc_info flag
    • Added check_virus routine that prevents the writes to HDD's MBR if needed
    • Bugfix in ConfigureHddParameter routine
    • Bugfix in dim_func_CDROM routine that did not consider CDROMs created by OpROMs
    • Added 15 microseconds delay after generating software SMI
    Version 36, 9 May 07
    • Added BBS runtime function 60h that is required for several NIC OpROMs to be able to produce BEV
    • Change that allows booting to all the HDD, even those partitioned by other BIOSes with different translation algorithm
    • Added Legacy Serial Redirection eModule, build process generates SREDIR.BIN
    Earlier versions' release notes are available upon request.

    • © American Megatrends Inc.


Release Notes - NDA Required

Component Information:
Component Title: Compatibility Support Module
Component Reference Name: CSM
Component Type: eModule
Release Date: 2011-08-18
Source Control Label: 4.6.3.1_CSM.7.67_77
Source Control Location: SS: ALASKA;$/Alaska/Source/Modules/CSM/Generic;

Dependencies
N0NE
Non-Compiled BIN and LIB File(s) within this Component:

Amilegacy16.bin
Component Title: CSM16 Binary
Component Reference Name: CSM16
Component Source Control Label: 4.6.3.1_CSM.7.65_76
Component Source Control Location: SS: ALASKA;$/Alaska/Source/Modules/CSM/Generic;
Project Source Control Label: 8.00.10.00.0x.65
Project Source Control Location: SS: ALASKA;$/Alaska/SOURCE/Modules/CSM/Generic/CSM16
Component Description:
This component, termed as "CSM" is a collection of sub-components assembled together to make an EFI project capable of:
  • launching Legacy Option ROMs
  • performing Legacy Boot
  • executing 16-bit code and 16-bit interrupt handlers
Filename | Description
CSM | Root\Board\em\CSM
csm.cif | CSM component information
csm.sdl | CSM parameters
csm.chm | This file
CSM Core | Root\Core\em\CSM - LegacyBios and LegacyBiosPlatrform protocols implementation
csmcore.cif | CSM Core component information
csm.dxs | LegacyBios and LegacyBiosPlatform protocols dependency expressions
csm.mak | CSM make file
csm.h | Local CSM definitions header file
csm.c | CSM initialization, protocols installation, callbacks registration code
csmoprom.c | Legacy Option ROM handling routines
biosdata.h | BDA (BIOS Data Area) structure definition
csmhwinfo.c | Hardware information routines
pciinterrupts.c | PCI routing functions
pciinfo.asm | The purpose of this file is to include PCI bus translation table generated by AMISDL
oempir.dat | Data file that contains "$PIR" header followed by the PCI routing table generated by AMISDL
csmbsp.c | LegacyBiosPlatform protocol implementation functions
csmlib.c | Various internal CSM functions implementation
csmsimplein.c | CSM SimpleTextIn protocol implementation
CSM Thunk | Root\Core\em\CSM\Thunk
thunk.cif | CSM Thunk Component Information file, contains several thunk drivers references listed below
x86 Thunk | Root\Core\em\CSM\Thunk\x86 - 16-bit code execution routines
x86thunk.cif | x86 thunk component information
thunk.c | Implementation of FarCall86 and Int86 functions of LegacyBios protocol
x86thunk.asm | CPU mode switching routines
x86thunk.mak | Rules to make FFS binary out of x86thunk.asm
INT13 (BiosBlockIo) | Root\Core\em\CSM\Thunk\BlockIo - INT13 thunk driver
Int13Thunk.cif | BiosBlockIo driver component information
CsmInt13.c | BiosBlockIo I/O operations implementation through BIOS INT13 functions
CsmBlkIoComponentName.c | ComponentName protocol implementation of the BiosBlockIo driver
CsmBlockIo.c | BiosBlockIo entry point and binding protocol function implementation: Supported/Start/Stop
CsmBlockIo.h | Definitions
CsmBlockIo.sdl | Driver parameters
CsmEdd.h | EDD related definitions
biosblkio.mak | Driver building make file
SNP16 | Root\Core\em\CSM\Thunk\SNP16
snp16.cif | Network Thunk Driver component information file (currently empty)
CsmVideo | Root\Core\em\CSM\Thunk\CsmVideo - INT10 thunk driver
CsmVideo.cif | CSM Thunk video driver component information
CsmVideo.sdl | CSM Thunk video driver configuration
CsmVideo.mak | CSM Thunk video driver make file
UefiBiosVideo.h | Definitions
UefiBiosVideo.c | Driver entry point and binding protocol functions (Supported/Start/Stop)
ComponentName.c | Driver name protocol implementation
VesaBiosExtensions.h | VESA definitions
pci22.h | PCI definitions
AmiMapping.h | Mapping of some of the Tiano definitions onto AMI framework
AmiMapping.c | Mapping of some of the Tiano functions onto AMI framework
VgaMiniPort.h | VGA Mini port binding definitions
VgaClass.h | Generic VGA driver definitions
VgaClass.c | Generic VGA driver implementation
CSM16 OEM hooks | Root\Board\em\CSM - OEM 16-bit functions support
csmoem.cif | Component information
MBIOSMAC.MAC | Macros used for OEM functions definition
MBIOSEQU.EQU | Equates of the available OEM 16-bit function IDs
csmoem.sdl | OEM functions support master token, parent eLinks definition
oem16sig.asm | Data file that populates "$OEM$FUN" signature in the OEM data area
CSM16 binaries | Root\Addon
csm16.cif | Component information
Amilegacy16.bin | CSM16 binary
Pxebase.lom | PXE base code binary
LegacyInterrupt | Root\Chipset\SB\CSM\LegacyInterrupt
LegacyInterrupt.cif | LegacyInterrupt component information
LegacyInterrupt.sdl | LegacyInterrupt driver parameters
LegacyInterrupt.mak | LegacyInterrupt driver make file
LegacyInterrupt.c | LegacyInterrupt driver implementation
LegacyInterrupt.dxs | LegacyInterrupt driver depenencies
CSM NB-Template | Root\Chipset\NB\CSM\LegacyRegion
LegacyRegion.cif | LegacyRegion component information
LegacyRegion.sdl | LegacyRegion driver parameters
LegacyRegion.mak | LegacyRegion driver make file
LegacyRegion.c | LegacyRegion driver implementation
LegacyRegion.dxs | LegacyRegion driver depenencies
CSM Protocols | Root\Include\Protocol
CsmProtocols.cif | Component information
LegacyInterrupt.h | LegacyInterrupt protocol definitions
LegacyResion.h | LegacyRegion protocol definitions
LegacyBiosPlatform.h | LegacyBiosPlatform protocol definitions
CsmPlatform.h | CsmPlatform protocol definitions
LegacyBiosExt.h | LegacyBiosExt (AMI extension of LegacyBios) protocol definitions
CsmVideoPolicy.h | CsmVideoPolicy protocol definitions
CSM Setup | Root\Board\em\CSM
csmsetup.cif | Component information
csm.uni | CSM setup strings definition
csm.sd | CSM setup data definitions
csmsetup.c | CSM setup functions
AMI Build Tools:
Tools Label: 4.5.5_TOOLS_32, Dated: 2010-04
Visual eBios: RSS.5.69.0137, Dated: 2010-04-20
Compiler Tool(s):
- Microsoft® Windows Driver Kit (WDK) Ver. 7600.16385.1
- Microsoft® Macro Assembler Version 6.15.8803
- Microsoft® Segmented Executable Linker Version 5.60.339 Dec 5 1994
New features added in this label:
- All porting functions defined in CsmBsp.c have been replaced with eLinks. OEM code does not have to be present in CsmBsp.c, making this file private. Instead, OEMs can implement their code in OEM files and link these files with CspLib.
Note: this feature is optional, should OEMs choose to keep CsmBsp.c private, no modifications would be necessary for the existing code.(EIP50327)
- Improvements in the video thunk driver (EIP55943,52264):
    - video output speed is increased after BLT function optimization
    - added support for 16-bit video modes
- $EFI structure in AMI's CSM16 had LastOpromAddress field that is outside of the scope of CSM specification; it has been removed.
General Bug Fixes:
EIP49781 - Setup strings misspelling corrections
EIP48212 - The improved implementation of CheckEnablePciSiblings; it enables all PCI devices with the same VID/DID because most of the Option ROMs expect that
EIP56792 - The meaning and functionality of FLEX_BOOT token is depreciated, it has been replaced with the new BDS boot device grouping features available in Core 4.06.04.
Note: For backward compatibility the functionality of FLEX_BOOT token remains unchanged if Core version is less than 4.06.04.
EIP addressed in this label:
EIP54262 - Modification CheckPciRom that sometimes does not return the proper PCI ROM Status
EIP51947 - Change the handling of Option ROMs that trap INT19
EIP47379 - For multiple images in the Option ROM, if the 1st image in not IA32 type, the IA32 image will not be found
EIP50206 - Calls to Get16BitFuncAddress() can hang the system when CSM_OEM_SUPPORT is disabled: disabling CSM_OEM_SUPPORT and calling Get16BitFuncAddress() will hang the system because gCsm16FuncAddress is NULL (uninitialized) and gCsm16FuncAddress is dereferenced
EIP48471 - COM Port addresses are not filled in correctly in BDA when COM 0(First COM port) disabled in setup
EIP44553 - PCI recovery card is disabled during its Option ROM execution
EIP52322 - Projects with two or more PCI 3.0 embedded ROMs: if ROM's Device List all support one device, only one option ROM would be invoked
EIP50111 - TPL asserts in some legacy free projects during LegacyBoot
Files changed for EIP fixes:
CsmOprom.c (EIP54262, EIP47379, EIP48212)
CsmOpROM.C, AmiLegacy16.bin (EIP51947)
Csm.c (EIP50206)
CsmHwInfo.c (EIP53139, EIP48471)
PciInterrupts.c, CsmBlkIo.c (EIP44553)
CsmLib.c (EIP52322)
thunk.c (EIP50111)
Known issues and limitations in this label:
- $EFI structure in AMI's CSM16 has LastOpromAddress field that is outside of the scope of CSM specification. It will be removed in the next release
- The reference to the previous CSM release notes is not implemented this release
- AMIBCP can not modify PCI IRQ table if PCI Bus driver version is 2.40 or above
Remaining Issues:
- N/A
Unit Testing:
UNIT TESTING DOCUMENT DONE BY ENGINEERING
Validation Testing:
BQA CSM Test Procedure
BQA TESTING RESULTS (1st run)
BQA TESTING RESULTS (2nd run)
Release History:
Previously Released Versions reference is currently unavailable

© American Megatrends Inc.