OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
LegacyBios.h File Reference

Go to the source code of this file.

Data Structures

struct  EFI_COMPATIBILITY16_TABLE
 
struct  EFI_DISPATCH_OPROM_TABLE
 
struct  EFI_TO_COMPATIBILITY16_INIT_TABLE
 
struct  DEVICE_PRODUCER_SERIAL
 
struct  DEVICE_PRODUCER_PARALLEL
 @) More...
 
struct  DEVICE_PRODUCER_FLOPPY
 
struct  LEGACY_DEVICE_FLAGS
 
struct  DEVICE_PRODUCER_DATA_HEADER
 
struct  ATAPI_IDENTIFY
 
struct  HDD_INFO
 
struct  BBS_STATUS_FLAGS
 
struct  BBS_TABLE
 
struct  SMM_ATTRIBUTES
 
struct  SMM_FUNCTION
 
struct  SMM_ENTRY
 
struct  SMM_TABLE
 
struct  UDC_ATTRIBUTES
 
struct  UD_TABLE
 
struct  EFI_TO_COMPATIBILITY16_BOOT_TABLE
 
struct  EFI_LEGACY_INSTALL_PCI_HANDLER
 
struct  EFI_EFLAGS_REG
 
struct  EFI_DWORD_REGS
 
struct  EFI_FLAGS_REG
 
struct  EFI_WORD_REGS
 
struct  EFI_BYTE_REGS
 
union  EFI_IA32_REGISTER_SET
 
struct  _EFI_LEGACY_BIOS_PROTOCOL
 

Macros

#define EFI_COMPATIBILITY16_TABLE_SIGNATURE   SIGNATURE_32 ('I', 'F', 'E', '$')
 
#define HDD_PRIMARY   0x01
 
#define HDD_SECONDARY   0x02
 
#define HDD_MASTER_ATAPI_CDROM   0x04
 
#define HDD_SLAVE_ATAPI_CDROM   0x08
 
#define HDD_MASTER_IDE   0x20
 
#define HDD_SLAVE_IDE   0x40
 
#define HDD_MASTER_ATAPI_ZIPDISK   0x10
 
#define HDD_SLAVE_ATAPI_ZIPDISK   0x80
 
#define EFI_TO_LEGACY_MAJOR_VERSION   0x02
 
#define EFI_TO_LEGACY_MINOR_VERSION   0x00
 
#define MAX_IDE_CONTROLLER   8
 
#define EFI_LEGACY_BIOS_PROTOCOL_GUID
 
#define NO_ROM   0x00
 
#define ROM_FOUND   0x01
 
#define VALID_LEGACY_ROM   0x02
 
#define ROM_WITH_CONFIG   0x04
 Not defined in the Framework CSM Specification.
 
#define CARRY_FLAG   0x01
 
#define ACCESS_PAGE0_CODE(statements)
 
#define DEVICE_SERIAL_MODE_NORMAL   0x00
 
#define DEVICE_SERIAL_MODE_IRDA   0x01
 
#define DEVICE_SERIAL_MODE_ASK_IR   0x02
 
#define DEVICE_SERIAL_MODE_DUPLEX_HALF   0x00
 
#define DEVICE_SERIAL_MODE_DUPLEX_FULL   0x10
 
#define DEVICE_PARALLEL_MODE_MODE_OUTPUT_ONLY   0x00
 
#define DEVICE_PARALLEL_MODE_MODE_BIDIRECTIONAL   0x01
 
#define DEVICE_PARALLEL_MODE_MODE_EPP   0x02
 
#define DEVICE_PARALLEL_MODE_MODE_ECP   0x03
 
#define BBS_FLOPPY   0x01
 
#define BBS_HARDDISK   0x02
 
#define BBS_CDROM   0x03
 
#define BBS_PCMCIA   0x04
 
#define BBS_USB   0x05
 
#define BBS_EMBED_NETWORK   0x06
 
#define BBS_BEV_DEVICE   0x80
 
#define BBS_UNKNOWN   0xff
 
#define BBS_DO_NOT_BOOT_FROM   0xFFFC
 
#define BBS_LOWEST_PRIORITY   0xFFFD
 
#define BBS_UNPRIORITIZED_ENTRY   0xFFFE
 
#define BBS_IGNORE_ENTRY   0xFFFF
 
#define STANDARD_IO   0x00
 
#define STANDARD_MEMORY   0x01
 
#define PORT_SIZE_8   0x00
 
#define PORT_SIZE_16   0x01
 
#define PORT_SIZE_32   0x02
 
#define PORT_SIZE_64   0x03
 
#define DATA_SIZE_8   0x00
 
#define DATA_SIZE_16   0x01
 
