Skip to content

Commit 89c0b84

Browse files
committed
[NTOS:PO] WIP
1 parent 054b8e0 commit 89c0b84

80 files changed

Lines changed: 13378 additions & 2502 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

boot/bootdata/livecd.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Options=/FASTDETECT /MININT
2323
[LiveCD_Debug]
2424
BootType=Windows2003
2525
SystemPath=\reactos
26-
Options=/DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /SOS /FASTDETECT /MININT
26+
Options=/HAL=HALACPI.DLL /DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /SOS /FASTDETECT /MININT
2727

2828
[LiveCD_Macpi]
2929
BootType=Windows2003

boot/freeldr/freeldr/bootmgr.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,9 @@ VOID RunLoader(VOID)
447447
goto Reboot;
448448
}
449449

450+
/* Display the "Red Screen of Hell" if ROS previously shutdown due to thermal event */
451+
//TuiDisplayThermalScreen();
452+
450453
/* Load the chosen operating system */
451454
LoadOperatingSystem(&OperatingSystemList[SelectedOperatingSystem]);
452455

boot/freeldr/freeldr/include/ui/tui.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ UCHAR TuiTextToFillStyle(PCSTR FillStyleText); // Converts the
129129

130130
VOID TuiFadeInBackdrop(VOID); // Draws the backdrop and fades the screen in
131131
VOID TuiFadeOut(VOID); // Fades the screen out
132+
VOID TuiDisplayThermalScreen(VOID); // Display the Red Screen of Hell informing the user of a thermal condition
132133

133134
/* Menu Functions ************************************************************/
134135

boot/freeldr/freeldr/ui/tui.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,6 +1035,26 @@ VOID TuiFadeOut(VOID)
10351035

10361036
}
10371037

1038+
VOID TuiDisplayThermalScreen(VOID)
1039+
{
1040+
MachVideoHideShowTextCursor(FALSE);
1041+
MachVideoClearScreen(ATTR(COLOR_WHITE, COLOR_RED));
1042+
1043+
TuiPrintf("\nOn previous session, ReactOS has shutdown due to a thermal condition\n"
1044+
"that would have otherwise caused fatal damage to the system.\n\n"
1045+
"It's extremely advised to check that your system has proper cooling\n"
1046+
"and that nothing blocks the airflow of your system (dust, debris, etc).\n\n"
1047+
"Replace the thermal paste if necessary. Avoid skin contact with the hot\n"
1048+
"system at all costs (if it's a laptop).\n\n"
1049+
"Press ENTER to continue.");
1050+
1051+
/* Have this dummy loop to act like the system was waiting on something */
1052+
for (;;)
1053+
{
1054+
1055+
}
1056+
}
1057+
10381058
BOOLEAN TuiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length)
10391059
{
10401060
CHAR key;

ntoskrnl/config/cmdata.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,13 @@ DATA_SEG("INITDATA") CM_SYSTEM_CONTROL_VECTOR CmControlVector[] =
549549
NULL,
550550
NULL
551551
},
552+
{
553+
L"Session Manager\\Kernel",
554+
L"PoCleanShutdownFlags",
555+
&PopShutdownCleanly,
556+
NULL,
557+
NULL
558+
},
552559
{
553560
L"Session Manager\\I/O System",
554561
L"CountOperations",
@@ -612,6 +619,13 @@ DATA_SEG("INITDATA") CM_SYSTEM_CONTROL_VECTOR CmControlVector[] =
612619
NULL,
613620
NULL
614621
},
622+
{
623+
L"Session Manager",
624+
L"PowerPolicySimulate",
625+
&PopSimulate,
626+
NULL,
627+
NULL
628+
},
615629
{
616630
L"ProductOptions",
617631
L"ProductType",

ntoskrnl/include/internal/ntoskrnl.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ C_ASSERT(FIELD_OFFSET(KTHREAD, QuantumReset) == FIELD_OFFSET(KTHREAD, SuspendApc
134134
C_ASSERT(FIELD_OFFSET(KTHREAD, KernelTime) == FIELD_OFFSET(KTHREAD, SuspendApc.SpareLong0));
135135
C_ASSERT(FIELD_OFFSET(KTHREAD, TlsArray) == FIELD_OFFSET(KTHREAD, SuspendApc.SystemArgument1));
136136
C_ASSERT(FIELD_OFFSET(KTHREAD, LegoData) == FIELD_OFFSET(KTHREAD, SuspendApc.SystemArgument2));
137-
C_ASSERT(FIELD_OFFSET(KTHREAD, PowerState) == FIELD_OFFSET(KTHREAD, SuspendApc.Inserted) + 1);
138137
C_ASSERT(sizeof(KTHREAD) == 0x1B8);
139138

140139
C_ASSERT(FIELD_OFFSET(KPROCESS, DirectoryTableBase) == KPROCESS_DIRECTORY_TABLE_BASE);

ntoskrnl/include/internal/pep.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* PROJECT: ReactOS Kernel
3+
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4+
* PURPOSE: Internal header for the Power Manager Platform Extension Plug-ins (PEPs)
5+
* COPYRIGHT: Copyright 2023 George Bișoc <george.bisoc@reactos.org>
6+
*/
7+
8+
//
9+
// Platform Extension Plugin (PEP) handle
10+
//
11+
typedef struct _PEPHANDLE__
12+
{
13+
LONG unused;
14+
} PEPHANDLE__, *PPEPHANDLE__;
15+
16+
//
17+
// PEP crash dump information
18+
//
19+
typedef struct _PEP_CRASHDUMP_INFORMATION
20+
{
21+
PPEPHANDLE__ DeviceHandle;
22+
PVOID DeviceContext;
23+
} PEP_CRASHDUMP_INFORMATION, *PPEP_CRASHDUMP_INFORMATION;
24+
25+
/* EOF */

0 commit comments

Comments
 (0)