OSDev.org

The Place to Start for Operating System Developers
It is currently Tue Mar 02, 2021 9:04 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Why Windows 10 requires the NX bit
PostPosted: Sun Dec 20, 2020 8:48 am 
Offline
Member
Member

Joined: Tue Jul 14, 2020 4:01 am
Posts: 43
Still remember I bought a new pc back in 2015 just because of that. Windows sucks.


Top
 Profile  
 
 Post subject: Re: Why Windows 10 requires the NX bit
PostPosted: Sun Dec 20, 2020 3:02 pm 
Online
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 854
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.

_________________
Thou hast outraged, not insulted me, sir; but for that I ask thee not to beware of Starbuck; thou wouldst but laugh; but let Ahab beware of Ahab; beware of thyself, old man.


Top
 Profile  
 
 Post subject: Re: Why Windows 10 requires the NX bit
PostPosted: Sun Dec 20, 2020 3:12 pm 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4107
Location: Chichester, UK
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.
Quote:
Without deviation from the norm, progress is not possible.

Frank Zappa


Top
 Profile  
 
 Post subject: Re: Why Windows 10 requires the NX bit
PostPosted: Sun Dec 20, 2020 10:26 pm 
Offline
Member
Member
User avatar

Joined: Fri Oct 27, 2006 9:42 am
Posts: 1729
Location: Athens, GA, USA
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.

_________________
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
μή εἶναι βασιλικήν ἀτραπόν ἐπί γεωμετρίαν
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.


Top
 Profile  
 
 Post subject: Re: Why Windows 10 requires the NX bit
PostPosted: Wed Dec 23, 2020 4:46 pm 
Offline
Member
Member
User avatar

Joined: Mon May 22, 2017 5:56 am
Posts: 546
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.)

_________________
Kaph link pending. code pending. design pending. plans in a state of flux! everything pending! choice of language still up in the air! why is nothing coming together?!?


Top
 Profile  
 
 Post subject: Re: Why Windows 10 requires the NX bit
PostPosted: Thu Dec 24, 2020 2:44 pm 
Offline
Member
Member

Joined: Sun Aug 23, 2020 4:35 pm
Posts: 129
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 #-o

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.

_________________
My OS: TritiumOS
https://github.com/foliagecanine/tritium-os
void warranty(laptop_t laptop) { if (laptop.broken) return laptop; }
I don't get it: Why's the warranty void?


Last edited by foliagecanine on Sat Jan 30, 2021 10:29 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Why Windows 10 requires the NX bit
PostPosted: Fri Dec 25, 2020 3:10 am 
Online
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 854
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.

_________________
Thou hast outraged, not insulted me, sir; but for that I ask thee not to beware of Starbuck; thou wouldst but laugh; but let Ahab beware of Ahab; beware of thyself, old man.


Top
 Profile  
 
 Post subject: Re: Why Windows 10 requires the NX bit
PostPosted: Fri Dec 25, 2020 10:14 am 
Offline
Member
Member
User avatar

Joined: Mon May 22, 2017 5:56 am
Posts: 546
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!

_________________
Kaph link pending. code pending. design pending. plans in a state of flux! everything pending! choice of language still up in the air! why is nothing coming together?!?


Top
 Profile  
 
 Post subject: Re: Why Windows 10 requires the NX bit
PostPosted: Sun Dec 27, 2020 7:44 am 
Offline
Member
Member
User avatar

Joined: Tue Feb 18, 2020 3:29 pm
Posts: 639
@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.

_________________
Currently working on the Nexware project, an attempt to make a less bloated version of GNU. All repos for it can be found at https://github.com/Nexware-Project.


Top
 Profile  
 
 Post subject: Re: Why Windows 10 requires the NX bit
PostPosted: Sat Jan 30, 2021 8:38 pm 
Offline
Member
Member
User avatar

Joined: Sun Oct 11, 2020 9:46 pm
Posts: 337
Location: North Florida, USA
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.

_________________
microCORE: https://github.com/microNET-OS/microCORE
microBOOT: https://github.com/microNET-OS/microBOOT

I make stupid mistakes and my vision is terrible. Not a good combination.

NOTE: Never respond to my posts with "it's too hard".


Top
 Profile  
 
 Post subject: Re: Why Windows 10 requires the NX bit
PostPosted: Sun Jan 31, 2021 3:56 am 
Offline
Member
Member
User avatar

Joined: Mon May 22, 2017 5:56 am
Posts: 546
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.

_________________
Kaph link pending. code pending. design pending. plans in a state of flux! everything pending! choice of language still up in the air! why is nothing coming together?!?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group