#define DATA_SIZE_32   0x02
 
#define DATA_SIZE_64   0x03
 
#define INT15_D042   0x0000
 
#define GET_USB_BOOT_INFO   0x0001
 
#define DMI_PNP_50_57   0x0002
 
#define STANDARD_OWNER   0x0
 
#define OEM_OWNER   0x1
 
#define EFI_SEGMENT(_Adr)
 
#define EFI_OFFSET(_Adr)
 

Typedefs

typedef UINT8 SERIAL_MODE
 
typedef UINT8 PARALLEL_MODE
 
typedef struct _EFI_LEGACY_BIOS_PROTOCOL EFI_LEGACY_BIOS_PROTOCOL
 
typedef BOOLEAN(EFIAPI * EFI_LEGACY_BIOS_INT86) (IN EFI_LEGACY_BIOS_PROTOCOL *This, IN UINT8 BiosInt, IN OUT EFI_IA32_REGISTER_SET *Regs)
 
typedef BOOLEAN(EFIAPI * EFI_LEGACY_BIOS_FARCALL86) (IN EFI_LEGACY_BIOS_PROTOCOL *This, IN UINT16 Segment, IN UINT16 Offset, IN EFI_IA32_REGISTER_SET *Regs, IN VOID *Stack, IN UINTN StackSize)
 
typedef EFI_STATUS(EFIAPI * EFI_LEGACY_BIOS_CHECK_ROM) (IN EFI_LEGACY_BIOS_PROTOCOL *This, IN EFI_HANDLE PciHandle, OUT VOID **RomImage, OPTIONAL OUT UINTN *RomSize, OPTIONAL OUT UINTN *Flags)
 
typedef EFI_STATUS(EFIAPI * EFI_LEGACY_BIOS_INSTALL_ROM) (IN EFI_LEGACY_BIOS_PROTOCOL *This, IN EFI_HANDLE PciHandle, IN VOID **RomImage, OUT UINTN *Flags, OUT UINT8 *DiskStart, OPTIONAL OUT UINT8 *DiskEnd, OPTIONAL OUT VOID **RomShadowAddress, OPTIONAL OUT UINT32 *ShadowedRomSize OPTIONAL)
 
typedef EFI_STATUS(EFIAPI * EFI_LEGACY_BIOS_BOOT) (IN EFI_LEGACY_BIOS_PROTOCOL *This, IN BBS_BBS_DEVICE_PATH *BootOption, IN UINT32 LoadOptionsSize, IN VOID *LoadOptions)
 
typedef EFI_STATUS(EFIAPI * EFI_LEGACY_BIOS_UPDATE_KEYBOARD_LED_STATUS) (IN EFI_LEGACY_BIOS_PROTOCOL *This, IN UINT8 Leds)
 
typedef EFI_STATUS(EFIAPI * EFI_LEGACY_BIOS_GET_BBS_INFO) (IN EFI_LEGACY_BIOS_PROTOCOL *This, OUT UINT16 *HddCount, OUT HDD_INFO **HddInfo, OUT UINT16 *BbsCount, IN OUT BBS_TABLE **BbsTable)
 
typedef EFI_STATUS(EFIAPI * EFI_LEGACY_BIOS_PREPARE_TO_BOOT_EFI) (IN EFI_LEGACY_BIOS_PROTOCOL *This, OUT UINT16 *BbsCount, OUT BBS_TABLE **BbsTable)
 
typedef EFI_STATUS(EFIAPI * EFI_LEGACY_BIOS_BOOT_UNCONVENTIONAL_DEVICE) (IN EFI_LEGACY_BIOS_PROTOCOL *This, IN UDC_ATTRIBUTES Attributes, IN UINTN BbsEntry, IN VOID *BeerData, IN VOID *ServiceAreaData)
 
typedef EFI_STATUS(EFIAPI * EFI_LEGACY_BIOS_SHADOW_ALL_LEGACY_OPROMS) (IN EFI_LEGACY_BIOS_PROTOCOL *This)
 
typedef EFI_STATUS(EFIAPI * EFI_LEGACY_BIOS_GET_LEGACY_REGION) (IN EFI_LEGACY_BIOS_PROTOCOL *This, IN UINTN LegacyMemorySize, IN UINTN Region, IN UINTN Alignment, OUT VOID **LegacyMemoryAddress)
 
typedef EFI_STATUS(EFIAPI * EFI_LEGACY_BIOS_COPY_LEGACY_REGION) (IN EFI_LEGACY_BIOS_PROTOCOL *This, IN UINTN LegacyMemorySize, IN VOID *LegacyMemoryAddress, IN VOID *LegacyMemorySourceAddress)
 

Enumerations

