]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBda.c
FmpDevicePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / IntelFrameworkModulePkg / Csm / LegacyBiosDxe / LegacyBda.c
CommitLineData
bcecde14 1/** @file\r
2 This code fills in BDA (0x400) and EBDA (pointed to by 0x4xx)\r
3 information. There is support for doing initializeation before\r
4 Legacy16 is loaded and before a legacy boot is attempted.\r
5\r
6Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
7\r
8This program and the accompanying materials\r
9are licensed and made available under the terms and conditions\r
10of the BSD License which accompanies this distribution. The\r
11full text of the license may be found at\r
12http://opensource.org/licenses/bsd-license.php\r
13\r
14THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
15WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
16\r
17**/\r
18\r
19#include "LegacyBiosInterface.h"\r
20\r
21/**\r
22 Fill in the standard BDA and EBDA stuff before Legacy16 load\r
23\r
24 @param Private Legacy BIOS Instance data\r
25\r
26 @retval EFI_SUCCESS It should always work.\r
27\r
28**/\r
29EFI_STATUS\r
30LegacyBiosInitBda (\r
31 IN LEGACY_BIOS_INSTANCE *Private\r
32 )\r
33{\r
34 BDA_STRUC *Bda;\r
35 UINT8 *Ebda;\r
36\r
37 Bda = (BDA_STRUC *) ((UINTN) 0x400);\r
38 Ebda = (UINT8 *) ((UINTN) 0x9fc00);\r
39\r
2ea3576e
JW
40 ACCESS_PAGE0_CODE (\r
41 ZeroMem (Bda, 0x100);\r
42 //\r
43 // 640k-1k for EBDA\r
44 //\r
45 Bda->MemSize = 0x27f;\r
46 Bda->KeyHead = 0x1e;\r
47 Bda->KeyTail = 0x1e;\r
48 Bda->FloppyData = 0x00;\r
49 Bda->FloppyTimeout = 0xff;\r
50\r
51 Bda->KeyStart = 0x001E;\r
52 Bda->KeyEnd = 0x003E;\r
53 Bda->KeyboardStatus = 0x10;\r
54 Bda->Ebda = 0x9fc0;\r
55\r
56 //\r
57 // Move LPT time out here and zero out LPT4 since some SCSI OPROMS\r
58 // use this as scratch pad (LPT4 is Reserved)\r
59 //\r
60 Bda->Lpt1_2Timeout = 0x1414;\r
61 Bda->Lpt3_4Timeout = 0x1400;\r
62\r
63 );\r
64\r
bcecde14 65 ZeroMem (Ebda, 0x400);\r
2ea3576e 66 *Ebda = 0x01;\r
d057d8c4 67\r
bcecde14 68 return EFI_SUCCESS;\r
69}\r