3 * Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
4 * Copyright (C) 2006 Aleksey Bragin <aleksey@reactos.org>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 ///////////////////////////////////////////////////////////////////////////////////////
25 // ReactOS Loading Functions
27 ///////////////////////////////////////////////////////////////////////////////////////
28 VOID
LoadAndBootWindows(PCSTR OperatingSystemName
,
30 USHORT OperatingSystemVersion
);
32 /* Entry-point to kernel */
33 typedef VOID (NTAPI
*KERNEL_ENTRY_POINT
) (PLOADER_PARAMETER_BLOCK LoaderBlock
);
37 #define SECTOR_SIZE 512
40 #define NUM_GDT 128 // Must be 128
41 #define NUM_IDT 0x100 // only 16 are used though. Must be 0x100
44 PVOID
VaToPa(PVOID Va
);
45 PVOID
PaToVa(PVOID Pa
);
46 VOID
List_PaToVa(LIST_ENTRY
*ListEntry
);
47 VOID
ConvertConfigToVA(PCONFIGURATION_COMPONENT_DATA Start
);
51 WinLdrLoadImage(IN PCHAR FileName
,
52 TYPE_OF_MEMORY MemoryType
,
53 OUT PVOID
*ImageBasePA
);
57 WinLdrAllocateDataTableEntry(IN OUT PLOADER_PARAMETER_BLOCK WinLdrBlock
,
61 OUT PLDR_DATA_TABLE_ENTRY
*NewEntry
);
64 WinLdrScanImportDescriptorTable(IN OUT PLOADER_PARAMETER_BLOCK WinLdrBlock
,
65 IN PCCH DirectoryPath
,
66 IN PLDR_DATA_TABLE_ENTRY ScanDTE
);
69 PVOID
WinLdrLoadModule(PCSTR ModuleName
, ULONG
*Size
,
70 TYPE_OF_MEMORY MemoryType
);
74 WinLdrTurnOnPaging(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock
,
80 BOOLEAN
WinLdrInitSystemHive(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock
,
81 IN LPCSTR DirectoryPath
);
83 BOOLEAN
WinLdrScanSystemHive(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock
,
84 IN LPCSTR DirectoryPath
);
87 /* FIXME: Should be moved to NDK, and respective ACPI header files */
88 typedef struct _ACPI_BIOS_DATA
90 PHYSICAL_ADDRESS RSDTAddress
;
92 BIOS_MEMORY_MAP MemoryMap
[1]; /* Count of BIOS memory map entries */
93 } ACPI_BIOS_DATA
, *PACPI_BIOS_DATA
;
96 typedef struct /* Root System Descriptor Pointer */
98 CHAR signature
[8]; /* contains "RSD PTR " */
99 UCHAR checksum
; /* to make sum of struct == 0 */
100 CHAR oem_id
[6]; /* OEM identification */
101 UCHAR revision
; /* Must be 0 for 1.0, 2 for 2.0 */
102 ULONG rsdt_physical_address
; /* 32-bit physical address of RSDT */
103 ULONG length
; /* XSDT Length in bytes including hdr */
104 ULONGLONG xsdt_physical_address
; /* 64-bit physical address of XSDT */
105 UCHAR extended_checksum
; /* Checksum of entire table */
106 CHAR reserved
[3]; /* reserved field must be 0 */
107 } RSDP_DESCRIPTOR
, *PRSDP_DESCRIPTOR
;