enum  EFI_COMPATIBILITY_FUNCTIONS {
  Legacy16InitializeYourself = 0x0000 , Legacy16UpdateBbs = 0x0001 , Legacy16PrepareToBoot = 0x0002 , Legacy16Boot = 0x0003 ,
  Legacy16RetrieveLastBootDevice = 0x0004 , Legacy16DispatchOprom = 0x0005 , Legacy16GetTableAddress = 0x0006 , Legacy16SetKeyboardLeds = 0x0007 ,
  Legacy16InstallPciHandler = 0x0008
}
 

Variables

EFI_GUID gEfiLegacyBiosProtocolGuid
 

Detailed Description

The EFI Legacy BIOS Protocol is used to abstract legacy Option ROM usage under EFI and Legacy OS boot. This file also includes all the related COMPATIBILIY16 structures and defintions.

Note: The names for EFI_IA32_REGISTER_SET elements were picked to follow well known naming conventions.

Thunk is the code that switches from 32-bit protected environment into the 16-bit real-mode environment. Reverse thunk is the code that does the opposite.

Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License that accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php.

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

Revision Reference:
This protocol is defined in Framework for EFI Compatibility Support Module spec Version 0.98.

Definition in file LegacyBios.h.

Macro Definition Documentation

◆ ACCESS_PAGE0_CODE

#define ACCESS_PAGE0_CODE ( statements)
Value:
do { \
EFI_STATUS Status_; \
EFI_GCD_MEMORY_SPACE_DESCRIPTOR Desc_; \
\
Desc_.Attributes = 0; \
Status_ = gDS->GetMemorySpaceDescriptor (0, &Desc_); \
ASSERT_EFI_ERROR (Status_); \
if ((Desc_.Attributes & EFI_MEMORY_RP) != 0) { \
Status_ = gDS->SetMemorySpaceAttributes ( \
0, \
EFI_PAGES_TO_SIZE(1), \
Desc_.Attributes & ~(UINT64)EFI_MEMORY_RP \
); \
ASSERT_EFI_ERROR (Status_); \
} \
\
{ \
statements; \
} \
\
if ((Desc_.Attributes & EFI_MEMORY_RP) != 0) { \
Status_ = gDS->SetMemorySpaceAttributes ( \
0, \
EFI_PAGES_TO_SIZE(1), \
Desc_.Attributes \
); \
ASSERT_EFI_ERROR (Status_); \
} \
} while (FALSE)

Definition at line 1524 of file LegacyBios.h.

◆ BBS_BEV_DEVICE

#define BBS_BEV_DEVICE   0x80

Definition at line 733 of file LegacyBios.h.

◆ BBS_CDROM

#define BBS_CDROM   0x03

Definition at line 729 of file LegacyBios.h.

◆ BBS_DO_NOT_BOOT_FROM

#define BBS_DO_NOT_BOOT_FROM   0xFFFC

BBS boot priority values

Definition at line 740 of file LegacyBios.h.

◆ BBS_EMBED_NETWORK

#define BBS_EMBED_NETWORK   0x06

Definition at line 732 of file LegacyBios.h.

◆ BBS_FLOPPY

#define BBS_FLOPPY   0x01

BBS device type values

Definition at line 727 of file LegacyBios.h.

◆ BBS_HARDDISK

#define BBS_HARDDISK   0x02

Definition at line 728 of file LegacyBios.h.

◆ BBS_IGNORE_ENTRY

#define BBS_IGNORE_ENTRY   0xFFFF

Definition at line 743 of file LegacyBios.h.

◆ BBS_LOWEST_PRIORITY

#define BBS_LOWEST_PRIORITY   0xFFFD

Definition at line 741 of file LegacyBios.h.

◆ BBS_PCMCIA

#define BBS_PCMCIA   0x04

Definition at line 730 of file LegacyBios.h.

◆ BBS_UNKNOWN

#define BBS_UNKNOWN   0xff

Definition at line 734 of file LegacyBios.h.

◆ BBS_UNPRIORITIZED_ENTRY

#define BBS_UNPRIORITIZED_ENTRY   0xFFFE

Definition at line 742 of file LegacyBios.h.

◆ BBS_USB

#define BBS_USB   0x05

Definition at line 731 of file LegacyBios.h.

◆ CARRY_FLAG

#define CARRY_FLAG   0x01

Definition at line 1018 of file LegacyBios.h.

◆ DATA_SIZE_16

#define DATA_SIZE_16   0x01

Definition at line 792 of file LegacyBios.h.

◆ DATA_SIZE_32

#define DATA_SIZE_32   0x02

Definition at line 793 of file LegacyBios.h.

◆ DATA_SIZE_64

#define DATA_SIZE_64   0x03

