Old and Cunning on 10/11/2019 at 20:50
My report: I did this, per the readme instructions (pasted below) and got an error message on the command for ntkrnlpx.exe. I tried a couple of times with the same result.
On boot-up, it gave the Windows boot screen with the two selections expected.
Windows 7
Windows (PAE patched)
If I choose Windows 7, it boots normally into the original installation. If I choose the patched version, it goes to an error screen saying that windows couldn't start due to a recent hardware or software change. It lists particulars as follows:
File: \Windows\System32\ntkrnlpx.exe
Status: 0xc0000428
Info: Windows cannot verify the digital signature for this file
It hasn't harmed the computer and all software works as it should. But I've reached the limit of my skill set. Any thoughts?
Readme instructions:
PatchPae (v2) by wj32.
Tested on: Windows Vista SP2, Windows 7 SP0, Windows 7 SP1, Windows 8, Windows 8.1, Windows 10 (build 10586)
== Installation ==
1. Open an elevated Command Prompt window.
2. cd C:\Windows\system32.
Make sure the current directory is in fact system32.
[[ For Windows 8, Windows 8.1 and Windows 10: ]]
3. C:\WherePatchPaeIs\PatchPae2.exe -type kernel -o ntoskrnx.exe ntoskrnl.exe
This will patch the kernel to enable a maximum of 128GB of RAM.
[[ For Windows Vista and Windows 7: ]]
3. C:\WherePatchPaeIs\PatchPae2.exe -type kernel -o ntkrnlpx.exe ntkrnlpa.exe
This will patch the kernel to enable a maximum of 128GB of RAM.
4. C:\WherePatchPaeIs\PatchPae2.exe -type loader -o winloadp.exe winload.exe
C:\Windows\System32\PatchPae2.exe -type loader -o winloadp.exe winload.exe
This will patch the loader to disable signature verification.
5. bcdedit /copy {current} /d "Windows (PAE Patched)"
This will create a new boot entry. A message should appear:
The entry was successfully copied to {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}.
e5666237-edf4-11e9-8678-0019b91c1557
[[ For Windows 8, Windows 8.1 and Windows 10: ]]
6. bcdedit /set {e5666237-edf4-11e9-8678-0019b91c1557} kernel ntoskrnx.exe
This will set our boot entry to load our patched kernel.
[[ For Windows Vista and Windows 7: ]]
6. bcdedit /set {e5666237-edf4-11e9-8678-0019b91c1557} kernel ntkrnlpx.exe
This will set our boot entry to load our patched kernel.
7. bcdedit /set {e5666237-edf4-11e9-8678-0019b91c1557} path \Windows\system32\winloadp.exe
This will set our loader to be our patched loader.
8. bcdedit /set {e5666237-edf4-11e9-8678-0019b91c1557} nointegritychecks 1
This will disable verification of the loader.
9. bcdedit /set {bootmgr} default {e5666237-edf4-11e9-8678-0019b91c1557}
This will set our boot entry to be the default.
10. bcdedit /set {bootmgr} timeout 2
This will set the timeout to be shorter.
Note: you can change this timeout to whatever you like.
11. Restart the computer and enjoy.
== Removal ==
To remove the patch:
* Run msconfig, click Boot, highlight the entry named "Windows (PAE Patched)", and click Delete.
* Delete the files ntoskrnx.exe (or ntkrnlpx.exe) and winloadp.exe from C:\Windows\system32.
== Updates ==
When Windows Update installs new updates on your computer, you should run Step 3 again to ensure
that you have the latest version of the kernel.
== Compiling ==
To compile PatchPae2, you need to get Process Hacker and build it.
The directory structure should look like this:
* ...\ProcessHacker2\lib\...
* ...\ProcessHacker2\phlib\...
* ...\src\PatchPae2.sln
Renzatic on 10/11/2019 at 21:26
On a random stab at a guess, it looks like the patch to disable driver signature verification didn't take. Run through that step of the process again, and see it it makes any difference.
Though I still say that just grabbing a 64-bit iso, and reinstalling Windows is your best bet. What you're doing now is a depreciated, unofficial patch for people who don't have any other choice if they want access to more than 4GB RAM on their PCs. You do have another choice, so there's no reason to go the PAE route other than just doing it to do it.
Sure, backing up your data, and reinstalling Windows is a good bit more work on the front end, but you get all the advantages of proper, full 64-bit Windows, and less chances of things possibly fucking up down the road.
Gryzemuis on 11/11/2019 at 16:51
Quote Posted by Old and Cunning
Can any of you more plugged-in types tell me why this would or wouldn't work and what could go wrong? Also, if anyone has any info on the legality of changing PAE limitations, I'd be interested in that too.
It might have been better if you had told us what problem you want to solve exactly.
If the answer was gonna be: "duh, I just want to use all the 8GB of RAM in my PC !", then I would suggest you just install a 64-bit OS. That would the better solution in 98% of cases anyway. PAE is not just gonna "make your PC faster" in general.
What you don't seem to realize is that the 4GB or 2GB speed is not a random limitation imposed by Microsoft. That would be like saying: "my ISP sucks, I have high ping because my ISP limits the speed of light to 300k km/sec". The limitation is because of math.
Can you count in binary ? 0 = 0 in decimal. 1 = 1 in decimal. 10 = 2 in decimal, 11 = 3 in decimal, 100 = 4 in decimal, 101 = 5, 110 = 6, 111 = 7, 1000 is 8. Etc, etc. So if you have 1 bit, you can count 0 or 1. You can basically count from 0 to (2 - 1). With 2 bits, you can count from 0 to (4 -1). With 3 bits you can count from 0 to 8 - 1. You can do the match yourself: 4 bits -> 15, 5 bits -> 31, 6 bits -> 63, 7 bits -> 127, 8 bits allows you to count between 0 and 255.
8 Bits is something special in today's computers. 8 Bits is a byte. So if you have 8GB of RAM, that means you have enough memory to store ~8 billion bytes. 8 Billion of those values between 0-255. Every one of those memory locations has an "address". An address is just a number that indicates which byte we're talking about. The first byte in your PC has address 0. The 2nd byte has address 1, the 3rd byte has address 2. Etc, etc.
Of course computers can do math with larger values than 255. But to do so, they can not store those values in a byte. They need to take a few bytes together to store larger values. So if they take 2 bytes together, you have 16 bits, and you can count to 2^16 - 1. That's roughly 64K (65525 to be precise). If you grab 4 bytes to store a number, you can store numbers up to 2^32 - 1. That's roughly 4 billion. If you grab 8 bytes, you can store really large numbers (4 billion * 4 billion).
A 32-bit machine means that the CPU is capable of working with memory address stored in values of 32-bits. That means the computer can store values up to 4 billion. This is also true for memory addresses. So the first 4 GB in your PC all get a unique address. But if you put in more RAM in your PC, there are no memory locations left to assign. And there is really nothing you can do. Or that the OS can do. Or that Microsoft can do. If memory can not be addressed, it can not be used. Simple.
Because of historical reason, some programs used to use one bit in memory addresses for something special. The sign-bit. That indicates whether a value is positive or negative. It doesn't make sense to use negative addresses, but people used to do that in the past anyway. So to be safe, Microsoft decided to enforce the rule that addresses could only be 31-bits, and that one of the bits was always ignored. That means address could only be up to 2^31 - 1. That's enough to address 2GB. But not more. That is where the limitation comes from that in Windows programs can only use 2GB.
Now if you are 100% sure that a program is not using that sign-bit in weird ways, then you could use it as a normal bit for addresses. But you have to be sure. In that case, you can set a special bit, the LAA-bit in the executable (the program's file on disk, aka the .exe). When Windows starts such a program, and sees the LAA-bit set in the executable, Windows will allow programs to allocate more than 2GB. But still not larger than 4GB. Because programs would not be able to fit address in their 32-bit address variables. FYI, variables that hold addresses are called pointers.
Now Microsoft came up with another trick. That's PAE. The OS was recompiled by Microsoft to make larger pointers. 64-Bit pointers. Or 36-bit pointers or something (I don't know the details. They are hidden inside Windows). That means that Windows itself could use larger address (36 bits would allow for addresses for up to 64 GB). But the programs you run have not been changed. So those programs would still only be able to use 2GB (without LAA) or 4GB (with LAA). What's the benefit then ? With 32-bit Windows without PAE, if you ran one program that used 4GB of memory, no other program would be able to use any more memory. But with PAE, you can have each program use up to 2GB or 4GB. So you could run 10 programs that each used 2GB. (Total usage of all programs still had to be under 64GB, I think).
That's a very specific situation. A situation that gamers normally don't do. Usually you have 1 program (your game) that uses lots of memory. With or without PAE, that one program/game is always limited to 2GB (or 4GB with LAA). There's no benefit of running PAE at all for gamers.
What is the risk of running PAE ? All parts of the OS need to be able to handle 36-bit addresses. Certainly the kernel and the drivers. Lots of drivers come from Microsoft. But some come for 3rd parties. Those drivers might not all be able to do 36-bit addresses. That can cause problems (programs crashing, or worse, your OS crashing (those will be a Blue Screen Of Death). That's why the PAE patch tries to replace some drivers with new versions. And that is what seems to go wrong in your setup.
Anyway, bottomline is: if you are not going to run 2 or more programs simultaneously that needs lots of RAM (more than 4GB), then PAE is not gonna help you at all. I suspect you are not, so there's no benefit in PAE for you. I think you'd do yourself a favor by just upgrading to Windows 10 64-bit. Then your game can use all the RAM you got in your machine for itself.
Hope this helps.
zombe on 12/11/2019 at 13:51
Correction: the OS is still 32 bit, only virtual memory handling is changed. Drivers and the rest of the OS live in high, run time fixed, 32 bit addresses (for cheaper transitions) and cannot care less about PAE or whatever. Apps run in the low addresses (2GB or if app is large address aware then up to 3GB or when the OS is also capable then nearly 4GB [ie. the fixed address stuff that needs to stay visible excluded. However, that address space is usually fairly Swish Cheese and hence often is of no use for the App]) - which can use any custom per process mapping (address -> actual memory) it wishes. PAE allows that mapping to address physical memory in 36 bit mode (that is an hardware level change - ie. no software is involved in the address translation. Software just needs to ask for this physical memory addressing mode and know to build the mappings accordingly - have not checked, but the translation entries, with virtual certainity, still stay 32 bit in hardware as doing otherwise would be rather retarded [ie. the bottom bits can never be anything but 0 anyway - all 12 bits for 4K page size. So you can map up to 32+12 bits of physical memory with 32 bit - that is 16TB. No consumer OS goes needs that.])
Otherwise i agree PAE is bound to be completely useless for normal user. It is also useless for everyone else too - very-very specific cases excepted. It you do not already know that you are suffering from thous very exceptional cases - then it is virtually certain to be useless for you too.
Summary:
Apps use address space - not memory.
PAE has no effect on address space.
Programs built with Large Address Aware can use up to 3GB or close to 4GB of (the end being Swish Cheese) address space when OS is told to do so (default by newer patches / installs). Provided the high end non-continous address space is of any actual use to the app.
Memory addressing is managed by the virtual memory manager of the OS and is invisible to other Apps/Drivers/Etc.
PAE extends that memory addressing.
It is useful when more than 4GB of physical memory is needed at the same time by all the running programs. This lessens paging of memory in and out of HDD/SSD. Since no App can ever exceed the 4GB address space limit with 32 bit OS then the contention must come from combination of MULTIPLE address space hungry apps as a single app cannot do that on its own. Ie. a game will still be stuck with 32 bit (swish cheese) address space - only 64 bit OS and 64 bit executable of the game can fix that.