17 ms·
Wait, there was no memory protection in Windows 98? Did it implement virtual memory for processes? If so, it seems like memory protection would be a freebie at
by Unklejoe 10y ago
Wait, there was no memory protection in Windows 98?
Did it implement virtual memory for processes? If so, it seems like memory protection would be a freebie at that point?
I was also unaware that it was not a pre-emptive multitasking system.
- bluedino 10y agoThe new 32-bit stuff was. The problem was all the 16-bit programs and driving weren't, and large parts of Windows itself were still 16-bit.
- userbinator 10y agoThe first 1MB ("realmode area") has no protection and is essentially shared, for compatibility with DOS and 16-bit Windows. Win9x is preemptively multitasked, at least for actual Win32 processes, however I would not be surprised if some parts of it weren't.
- digi_owl 10y agoAnd MS put in various exceptions to make sure programs and games kept working. IIRC, sim city had one such because it had a "use after free" bug. Something that was a nono even in DOS, but not properly enforced by the OS until 9x.
- pwdisswordfish 10y agoThere was, technically, but it was quite sketchy. For example, in Windows 95 the zero page was mapped to physical memory in order to workaround an ancient CPU bug... for which CPU support was later dropped anyway[0][1]; as far as I know, Windows 98 keeps doing this. Try it yourself: run debug.com and type f 0:0 1000 0 It hangs the system even in Windows Me. [0] https://blogs.msdn.microsoft.com/oldnewthing/20110112-00/?p=11773 https://blogs.msdn.microsoft.com/oldnewthing/20110112-00/?p=... [1] https://blogs.msdn.microsoft.com/oldnewthing/20141003-00/?p=43923 https://blogs.msdn.microsoft.com/oldnewthing/20141003-00/?p=...
- to3m 10y agoWhen writing 32-bit Windows programs, I'm pretty sure it was basically the same as working on Windows 2000: separate address spaces per process, virtualized address space, swap file. In terms of ReadProcessMemory and the like (or whatever the equivalent was back then... I only did Win32/DirectX/OpenGL stuff at the time) it was probably a free-for-all (no users, no security...) but if you were just writing ordinary code then the basic operating model was a bit like the usual NT one. The preemptive multitasking did work, but I remember it being quite lame, and if your program didn't use GetMessage/WaitForSingleObject/etc. often enough then it could have a deleritous effect on the rest of the system. But you could still see this sort of behaviour in XP at times, and it only really seemed to resolve itself properly when 2+-core CPUs became common... so I don't know how much Windows 9x's 16-bit heritage can be blamed. This was all quite a long time ago, though, thankfully, so maybe I've forgotten something.
- wvenable 10y agoSo much misinformation -- Yes Windows 95 had memory protection and it had pre-emptive multitasking. The real cause of most BSOD was really hardware and drivers -- and as this article points out, the driver situation in those days was far from straight forward.
- mkup 10y agoThere was memory protection (paging, separate address spaces etc), but it was possible to enter kernel mode code (CPL=0) from user space code (CPL=3) simply by modifying CR0 register. Instead of raising General Protection Fault, Windows silently allowed it. Also direct I/O was allowed (IN and OUT instructions), as well as CLI and STI instructions (disable/enable interrupts). You could bend system however you like straight from userspace code. If you got interested, look at the source code for Virus.Win9x.CIH for more details and examples.