Definition at line 794 of file LegacyBios.h.

◆ DATA_SIZE_8

#define DATA_SIZE_8   0x00

SMM_ATTRIBUTES data size constants.

Definition at line 791 of file LegacyBios.h.

◆ DEVICE_PARALLEL_MODE_MODE_BIDIRECTIONAL

#define DEVICE_PARALLEL_MODE_MODE_BIDIRECTIONAL   0x01

Definition at line 485 of file LegacyBios.h.

◆ DEVICE_PARALLEL_MODE_MODE_ECP

#define DEVICE_PARALLEL_MODE_MODE_ECP   0x03

Definition at line 487 of file LegacyBios.h.

◆ DEVICE_PARALLEL_MODE_MODE_EPP

#define DEVICE_PARALLEL_MODE_MODE_EPP   0x02

Definition at line 486 of file LegacyBios.h.

◆ DEVICE_PARALLEL_MODE_MODE_OUTPUT_ONLY

#define DEVICE_PARALLEL_MODE_MODE_OUTPUT_ONLY   0x00

DEVICE_PRODUCER_PARALLEL's modes.

Definition at line 484 of file LegacyBios.h.

◆ DEVICE_SERIAL_MODE_ASK_IR

#define DEVICE_SERIAL_MODE_ASK_IR   0x02

Definition at line 466 of file LegacyBios.h.

◆ DEVICE_SERIAL_MODE_DUPLEX_FULL

#define DEVICE_SERIAL_MODE_DUPLEX_FULL   0x10

Definition at line 468 of file LegacyBios.h.

◆ DEVICE_SERIAL_MODE_DUPLEX_HALF

#define DEVICE_SERIAL_MODE_DUPLEX_HALF   0x00

Definition at line 467 of file LegacyBios.h.

◆ DEVICE_SERIAL_MODE_IRDA

#define DEVICE_SERIAL_MODE_IRDA   0x01

Definition at line 465 of file LegacyBios.h.

◆ DEVICE_SERIAL_MODE_NORMAL

#define DEVICE_SERIAL_MODE_NORMAL   0x00

DEVICE_PRODUCER_SERIAL's modes.

Definition at line 464 of file LegacyBios.h.

◆ DMI_PNP_50_57

#define DMI_PNP_50_57   0x0002

Definition at line 810 of file LegacyBios.h.

◆ EFI_COMPATIBILITY16_TABLE_SIGNATURE

#define EFI_COMPATIBILITY16_TABLE_SIGNATURE   SIGNATURE_32 ('I', 'F', 'E', '$')

Definition at line 38 of file LegacyBios.h.

◆ EFI_LEGACY_BIOS_PROTOCOL_GUID

#define EFI_LEGACY_BIOS_PROTOCOL_GUID
Value:
{ \
0xdb9a1e3d, 0x45cb, 0x4abb, {0x85, 0x3b, 0xe5, 0x38, 0x7f, 0xdb, 0x2e, 0x2d } \
}

Definition at line 993 of file LegacyBios.h.

◆ EFI_OFFSET

#define EFI_OFFSET ( _Adr)
Value:
(UINT16) (((UINT16) ((UINTN) (_Adr))) & 0xffff)

Definition at line 1015 of file LegacyBios.h.

◆ EFI_SEGMENT

#define EFI_SEGMENT ( _Adr)
Value:
(UINT16) ((UINT16) (((UINTN) (_Adr)) >> 4) & 0xf000)

The following macros do not appear in the Framework CSM Specification and are kept for backward compatibility only. They convert 32-bit address (_Adr) to Segment:Offset 16-bit form.

Definition at line 1014 of file LegacyBios.h.

◆ EFI_TO_LEGACY_MAJOR_VERSION

#define EFI_TO_LEGACY_MAJOR_VERSION   0x02

Definition at line 925 of file LegacyBios.h.

◆ EFI_TO_LEGACY_MINOR_VERSION

#define EFI_TO_LEGACY_MINOR_VERSION   0x00

Definition at line 926 of file LegacyBios.h.

◆ GET_USB_BOOT_INFO

#define GET_USB_BOOT_INFO   0x0001

Definition at line 809 of file LegacyBios.h.

◆ HDD_MASTER_ATAPI_CDROM

#define HDD_MASTER_ATAPI_CDROM   0x04

Definition at line 581 of file LegacyBios.h.

◆ HDD_MASTER_ATAPI_ZIPDISK

#define HDD_MASTER_ATAPI_ZIPDISK   0x10

Definition at line 585 of file LegacyBios.h.

◆ HDD_MASTER_IDE

#define HDD_MASTER_IDE   0x20

Definition at line 583 of file LegacyBios.h.

