Page 1 of 1
Why Windows 10 requires the NX bit
Posted: Sun Dec 20, 2020 8:48 am
by clementttttttttt
Still remember I bought a new pc back in 2015 just because of that. Windows sucks.
Re: Why Windows 10 requires the NX bit
Posted: Sun Dec 20, 2020 3:02 pm
by nullplan
Because it does? Because supporting both the NX bit and machines that don't have it is complicated? Because people were getting exploited by stack smashes like it's 1991, and MS decided to do something about it? What kind of dinosaur did you have that did not support the NX bit in 2015?
Windows sucks for many reasons, but the NX bit is not one of them.
Re: Why Windows 10 requires the NX bit
Posted: Sun Dec 20, 2020 3:12 pm
by iansjack
clementttttttttt wrote:Still remember I bought a new pc back in 2015 just because of that. Windows sucks.
Windows 10 won't run on my 5150.
Without deviation from the norm, progress is not possible.
Frank Zappa
Re: Why Windows 10 requires the NX bit
Posted: Sun Dec 20, 2020 10:26 pm
by Schol-R-LEA
How old was this system? IIUC,
AMD introduced the NX bit in 2003 when they introduced AMD64 (x86-64 - technically, AMD64 was specified in 1999, but 2003 was when it first hit the market), while Intel followed suit with the equivalent XD bit the next year. A system that doesn't have an NX (or XD, same thing) bit would have to date no later than around 2006, meaning that probably wouldn't have had the minimum memory capacity and runtime performance to run Windows 10 (or even Windows 7) regardless.
Re: Why Windows 10 requires the NX bit
Posted: Wed Dec 23, 2020 4:46 pm
by eekee
Win10 won't run on my Toshiba T1200 either.
Surprisingly, I have a 2GB laptop which runs Win10 quite well. I expect very little of it, mind you; just Zoom, occasionally one or two web pages, and a few other programs which were efficient in the 90s, never mind now. I have noticed it can be literally months behind my desktop in updates. I don't know why, but I guess MS might size-optimize the occasional well-debugged update for the little machines.
As for the NX bit, I wouldn't want to run a web browser on anything which didn't have one. Nor would I install anything from an app store on such a device. Dodgy downloaded software is the concern here, including scripted web pages. Now I think of it, maybe it's not such a bad thing I threw out my old eeePC 1005HA with the Android-x86 installation. (The charging port had melted and I didn't feel up to soldering it.)
Re: Why Windows 10 requires the NX bit
Posted: Thu Dec 24, 2020 2:44 pm
by foliagecanine
eekee wrote:Surprisingly, I have a 2GB laptop which runs Win10 quite well
2GB!?! My (new) laptop's Win10 install eats over 5GB RAM just by existing! As soon as I open a program, it gobbles up my first 8GB RAM stick. And I don't think I'm running a ton of services or things.
I had to disable the thing that auto-closes programs when you run low on RAM, cause as soon as I hit 67% (of 16GB) it just crashed everything.
Sorry. A bit off topic.
Anyways, my desktop PC with a circa-2010 CPU (i7-880) seems to have an NX bit, as I got Win10 running at one point.
The only computer I've seen Win10 fail (or more accurately, the live Windows-ish thing that basically just gives you a command prompt) on was a laptop that is still running WinXP.
I haven't tried it in a while, but I'm pretty sure it failed because it didn't have PAE/NX.
I don't exactly know how old that was, but it was bought somewhere between 2002 and 2008.
Either way, it only had like a gig or two of RAM, so a full install wouldn't have been ideal anyways.
I mainly wanted to use Windows-ish to back it up, but I ended up just loading a linux image and dd-ing it for 50 hours (yes, it took forever. It was only like 60GB too!)
I even tried the built-in Windows XP backup program, but it needed a floppy drive, which that laptop didn't have
Either way, I don't blame the Windows dev team for requiring the NX bit. It's been standard for a decade and a half.
EDIT: I don't know what I did or when, but now it is stable at 3GB when existing and 5GB when open something. I think I also fixed the 67% problem.
Re: Why Windows 10 requires the NX bit
Posted: Fri Dec 25, 2020 3:10 am
by nullplan
foliagecanine wrote:I haven't tried it in a while, but I'm pretty sure it failed because it didn't have PAE/NX.
I did see a youtube video once about the Odyssey of installing Windows 10 on an old laptop. It failed on an old system because it had no PAE, then it failed on a somewhat less old system because it had PAE but failed to advertise that with CPUID, and then it finally worked the next CPU generation over. Unfortunately I forgot the name of the channel now.
Supporting both PAE and legacy paging is hard work, since the page table formats are completely different. Two layers instead of three, and each entry is four bytes instead of eight. You basically have to write the entire code twice.
foliagecanine wrote:Either way, I don't blame the Windows dev team for requiring the NX bit. It's been standard for a decade and a half.
Yeah. I may have overstated how problematic it would be for a general purpose OS (you just have a global variable containing either the NX bit or 0, initialize it once at startup, then OR in that variable instead of the NX bit directly whenever you need), but supporting those old systems would mean serious security flaws would open up, like enabling stack smashing like back in the bad old days. I mean, ROP still exists, but at least some DEP would be in place. I suppose you could go the OpenBSD route on 32-bit systems and lower the CS limit, but that is a bit inflexible, it makes kernel code injection harder (you have to inject the vDSO as low as possible in address space, when it is often put as high as possible to stay out of the way of legacy brk() heap expansion, or other user space expectations), and is not available on 64-bit systems. I am not aware of any 64-bit systems not supporting NX at this time, but I don't know what they will come up with next.
Re: Why Windows 10 requires the NX bit
Posted: Fri Dec 25, 2020 10:14 am
by eekee
foliagecanine wrote:eekee wrote:Surprisingly, I have a 2GB laptop which runs Win10 quite well
2GB!?! My (new) laptop's Win10 install eats over 5GB RAM just by existing! As soon as I open a program, it gobbles up my first 8GB RAM stick. And I don't think I'm running a ton of services or things.
I had to disable the thing that auto-closes programs when you run low on RAM, cause as soon as I hit 67% (of 16GB) it just crashed everything.
Sorry. A bit off topic.
I can't help replying with wonder, because my 8GB Win10 machine is almost entirely acceptable. However, it and the 2GB machine are both refurbs; they had OEM Win10 when I bought them. I expect the shop made that change and probably several others.
The few machines I still have which I'm sure don't have the NX bit are too old for Win
XP never mind 10.
In the case of the newest, a late-90s laptop, I think it's just a driver issue with the installer, but still!
Re: Why Windows 10 requires the NX bit
Posted: Sun Dec 27, 2020 7:44 am
by nexos
@foliagecanine: If you bought your's retail, then it is probably because of all the junk manufacturers install on new machines. My W10 laptop has always been slow. I think on my next machine, I might purchase it and then overwrite Windows with Linux.
Re: Why Windows 10 requires the NX bit
Posted: Sat Jan 30, 2021 8:38 pm
by austanss
foliagecanine wrote:eekee wrote:Surprisingly, I have a 2GB laptop which runs Win10 quite well
2GB!?! My (new) laptop's Win10 install eats over 5GB RAM just by existing! As soon as I open a program, it gobbles up my first 8GB RAM stick. And I don't think I'm running a ton of services or things.
Obviously, the more RAM you have, the more RAM that will be used to index it. But it seems Windows does it rather inefficiently.
Re: Why Windows 10 requires the NX bit
Posted: Sun Jan 31, 2021 3:56 am
by eekee
Update: The stability of Windows Explorer is highly variable on my 8GB Win10 machine. (I barely use it on the 2GB machine.) This includes the desktop, the task bar, and the all-windows view which you get by pressing win-tab. It had been stable for a few months when I posted, but before that it was unstable. It went through another extremely unstable phase after a recent .NET update, 1/2 win-tab operations failing, but it got somewhat better after a couple of weeks. Every crash shuffles taskbar buttons (within the app groups), which is irritating. Rarely, crashes will reset the task bar's location and size.
My friend tells me Win10 gets extremely slow if you replace the shell (Explorer). I haven't tried, but I have noticed launching my modified version of CAL-4700 from MSYS2 is extremely slow, apparently because Windows Defender scans the target executable every time. CAL-4700 is a Plain English Programming IDE unrelated to MSYS2. On the other hand, my modified CAL-4700 (which I regularly recompile without any sort of security certificate or other verification) can launch itself and MSYS2's mintty (edit: and many other programs) just fine.