]>
Commit | Line | Data |
---|---|---|
b522c77b HW |
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 | |
6 | Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r | |
7 | \r | |
8 | SPDX-License-Identifier: BSD-2-Clause-Patent\r | |
9 | \r | |
10 | **/\r | |
11 | \r | |
12 | #include "LegacyBiosInterface.h"\r | |
13 | \r | |
14 | /**\r | |
15 | Fill in the standard BDA and EBDA stuff before Legacy16 load\r | |
16 | \r | |
17 | @param Private Legacy BIOS Instance data\r | |
18 | \r | |
19 | @retval EFI_SUCCESS It should always work.\r | |
20 | \r | |
21 | **/\r | |
22 | EFI_STATUS\r | |
23 | LegacyBiosInitBda (\r | |
ac0a286f | 24 | IN LEGACY_BIOS_INSTANCE *Private\r |
b522c77b HW |
25 | )\r |
26 | {\r | |
ac0a286f MK |
27 | BDA_STRUC *Bda;\r |
28 | UINT8 *Ebda;\r | |
b522c77b | 29 | \r |
ac0a286f MK |
30 | Bda = (BDA_STRUC *)((UINTN)0x400);\r |
31 | Ebda = (UINT8 *)((UINTN)0x9fc00);\r | |
b522c77b HW |
32 | \r |
33 | ACCESS_PAGE0_CODE (\r | |
34 | ZeroMem (Bda, 0x100);\r | |
35 | //\r | |
36 | // 640k-1k for EBDA\r | |
37 | //\r | |
ac0a286f MK |
38 | Bda->MemSize = 0x27f;\r |
39 | Bda->KeyHead = 0x1e;\r | |
40 | Bda->KeyTail = 0x1e;\r | |
41 | Bda->FloppyData = 0x00;\r | |
42 | Bda->FloppyTimeout = 0xff;\r | |
b522c77b HW |
43 | \r |
44 | Bda->KeyStart = 0x001E;\r | |
45 | Bda->KeyEnd = 0x003E;\r | |
46 | Bda->KeyboardStatus = 0x10;\r | |
47 | Bda->Ebda = 0x9fc0;\r | |
48 | \r | |
49 | //\r | |
50 | // Move LPT time out here and zero out LPT4 since some SCSI OPROMS\r | |
51 | // use this as scratch pad (LPT4 is Reserved)\r | |
52 | //\r | |
ac0a286f MK |
53 | Bda->Lpt1_2Timeout = 0x1414;\r |
54 | Bda->Lpt3_4Timeout = 0x1400;\r | |
b522c77b | 55 | \r |
ac0a286f | 56 | );\r |
b522c77b HW |
57 | \r |
58 | ZeroMem (Ebda, 0x400);\r | |
59 | *Ebda = 0x01;\r | |
60 | \r | |
61 | return EFI_SUCCESS;\r | |
62 | }\r |