◆ HDD_PRIMARY

#define HDD_PRIMARY   0x01

HDD_INFO status bits

Definition at line 579 of file LegacyBios.h.

◆ HDD_SECONDARY

#define HDD_SECONDARY   0x02

Definition at line 580 of file LegacyBios.h.

◆ HDD_SLAVE_ATAPI_CDROM

#define HDD_SLAVE_ATAPI_CDROM   0x08

Definition at line 582 of file LegacyBios.h.

◆ HDD_SLAVE_ATAPI_ZIPDISK

#define HDD_SLAVE_ATAPI_ZIPDISK   0x80

Definition at line 586 of file LegacyBios.h.

◆ HDD_SLAVE_IDE

#define HDD_SLAVE_IDE   0x40

Definition at line 584 of file LegacyBios.h.

◆ INT15_D042

#define INT15_D042   0x0000

SMM_FUNCTION Function constants.

Definition at line 808 of file LegacyBios.h.

◆ MAX_IDE_CONTROLLER

#define MAX_IDE_CONTROLLER   8

Definition at line 927 of file LegacyBios.h.

◆ NO_ROM

#define NO_ROM   0x00

Flags returned by CheckPciRom().

Definition at line 1003 of file LegacyBios.h.

◆ OEM_OWNER

#define OEM_OWNER   0x1

Definition at line 817 of file LegacyBios.h.

◆ PORT_SIZE_16

#define PORT_SIZE_16   0x01

Definition at line 783 of file LegacyBios.h.

◆ PORT_SIZE_32

#define PORT_SIZE_32   0x02

Definition at line 784 of file LegacyBios.h.

◆ PORT_SIZE_64

#define PORT_SIZE_64   0x03

Definition at line 785 of file LegacyBios.h.

◆ PORT_SIZE_8

#define PORT_SIZE_8   0x00

SMM_ATTRIBUTES port size constants.

Definition at line 782 of file LegacyBios.h.

◆ ROM_FOUND

#define ROM_FOUND   0x01

Definition at line 1004 of file LegacyBios.h.

◆ ROM_WITH_CONFIG

#define ROM_WITH_CONFIG   0x04

Not defined in the Framework CSM Specification.

Definition at line 1006 of file LegacyBios.h.

◆ STANDARD_IO

#define STANDARD_IO   0x00

SMM_ATTRIBUTES type values.

Definition at line 775 of file LegacyBios.h.

◆ STANDARD_MEMORY

#define STANDARD_MEMORY   0x01

Definition at line 776 of file LegacyBios.h.

◆ STANDARD_OWNER

#define STANDARD_OWNER   0x0

SMM_FUNCTION Owner constants.

Definition at line 816 of file LegacyBios.h.

◆ VALID_LEGACY_ROM

#define VALID_LEGACY_ROM   0x02

Definition at line 1005 of file LegacyBios.h.

Typedef Documentation

◆ EFI_LEGACY_BIOS_BOOT

typedef EFI_STATUS(EFIAPI * EFI_LEGACY_BIOS_BOOT) (IN EFI_LEGACY_BIOS_PROTOCOL *This, IN BBS_BBS_DEVICE_PATH *BootOption, IN UINT32 LoadOptionsSize, IN VOID *LoadOptions)

This function attempts to traditionally boot the specified BootOption. If the EFI context has been compromised, this function will not return. This procedure is not used for loading an EFI-aware OS off a traditional device. The following actions occur:

  • Get EFI SMBIOS data structures, convert them to a traditional format, and copy to Compatibility16.
  • Get a pointer to ACPI data structures and copy the Compatibility16 RSD PTR to F0000 block.
  • Find the traditional SMI handler from a firmware volume and register the traditional SMI handler with the EFI SMI handler.
  • Build onboard IDE information and pass this information to the Compatibility16 code.
  • Make sure all PCI Interrupt Line registers are programmed to match 8259.
  • Reconfigure SIO devices from EFI mode (polled) into traditional mode (interrupt driven).
  • Shadow all PCI ROMs.
  • Set up BDA and EBDA standard areas before the legacy boot.
  • Construct the Compatibility16 boot memory map and pass it to the Compatibility16 code.
  • Invoke the Compatibility16 table function Compatibility16PrepareToBoot(). This invocation causes a thunk into the Compatibility16 code, which sets all appropriate internal data structures. The boot device list is a parameter.
  • Invoke the Compatibility16 Table function Compatibility16Boot(). This invocation causes a thunk into the Compatibility16 code, which does an INT19.
  • If the Compatibility16Boot() function returns, then the boot failed in a graceful manner–meaning that the EFI code is still valid. An ungraceful boot failure causes a reset because the state of EFI code is unknown.
