+++ /dev/null
-/** @file\r
- This code fills in BDA (0x400) and EBDA (pointed to by 0x4xx)\r
- information. There is support for doing initializeation before\r
- Legacy16 is loaded and before a legacy boot is attempted.\r
-\r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-**/\r
-\r
-#include "LegacyBiosInterface.h"\r
-\r
-/**\r
- Fill in the standard BDA and EBDA stuff before Legacy16 load\r
-\r
- @param Private Legacy BIOS Instance data\r
-\r
- @retval EFI_SUCCESS It should always work.\r
-\r
-**/\r
-EFI_STATUS\r
-LegacyBiosInitBda (\r
- IN LEGACY_BIOS_INSTANCE *Private\r
- )\r
-{\r
- BDA_STRUC *Bda;\r
- UINT8 *Ebda;\r
-\r
- Bda = (BDA_STRUC *) ((UINTN) 0x400);\r
- Ebda = (UINT8 *) ((UINTN) 0x9fc00);\r
-\r
- ACCESS_PAGE0_CODE (\r
- ZeroMem (Bda, 0x100);\r
- //\r
- // 640k-1k for EBDA\r
- //\r
- Bda->MemSize = 0x27f;\r
- Bda->KeyHead = 0x1e;\r
- Bda->KeyTail = 0x1e;\r
- Bda->FloppyData = 0x00;\r
- Bda->FloppyTimeout = 0xff;\r
-\r
- Bda->KeyStart = 0x001E;\r
- Bda->KeyEnd = 0x003E;\r
- Bda->KeyboardStatus = 0x10;\r
- Bda->Ebda = 0x9fc0;\r
-\r
- //\r
- // Move LPT time out here and zero out LPT4 since some SCSI OPROMS\r
- // use this as scratch pad (LPT4 is Reserved)\r
- //\r
- Bda->Lpt1_2Timeout = 0x1414;\r
- Bda->Lpt3_4Timeout = 0x1400;\r
-\r
- );\r
-\r
- ZeroMem (Ebda, 0x400);\r
- *Ebda = 0x01;\r
-\r
- return EFI_SUCCESS;\r
-}\r