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 #include <arc/setupblk.h>
25 // See freeldr/ntldr/winldr.h
26 #define TAG_WLDR_DTE 'eDlW'
27 #define TAG_WLDR_BDE 'dBlW'
28 #define TAG_WLDR_NAME 'mNlW'
33 // FIXME: This one has nothing to do here!!
34 #define SECTOR_SIZE 512
37 #define NUM_GDT 128 // Must be 128
38 #define NUM_IDT 0x100 // Only 16 are used though. Must be 0x100
41 typedef struct /* Root System Descriptor Pointer */
43 CHAR signature
[8]; /* contains "RSD PTR " */
44 UCHAR checksum
; /* to make sum of struct == 0 */
45 CHAR oem_id
[6]; /* OEM identification */
46 UCHAR revision
; /* Must be 0 for 1.0, 2 for 2.0 */
47 ULONG rsdt_physical_address
; /* 32-bit physical address of RSDT */
48 ULONG length
; /* XSDT Length in bytes including hdr */
49 ULONGLONG xsdt_physical_address
; /* 64-bit physical address of XSDT */
50 UCHAR extended_checksum
; /* Checksum of entire table */
51 CHAR reserved
[3]; /* reserved field must be 0 */
52 } RSDP_DESCRIPTOR
, *PRSDP_DESCRIPTOR
;
55 typedef struct _ARC_DISK_SIGNATURE_EX
57 ARC_DISK_SIGNATURE DiskSignature
;
58 CHAR ArcName
[MAX_PATH
];
59 } ARC_DISK_SIGNATURE_EX
, *PARC_DISK_SIGNATURE_EX
;
61 ////////////////////////////////////////////////////////////////////////////////
63 // ReactOS Loading Functions
65 ////////////////////////////////////////////////////////////////////////////////
80 // conversion.c and conversion.h
81 PVOID
VaToPa(PVOID Va
);
82 PVOID
PaToVa(PVOID Pa
);
83 VOID
List_PaToVa(_In_ LIST_ENTRY
*ListEntry
);
88 WinLdrLoadImage(IN PCHAR FileName
,
89 TYPE_OF_MEMORY MemoryType
,
90 OUT PVOID
*ImageBasePA
);
93 WinLdrAllocateDataTableEntry(IN OUT PLIST_ENTRY ModuleListHead
,
97 OUT PLDR_DATA_TABLE_ENTRY
*NewEntry
);
100 WinLdrScanImportDescriptorTable(IN OUT PLIST_ENTRY ModuleListHead
,
101 IN PCCH DirectoryPath
,
102 IN PLDR_DATA_TABLE_ENTRY ScanDTE
);
105 WinLdrCheckForLoadedDll(IN OUT PLIST_ENTRY ModuleListHead
,
107 OUT PLDR_DATA_TABLE_ENTRY
*LoadedEntry
);
112 MempSetupPaging(IN PFN_NUMBER StartPage
,
113 IN PFN_NUMBER NumberOfPages
,
114 IN BOOLEAN KernelMapping
);
117 MempUnmapPage(PFN_NUMBER Page
);
123 WinLdrSetupMachineDependent(PLOADER_PARAMETER_BLOCK LoaderBlock
);
126 WinLdrSetProcessorContext(VOID
);