Parameters
[in]ThisThe protocol instance pointer.
[in]BootOptionThe EFI Device Path from BootXXXX variable.
[in]LoadOptionSizeThe size of LoadOption in size.
[in]LoadOptionLThe oadOption from BootXXXX variable.
Return values
EFI_DEVICE_ERRORFailed to boot from any boot device and memory is uncorrupted. Note: This function normally does not 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.

Definition at line 1284 of file LegacyBios.h.

◆ EFI_LEGACY_BIOS_BOOT_UNCONVENTIONAL_DEVICE

typedef EFI_STATUS(EFIAPI * EFI_LEGACY_BIOS_BOOT_UNCONVENTIONAL_DEVICE) (IN EFI_LEGACY_BIOS_PROTOCOL *This, IN UDC_ATTRIBUTES Attributes, IN UINTN BbsEntry, IN VOID *BeerData, IN VOID *ServiceAreaData)

To boot from an unconventional device like parties and/or execute HDD diagnostics.

Parameters
[in]ThisThe protocol instance pointer.
[in]AttributesHow to interpret the other input parameters.
[in]BbsEntryThe 0-based index into the BbsTable for the parent device.
[in]BeerDataA pointer to the 128 bytes of ram BEER data.
[in]ServiceAreaDataA pointer to the 64 bytes of raw Service Area data. The caller must provide a pointer to the specific Service Area and not the start all Service Areas.
Return values
EFI_INVALID_PARAMETERIf error. Does NOT return if no error.

Definition at line 1373 of file LegacyBios.h.

◆ EFI_LEGACY_BIOS_CHECK_ROM

typedef EFI_STATUS(EFIAPI * EFI_LEGACY_BIOS_CHECK_ROM) (IN EFI_LEGACY_BIOS_PROTOCOL *This, IN EFI_HANDLE PciHandle, OUT VOID **RomImage, OPTIONAL OUT UINTN *RomSize, OPTIONAL OUT UINTN *Flags)

Test to see if a legacy PCI ROM exists for this device. Optionally return the Legacy ROM instance for this PCI device.

Parameters
[in]ThisThe protocol instance pointer.
[in]PciHandleThe PCI PC-AT OPROM from this devices ROM BAR will be loaded
[out]RomImageReturn the legacy PCI ROM for this device.
[out]RomSizeThe size of ROM Image.
[out]FlagsIndicates if ROM found and if PC-AT. Multiple bits can be set as follows:
  • 00 = No ROM.
  • 01 = ROM Found.
  • 02 = ROM is a valid legacy ROM.
Return values
EFI_SUCCESSThe Legacy Option ROM available for this device
EFI_UNSUPPORTEDThe Legacy Option ROM is not supported.

Definition at line 1203 of file LegacyBios.h.

◆ EFI_LEGACY_BIOS_COPY_LEGACY_REGION

typedef EFI_STATUS(EFIAPI * EFI_LEGACY_BIOS_COPY_LEGACY_REGION) (IN EFI_LEGACY_BIOS_PROTOCOL *This, IN UINTN LegacyMemorySize, IN VOID *LegacyMemoryAddress, IN VOID *LegacyMemorySourceAddress)

Get a region from the LegacyBios for Tiano usage. Can only be invoked once.

Parameters
[in]ThisThe protocol instance pointer.
[in]LegacyMemorySizeThe size of data to copy.
[in]LegacyMemoryAddressThe Legacy Region destination address. Note: must be in region assigned by LegacyBiosGetLegacyRegion.
[in]LegacyMemorySourceAddressThe source of the data to copy.
Return values
EFI_SUCCESSThe Region assigned.
EFI_ACCESS_DENIEDDestination was outside an assigned region.

Definition at line 1442 of file LegacyBios.h.

◆ EFI_LEGACY_BIOS_FARCALL86

typedef BOOLEAN(EFIAPI * EFI_LEGACY_BIOS_FARCALL86) (IN EFI_LEGACY_BIOS_PROTOCOL *This, IN UINT16 Segment, IN UINT16 Offset, IN EFI_IA32_REGISTER_SET *Regs, IN VOID *Stack, IN UINTN StackSize)

Thunk to 16-bit real mode and call Segment:Offset. Regs will contain the 16-bit register context on entry and exit. Arguments can be passed on the Stack argument

Parameters
[in]ThisThe protocol instance pointer.
[in]SegmentThe segment of 16-bit mode call.
[in]OffsetThe offset of 16-bit mdoe call.
[in]RegRegister contexted passed into (and returned) from thunk to 16-bit mode.
[in]StackThe caller allocated stack used to pass arguments.
[in]StackSizeThe size of Stack in bytes.
Return values
FALSEThunk completed with no BIOS errors in the target code. See Regs for status.
TRUEThere was a BIOS error in the target code.

