Skip to content

Commit adeb70e

Browse files
committed
[BOOTLIB]: Rough sketches of BlImgLoadBootApplication, BlImgStartBootApplication, BlImgUnLoadBootApplication.
svn path=/trunk/; revision=70621
1 parent e7f66b6 commit adeb70e

File tree

6 files changed

+514
-63
lines changed

6 files changed

+514
-63
lines changed

reactos/boot/environ/app/bootmgr/bootmgr.c

Lines changed: 1 addition & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,30 +1083,6 @@ BlXmiInitialize (
10831083
return STATUS_SUCCESS;
10841084
}
10851085

1086-
VOID
1087-
BlImgQueryCodeIntegrityBootOptions (
1088-
_In_ PBL_LOADED_APPLICATION_ENTRY ApplicationEntry,
1089-
_Out_ PBOOLEAN IntegrityChecksDisabled,
1090-
_Out_ PBOOLEAN TestSigningEnabled
1091-
)
1092-
{
1093-
1094-
NTSTATUS Status;
1095-
BOOLEAN Value;
1096-
1097-
/* Check if /DISABLEINTEGRITYCHECKS is on */
1098-
Status = BlGetBootOptionBoolean(ApplicationEntry->BcdData,
1099-
BcdLibraryBoolean_DisableIntegrityChecks,
1100-
&Value);
1101-
*IntegrityChecksDisabled = NT_SUCCESS(Status) && (Value);
1102-
1103-
/* Check if /TESTSIGNING is on */
1104-
Status = BlGetBootOptionBoolean(ApplicationEntry->BcdData,
1105-
BcdLibraryBoolean_AllowPrereleaseSignatures,
1106-
&Value);
1107-
*TestSigningEnabled = NT_SUCCESS(Status) && (Value);
1108-
}
1109-
11101086
NTSTATUS
11111087
BmFwVerifySelfIntegrity (
11121088
VOID
@@ -2212,38 +2188,6 @@ BmpCreateDevices (
22122188
return STATUS_SUCCESS;
22132189
}
22142190

2215-
/* MOVE TO IMAGe.C */
2216-
NTSTATUS
2217-
BlImgLoadBootApplication (
2218-
_In_ PBL_LOADED_APPLICATION_ENTRY BootEntry,
2219-
_Out_ PHANDLE AppHandle
2220-
)
2221-
{
2222-
EfiPrintf(L"Loading application %p\r\n", BootEntry);
2223-
2224-
return STATUS_NOT_IMPLEMENTED;
2225-
}
2226-
2227-
NTSTATUS
2228-
BlImgStartBootApplication (
2229-
_In_ HANDLE AppHandle,
2230-
_Inout_ PBL_RETURN_ARGUMENTS ReturnArguments
2231-
)
2232-
{
2233-
EfiPrintf(L"Starting application %p\r\n", AppHandle);
2234-
2235-
return STATUS_NOT_IMPLEMENTED;
2236-
}
2237-
2238-
NTSTATUS
2239-
BlImgUnloadBootApplication (
2240-
_In_ HANDLE AppHandle
2241-
)
2242-
{
2243-
EfiPrintf(L"Unloading application %p\r\n", AppHandle);
2244-
2245-
return STATUS_NOT_IMPLEMENTED;
2246-
}
22472191

22482192
NTSTATUS
22492193
BmpTransferExecution (
@@ -2257,7 +2201,7 @@ BmpTransferExecution (
22572201
PBL_DEVICE_DESCRIPTOR AppDevice;
22582202
BL_RETURN_ARGUMENTS ReturnArgs;
22592203
BOOLEAN AdvancedOptions;
2260-
HANDLE AppHandle;
2204+
ULONG AppHandle;
22612205

22622206
Status = BlGetBootOptionString(BootEntry->BcdData,
22632207
BcdLibraryString_ApplicationPath,

reactos/boot/environ/include/bcd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ typedef enum BcdLibraryElementTypes
9494
BcdLibraryInteger_GraphicsResolution = 0x15000052,
9595
BcdLibraryInteger_DisplayMessage = 0x15000065, /* Undocumented */
9696
BcdLibraryInteger_DisplayMessageOverride = 0x15000066, /* Undocumented */
97+
BcdLibraryInteger_UndocumentedMagic = 0x15000075, /* Undocumented magic */
9798
BcdLibraryBoolean_RestartOnFailure = 0x16000053,
9899
BcdLibraryBoolean_GraphicsForceHighestMode = 0x16000054,
99100
BcdLibraryBoolean_IsolatedExecutionContext = 0x16000060,

reactos/boot/environ/include/bl.h

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,6 +1139,13 @@ typedef struct _BL_IMG_FILE
11391139
PWCHAR FileName;
11401140
} BL_IMG_FILE, *PBL_IMG_FILE;
11411141

1142+
typedef struct _BL_IMAGE_APPLICATION_ENTRY
1143+
{
1144+
PBL_APPLICATION_ENTRY AppEntry;
1145+
PVOID ImageBase;
1146+
ULONG ImageSize;
1147+
} BL_IMAGE_APPLICATION_ENTRY, *PBL_IMAGE_APPLICATION_ENTRY;
1148+
11421149
typedef struct _BL_DEFERRED_FONT_FILE
11431150
{
11441151
LIST_ENTRY ListEntry;
@@ -1464,6 +1471,11 @@ BlpTimeCalibratePerformanceCounter (
14641471
VOID
14651472
);
14661473

1474+
ULONGLONG
1475+
BlTimeQueryPerformanceCounter (
1476+
_Out_opt_ PLARGE_INTEGER Frequency
1477+
);
1478+
14671479
/* RESOURCE LOCALE INTERNATIONALIZATION ROUTINES *****************************/
14681480

14691481
NTSTATUS
@@ -2136,6 +2148,30 @@ BlImgFindSection (
21362148
_In_ ULONG ImageSize
21372149
);
21382150

2151+
NTSTATUS
2152+
BlImgLoadBootApplication (
2153+
_In_ PBL_LOADED_APPLICATION_ENTRY BootEntry,
2154+
_Out_ PULONG AppHandle
2155+
);
2156+
2157+
NTSTATUS
2158+
BlImgStartBootApplication (
2159+
_In_ ULONG AppHandle,
2160+
_Inout_ PBL_RETURN_ARGUMENTS ReturnArguments
2161+
);
2162+
2163+
NTSTATUS
2164+
BlImgUnloadBootApplication (
2165+
_In_ ULONG AppHandle
2166+
);
2167+
2168+
VOID
2169+
BlImgQueryCodeIntegrityBootOptions (
2170+
_In_ PBL_LOADED_APPLICATION_ENTRY ApplicationEntry,
2171+
_Out_ PBOOLEAN IntegrityChecksDisabled,
2172+
_Out_ PBOOLEAN TestSigning
2173+
);
2174+
21392175
/* FILE I/O ROUTINES *********************************************************/
21402176

21412177
NTSTATUS
@@ -2453,4 +2489,7 @@ extern PVOID DspRemoteInputConsole;
24532489
extern PVOID DspLocalInputConsole;
24542490
extern WCHAR BlScratchBuffer[8192];
24552491
extern BL_MEMORY_DESCRIPTOR_LIST MmMdlUnmappedAllocated;
2492+
extern ULONGLONG BlpTimePerformanceFrequency;
2493+
extern LIST_ENTRY RegisteredFileSystems;
2494+
24562495
#endif

reactos/boot/environ/lib/bootlib.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,11 @@ InitializeLibrary (
4949
PBL_MEMORY_DATA MemoryData;
5050
PBL_APPLICATION_ENTRY AppEntry;
5151
PBL_FIRMWARE_DESCRIPTOR FirmwareDescriptor;
52-
ULONG_PTR ParamPointer = (ULONG_PTR)BootAppParameters;
52+
LARGE_INTEGER BootFrequency;
53+
ULONG_PTR ParamPointer;
5354

5455
/* Validate correct Boot Application data */
56+
ParamPointer = (ULONG_PTR)BootAppParameters;
5557
if (!(BootAppParameters) ||
5658
(BootAppParameters->Signature[0] != BOOT_APPLICATION_SIGNATURE_1) ||
5759
(BootAppParameters->Signature[1] != BOOT_APPLICATION_SIGNATURE_2) ||
@@ -131,18 +133,16 @@ InitializeLibrary (
131133
return Status;
132134
}
133135

134-
#if 0
135136
/* Modern systems have an undocumented BCD system for the boot frequency */
136137
Status = BlGetBootOptionInteger(BlpApplicationEntry.BcdData,
137138
0x15000075,
138-
&BootFrequency);
139-
if (NT_SUCCESS(Status) && (BootFrequency))
139+
(PULONGLONG)&BootFrequency.QuadPart);
140+
if (NT_SUCCESS(Status) && (BootFrequency.QuadPart))
140141
{
141142
/* Use it if present */
142-
BlpTimePerformanceFrequency = BootFrequency;
143+
BlpTimePerformanceFrequency = BootFrequency.QuadPart;
143144
}
144145
else
145-
#endif
146146
{
147147
/* Use the TSC for calibration */
148148
Status = BlpTimeCalibratePerformanceCounter();

0 commit comments

Comments
 (0)