ReactOS  0.4.14-dev-358-gbef841c
winldr.h
Go to the documentation of this file.
1 /*
2  * PROJECT: FreeLoader
3  * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4  * PURPOSE: Windows-compatible NT OS Loader.
5  * COPYRIGHT: Copyright 2006-2019 Aleksey Bragin <aleksey@reactos.org>
6  */
7 
8 #pragma once
9 
10 #include <arc/setupblk.h>
11 
12 /* Entry-point to kernel */
14 
15 /* Descriptors */
16 #define NUM_GDT 128 // Must be 128
17 #define NUM_IDT 0x100 // Only 16 are used though. Must be 0x100
18 
19 #if 0
20 
21 #include <pshpack1.h>
22 typedef struct /* Root System Descriptor Pointer */
23 {
24  CHAR signature [8]; /* contains "RSD PTR " */
25  UCHAR checksum; /* to make sum of struct == 0 */
26  CHAR oem_id [6]; /* OEM identification */
27  UCHAR revision; /* Must be 0 for 1.0, 2 for 2.0 */
28  ULONG rsdt_physical_address; /* 32-bit physical address of RSDT */
29  ULONG length; /* XSDT Length in bytes including hdr */
30  ULONGLONG xsdt_physical_address; /* 64-bit physical address of XSDT */
31  UCHAR extended_checksum; /* Checksum of entire table */
32  CHAR reserved [3]; /* reserved field must be 0 */
34 #include <poppack.h>
35 
36 typedef struct _ARC_DISK_SIGNATURE_EX
37 {
41 
42 #endif
43 
44 #define MAX_OPTIONS_LENGTH 255
45 
46 typedef struct _LOADER_SYSTEM_BLOCK
47 {
51 #ifdef _M_IX86
52  HEADLESS_LOADER_BLOCK HeadlessLoaderBlock;
53 #endif
57  // CHAR ArcHalDeviceName[MAX_PATH];
62 
64 
65 
66 // conversion.c
67 #if 0
68 PVOID VaToPa(PVOID Va);
69 PVOID PaToVa(PVOID Pa);
70 VOID List_PaToVa(_In_ LIST_ENTRY *ListEntry);
71 #endif
73 
74 
75 // winldr.c
77  TYPE_OF_MEMORY MemoryType);
78 
79 // wlmemory.c
80 BOOLEAN
82 
83 // wlregistry.c
84 BOOLEAN
86  IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock,
88  IN BOOLEAN Setup);
89 
92 
93 // winldr.c
94 VOID
96  PCSTR Options,
97  PCSTR SystemPath,
98  PCSTR BootPath,
99  USHORT VersionToBoot);
100 BOOLEAN
102  IN PCSTR DirectoryPath,
103  IN PCSTR AnsiFileName,
104  IN PCSTR OemFileName,
105  IN PCSTR LanguageFileName);
106 BOOLEAN
107 WinLdrAddDriverToList(LIST_ENTRY *BootDriverListHead,
109  PWSTR ImagePath,
111 
112 VOID
114 
115 VOID
117 
118 VOID
120 
123  USHORT OperatingSystemVersion,
124  PLOADER_PARAMETER_BLOCK LoaderBlock,
126  PCSTR BootPath,
127  BOOLEAN Setup);
128 
129 VOID
131 
132 VOID
134 
135 // arch/xxx/winldr.c
136 BOOLEAN
138  IN PFN_NUMBER NumberOfPages,
139  IN BOOLEAN KernelMapping);
140 
141 VOID
143 
144 VOID
145 MempDump(VOID);
struct _ARC_DISK_SIGNATURE_EX ARC_DISK_SIGNATURE_EX
#define IN
Definition: typedefs.h:38
VOID(NTAPI * KERNEL_ENTRY_POINT)(PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: winldr.h:13
ARC_DISK_INFORMATION ArcDiskInformation
Definition: winldr.h:60
VOID MempUnmapPage(PFN_NUMBER Page)
Definition: winldr.c:204
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE ACPI_HANDLE ACPI_HANDLE *OutHandle ACPI_HANDLE *OutHandle void *Context void *Context ACPI_EVENT_HANDLER Handler UINT32 UINT32 ACPI_GPE_HANDLER void *Context UINT32 ACPI_NOTIFY_HANDLER void *Context ACPI_ADR_SPACE_TYPE ACPI_ADR_SPACE_HANDLER ACPI_ADR_SPACE_SETUP Setup
Definition: acpixf.h:828
VOID WinLdrSetupMachineDependent(PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: winldr.c:379
VOID List_PaToVa(_In_ LIST_ENTRY *ListEntry)
PVOID PaToVa(PVOID Pa)
Definition: conversion.h:22
uint16_t * PWSTR
Definition: typedefs.h:54
BOOLEAN WinLdrScanSystemHive(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock, IN PCSTR SystemRoot)
Definition: wlregistry.c:173
char CHAR
Definition: xmlstorage.h:175
VOID WinLdrInitializePhase1(PLOADER_PARAMETER_BLOCK LoaderBlock, PCSTR Options, PCSTR SystemPath, PCSTR BootPath, USHORT VersionToBoot)
Definition: winldr.c:72
ULONG ARC_STATUS
Definition: arc.h:4
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char const char * ModuleName
Definition: acpixf.h:1270
struct RSDP_DESCRIPTOR * PRSDP_DESCRIPTOR
enum OPTION_FLAGS Options
Definition: stats.c:44
PVOID VaToPa(PVOID Va)
Definition: conversion.h:15
ARC_STATUS LoadAndBootWindowsCommon(USHORT OperatingSystemVersion, PLOADER_PARAMETER_BLOCK LoaderBlock, PCSTR BootOptions, PCSTR BootPath, BOOLEAN Setup)
Definition: winldr.c:908
BOOLEAN WinLdrSetupMemoryLayout(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: wlmemory.c:181
CHAR ArcBootDeviceName[MAX_PATH+1]
Definition: winldr.h:56
struct _ARC_DISK_SIGNATURE_EX * PARC_DISK_SIGNATURE_EX
enum _TYPE_OF_MEMORY TYPE_OF_MEMORY
int WINAPI StartPage(_In_ HDC)
struct _LOADER_SYSTEM_BLOCK * PLOADER_SYSTEM_BLOCK
#define MAX_OPTIONS_LENGTH
Definition: winldr.h:44
ULONG PFN_NUMBER
Definition: ke.h:8
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
struct _LOADER_SYSTEM_BLOCK LOADER_SYSTEM_BLOCK
r reserved
Definition: btrfs.c:2865
unsigned char BOOLEAN
VOID WinLdrpDumpMemoryDescriptors(PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: winldr.c:1006
LOADER_PARAMETER_BLOCK LoaderBlock
Definition: winldr.h:48
LPTSTR ServiceName
Definition: ServiceMain.c:15
static const WCHAR SystemRoot[]
Definition: reg.c:38
CHAR ArcName[MAX_PATH]
Definition: winldr.h:37
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
uint64_t ULONGLONG
Definition: typedefs.h:65
NLS_DATA_BLOCK NlsDataBlock
Definition: winldr.h:54
#define MAX_PATH
Definition: compat.h:26
ARC_DISK_SIGNATURE DiskSignature
Definition: winldr.h:36
Definition: partlist.h:33
CHAR LoadOptions[MAX_OPTIONS_LENGTH+1]
Definition: winldr.h:55
VOID ConvertConfigToVA(PCONFIGURATION_COMPONENT_DATA Start)
Definition: conversion.c:51
unsigned char UCHAR
Definition: xmlstorage.h:181
VOID MempDump(VOID)
Definition: winldr.c:429
BOOLEAN WinLdrLoadNLSData(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock, IN PCSTR DirectoryPath, IN PCSTR AnsiFileName, IN PCSTR OemFileName, IN PCSTR LanguageFileName)
Definition: wlregistry.c:301
#define VOID
Definition: acefi.h:82
CHAR NtHalPathName[MAX_PATH+1]
Definition: winldr.h:59
Definition: typedefs.h:117
static cab_ULONG checksum(const cab_UBYTE *data, cab_UWORD bytes, cab_ULONG csum)
Definition: fdi.c:353
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
PLOADER_SYSTEM_BLOCK WinLdrSystemBlock
Definition: winldr.c:27
LOADER_PARAMETER_EXTENSION Extension
Definition: winldr.h:49
SETUP_LOADER_BLOCK SetupBlock
Definition: winldr.h:50
#define _In_
Definition: no_sal2.h:204
BOOLEAN WinLdrAddDriverToList(LIST_ENTRY *BootDriverListHead, PWSTR RegistryPath, PWSTR ImagePath, PWSTR ServiceName)
Definition: wlregistry.c:768
unsigned short USHORT
Definition: pedump.c:61
VOID WinLdrpDumpArcDisks(PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: winldr.c:1044
VOID WinLdrSetProcessorContext(VOID)
Definition: winldr.c:348
BOOLEAN MempSetupPaging(IN PFN_NUMBER StartPage, IN PFN_NUMBER NumberOfPages, IN BOOLEAN KernelMapping)
Definition: winldr.c:170
unsigned int * PULONG
Definition: retypes.h:1
#define OUT
Definition: typedefs.h:39
unsigned int ULONG
Definition: retypes.h:1
_In_ PUNICODE_STRING RegistryPath
Definition: wmip.h:27
PVOID WinLdrLoadModule(PCSTR ModuleName, PULONG Size, TYPE_OF_MEMORY MemoryType)
Definition: winldr.c:355
const char * PCSTR
Definition: typedefs.h:51
VOID WinLdrpDumpBootDriver(PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: winldr.c:1025
CHAR NtBootPathName[MAX_PATH+1]
Definition: winldr.h:58
BOOLEAN WinLdrInitSystemHive(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock, IN PCSTR SystemRoot, IN BOOLEAN Setup)
Definition: wlregistry.c:123