Definition at line 1175 of file LegacyBios.h.

◆ EFI_LEGACY_BIOS_GET_BBS_INFO

typedef EFI_STATUS(EFIAPI * EFI_LEGACY_BIOS_GET_BBS_INFO) (IN EFI_LEGACY_BIOS_PROTOCOL *This, OUT UINT16 *HddCount, OUT HDD_INFO **HddInfo, OUT UINT16 *BbsCount, IN OUT BBS_TABLE **BbsTable)

Retrieve legacy BBS info and assign boot priority.

Parameters
[in]ThisThe protocol instance pointer.
[out]HddCountThe number of HDD_INFO structures.
[out]HddInfoOnboard IDE controller information.
[out]BbsCountThe number of BBS_TABLE structures.
[in,out]BbsTablePoints to List of BBS_TABLE.
Return values
EFI_SUCCESSTables were returned.

Definition at line 1328 of file LegacyBios.h.

◆ EFI_LEGACY_BIOS_GET_LEGACY_REGION

typedef EFI_STATUS(EFIAPI * EFI_LEGACY_BIOS_GET_LEGACY_REGION) (IN EFI_LEGACY_BIOS_PROTOCOL *This, IN UINTN LegacyMemorySize, IN UINTN Region, IN UINTN Alignment, OUT VOID **LegacyMemoryAddress)

Get a region from the LegacyBios for S3 usage.

Parameters
[in]ThisThe protocol instance pointer.
[in]LegacyMemorySizeThe size of required region.
[in]RegionThe region to use. 00 = Either 0xE0000 or 0xF0000 block.
  • Bit0 = 1 0xF0000 block.
  • Bit1 = 1 0xE0000 block.
[in]AlignmentAddress alignment. Bit mapped. The first non-zero bit from right is alignment.
[out]LegacyMemoryAddressThe Region Assigned
Return values
EFI_SUCCESSThe Region was assigned.
EFI_ACCESS_DENIEDThe function was previously invoked.
OtherThe Region was not assigned.

Definition at line 1418 of file LegacyBios.h.

◆ EFI_LEGACY_BIOS_INSTALL_ROM

typedef EFI_STATUS(EFIAPI * EFI_LEGACY_BIOS_INSTALL_ROM) (IN EFI_LEGACY_BIOS_PROTOCOL *This, IN EFI_HANDLE PciHandle, IN VOID **RomImage, OUT UINTN *Flags, OUT UINT8 *DiskStart, OPTIONAL OUT UINT8 *DiskEnd, OPTIONAL OUT VOID **RomShadowAddress, OPTIONAL OUT UINT32 *ShadowedRomSize OPTIONAL)

Load a legacy PC-AT OPROM on the PciHandle device. Return information about how many disks were added by the OPROM and the shadow address and size. DiskStart & DiskEnd are INT 13h drive letters. Thus 0x80 is C:

Parameters
[in]ThisThe protocol instance pointer.
[in]PciHandleThe PCI PC-AT OPROM from this devices ROM BAR will be loaded. This value is NULL if RomImage is non-NULL. This is the normal case.
[in]RomImageA PCI PC-AT ROM image. This argument is non-NULL if there is no hardware associated with the ROM and thus no PciHandle, otherwise is must be NULL. Example is PXE base code.
[out]FlagsThe type of ROM discovered. Multiple bits can be set, as follows:
  • 00 = No ROM.
  • 01 = ROM found.
  • 02 = ROM is a valid legacy ROM.
[out]DiskStartThe disk number of first device hooked by the ROM. If DiskStart is the same as DiskEnd no disked were hooked.
[out]DiskEnddisk number of the last device hooked by the ROM.
[out]RomShadowAddressShadow address of PC-AT ROM.
[out]RomShadowSizeSize of RomShadowAddress in bytes.
Return values
EFI_SUCCESSThunk completed, see Regs for status.
EFI_INVALID_PARAMETERPciHandle not found

Definition at line 1240 of file LegacyBios.h.

◆ EFI_LEGACY_BIOS_INT86

typedef BOOLEAN(EFIAPI * EFI_LEGACY_BIOS_INT86) (IN EFI_LEGACY_BIOS_PROTOCOL *This, IN UINT8 BiosInt, IN OUT EFI_IA32_REGISTER_SET *Regs)

Thunk to 16-bit real mode and execute a software interrupt with a vector of BiosInt. Regs will contain the 16-bit register context on entry and exit.

Parameters
[in]ThisThe protocol instance pointer.
[in]BiosIntThe processor interrupt vector to invoke.
[in,out]RegRegister contexted passed into (and returned) from thunk to 16-bit mode.
Return values
TRUEThunk completed with no BIOS errors in the target code. See Regs for status.
FALSEThere was a BIOS error in the target code.

Definition at line 1152 of file LegacyBios.h.

◆ EFI_LEGACY_BIOS_PREPARE_TO_BOOT_EFI

typedef EFI_STATUS(EFIAPI * EFI_LEGACY_BIOS_PREPARE_TO_BOOT_EFI) (IN EFI_LEGACY_BIOS_PROTOCOL *This, OUT UINT16 *BbsCount, OUT BBS_TABLE **BbsTable)

Assign drive number to legacy HDD drives prior to booting an EFI aware OS so the OS can access drives without an EFI driver.

Parameters
[in]ThisThe protocol instance pointer.
[out]BbsCountThe number of BBS_TABLE structures
[out]BbsTableList of BBS entries
Return values
EFI_SUCCESSDrive numbers assigned.

Definition at line 1349 of file LegacyBios.h.

◆ EFI_LEGACY_BIOS_PROTOCOL

Definition at line 998 of file LegacyBios.h.

◆ EFI_LEGACY_BIOS_SHADOW_ALL_LEGACY_OPROMS

typedef EFI_STATUS(EFIAPI * EFI_LEGACY_BIOS_SHADOW_ALL_LEGACY_OPROMS) (IN EFI_LEGACY_BIOS_PROTOCOL *This)

Shadow all legacy16 OPROMs that haven't been shadowed. Warning: Use this with caution. This routine disconnects all EFI drivers. If used externally, then the caller must re-connect EFI drivers.

Parameters
[in]ThisThe protocol instance pointer.
Return values
EFI_SUCCESSOPROMs were shadowed.

Definition at line 1394 of file LegacyBios.h.

◆ EFI_LEGACY_BIOS_UPDATE_KEYBOARD_LED_STATUS

typedef EFI_STATUS(EFIAPI * EFI_LEGACY_BIOS_UPDATE_KEYBOARD_LED_STATUS) (IN EFI_LEGACY_BIOS_PROTOCOL *This, IN UINT8 Leds)

This function takes the Leds input parameter and sets/resets the BDA accordingly. Leds is also passed to Compatibility16 code, in case any special processing is required. This function is normally called from EFI Setup drivers that handle user-selectable keyboard options such as boot with NUM LOCK on/off. This function does not touch the keyboard or keyboard LEDs but only the BDA.

Parameters
[in]ThisThe protocol instance pointer.
[in]LedsThe status of current Scroll, Num & Cap lock LEDS:
  • Bit 0 is Scroll Lock 0 = Not locked.
  • Bit 1 is Num Lock.
  • Bit 2 is Caps Lock.
Return values
EFI_SUCCESSThe BDA was updated successfully.

Definition at line 1309 of file LegacyBios.h.

◆ PARALLEL_MODE

typedef UINT8 PARALLEL_MODE

Definition at line 36 of file LegacyBios.h.

◆ SERIAL_MODE

typedef UINT8 SERIAL_MODE

Definition at line 35 of file LegacyBios.h.

Enumeration Type Documentation

◆ EFI_COMPATIBILITY_FUNCTIONS

Functions provided by the CSM binary which communicate between the EfiCompatibility and Compatability16 code.

Inconsistent with the specification here: The member's name started with "Compatibility16" [defined in Intel Framework Compatibility Support Module Specification / 0.97 version] has been changed to "Legacy16" since keeping backward compatible.

Enumerator
Legacy16InitializeYourself 

Causes the Compatibility16 code to do any internal initialization required. Input: AX = Compatibility16InitializeYourself ES:BX = Pointer to EFI_TO_COMPATIBILITY16_INIT_TABLE Return: AX = Return Status codes

Legacy16UpdateBbs 

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 Return: AX = Returned status codes

Legacy16PrepareToBoot 

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 Return: AX = Returned status codes

Legacy16Boot 

Causes the Compatibility16 BIOS to boot. The Compatibility16 code is Read/Only. Input: AX = Compatibility16Boot Output: AX = Returned status codes

Legacy16RetrieveLastBootDevice 

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 BX = Priority number of the boot device.

Legacy16DispatchOprom 

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.

Legacy16GetTableAddress 

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 DS:BX = Address of the region

Legacy16SetKeyboardLeds 

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 NumLock Bit 2 Caps Lock Output: AX = Returned status codes

Legacy16InstallPciHandler 

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: AX = Returned status codes

Definition at line 267 of file LegacyBios.h.

Variable Documentation

◆ gEfiLegacyBiosProtocolGuid

EFI_GUID gEfiLegacyBiosProtocolGuid
extern