Live data from Hacker News

Why doesn’t Windows use 64-bit virtual address space below 0x00000000`7ffe0000?

devblogs.microsoft.com

41–50 of 65 posts

Re: Why doesn’t Windows use 64-bit virtual address space below 0x00000000`7ffe0000?

#41

Has anyone here ever used Windows NT on a DEC Alpha? A company in Ireland I worked for gave a mobile phone GIS demo to the Irish national phone company and Digital lent us a beefy server with two AXP CPUs (it was gonna be the future!) running windows NT. We literally pulled it on cobbled dublin streets on a a handcart to bring it to their offices.

Me, as a QA in Microsoft. I assume other groups in Microsoft at the time were running it too. I wrote a bit about that here:

https://news.ycombinator.com/item?id=27639461

Re: Why doesn’t Windows use 64-bit virtual address space below 0x00000000`7ffe0000?

#42

Has anyone here ever used Windows NT on a DEC Alpha? A company in Ireland I worked for gave a mobile phone GIS demo to the Irish national phone company and Digital lent us a beefy server with two AXP CPUs (it was gonna be the future!) running windows NT. We literally pulled it on cobbled dublin streets on a a handcart to bring it to their offices.

I had one for running very early builds of Win64 at Microsoft. It was a very aesthetically pleasing piece of hardware. The builds of Windows I ran on it were truly at the stage of "hey it built" so I remember getting a dialog one time that said something like "Invalid Error Code" with half the warning icon rendered and the other half random garbage. We moved on to IA64 and AMD64 shortly afterwards.

Re: Why doesn’t Windows use 64-bit virtual address space below 0x00000000`7ffe0000?

#43

Earlier quoted context omitted.

This was only 'enforced' by the linker on x86. You could handcraft a Mach-O executable to get around it. But it is now enforced enforced by OSX on ARM. I don't see any good reason for this. My own half assed explanation is they're enforcing 32b cleanliness. It's not a very good explanation. But it's my explanation for something I don't like.

When migrating 32bit apps to 64bit platforms, it's common to follow the recipe: 1. Try to recompile on 64bit without any changes 2. Realize the program does not work because the types have different sizes now 3. Cast everything on sight to types that have same size as in 32bit. 4. Now the program "works" (as in, it compiled and maybe ran but you didn't test thoroughly) This address space restrictions ensures that if…

>3. Cast everything on sight to types that have same size as in 32bit.

Which is why on windows they defaulted to 32 bits for ints

Re: Why doesn’t Windows use 64-bit virtual address space below 0x00000000`7ffe0000?

#44
post #26

Earlier quoted context omitted.

You didn’t need to handcraft it, the linker has a ‘pagezero_size’ argument which allows you to set it as small as one page and then the rest of the low 4GB can be used.

I remember trying this repeatedly with various incantations but always getting: segaddr blah conflicts with pagezero_size Maybe there was an incantation I didn't find. But I did handcraft it and then Apple cancelled even that. Now we're gonna have to deal with a 4GB zero page. Period.

That's going to make certain old optimizations broken, I guess. But I hope to avoid arm64 macs (kinda campaigning to get linux machines at work) so it may remain only theoretical.

Re: Why doesn’t Windows use 64-bit virtual address space below 0x00000000`7ffe0000?

#45
post #35
post #27

Earlier quoted context omitted.

Wikipedia says it was only commercially available for NT4, I do somewhere have the Dec Alpha Windows 2000 beta discs (It got killed very late in the beta).

A friend of mine had an Alpha, and I was getting the Windows betas (I got 98se, 2000, and XP, and then nothing else). My friend was really happy to 'borrow' the win2k for alpha discs. IIRC, release candidates 1 and 2 had alpha discs, and then 3 and beyond didn't; but I might be off by one. I assume it would have shipped as part of the release if only Alpha was cancelled a couple months later.

IIRC every RC disk had alpha binaries, only the RTM and later doesn't - because Alpha getting canned was declared in the short window between last RC and RTM, in a rather abrupt manner to everyone involved on the project.

Re: Why doesn’t Windows use 64-bit virtual address space below 0x00000000`7ffe0000?

#46
post #23

> No. The virtual address space starts at the 64KB boundary. You can confirm this by calling GetSystemInfo and checking the lpMinimum­Application­Address. It will be 0x00000000`00010000. Aw, man. I recently found out there is also a similar restriction on Linux. Bummer, because I have a good use for putting code into the lower 64KB of memory (not 4KB, still want to use that for catching NPEs). My use case is a fast i…

On linux it depends on a sysctl parameter, and on 4kB platforms some runtimes used the fact that it was set to "one page" as a method to have very short pointers starting at address 4097 for things very often references (and which might need guard page, like NULL value).

Made for some borked code with Clozure Common Lisp when people started running 64kB pagesize on PPC64, and that meant that even with minimal zero page it still was too big to map the "low memory" where CCL stuck it's NULL definition.

Re: Why doesn’t Windows use 64-bit virtual address space below 0x00000000`7ffe0000?

#47
post #29
post #17

Earlier quoted context omitted.

PAL code didn't do anything like context switches and I'm not sure how it could, given how the OS needs to know the specifics of the thread context in many scenarios.

I believe in the specific case of L4/Alpha, the PALCode did perform the context switches. Granted, I doubt it was as robust as the VMS or Tru64 PALCode versions that were production-ready.

PALcode implemented context switches for all systems, including Linux (which uses Digital Unix PALcode). Specifically, PALcode covered various internal details of the CPU presenting unified interface to OS - each CPU needed custom PALcode implementation, though IIRC there were only few mandatory PALcode calls (related to memory barriers, iirc). The kernel covered switching OS-specific structure pointers over, PALcode handled all sorts of MMU, TLB, PASID indexing of TLB, internal CPU state etc.

L4/Alpha PALcode was limited to specific set of CPUs it was implemented for, so unlike VMS, NT or Digital Unix PALcode it wasn't available outside of those few machines.

Re: Why doesn’t Windows use 64-bit virtual address space below 0x00000000`7ffe0000?

#48

Has anyone here ever used Windows NT on a DEC Alpha? A company in Ireland I worked for gave a mobile phone GIS demo to the Irish national phone company and Digital lent us a beefy server with two AXP CPUs (it was gonna be the future!) running windows NT. We literally pulled it on cobbled dublin streets on a a handcart to bring it to their offices.

I recall my father mentioning having an Alpha with Windows NT4 available at work, circa ~1998. This was probably explicitly to run computational packages like ANSYS. It wasn't main work machine, which AFAIK was something more like random Pentium, maybe Pentium Pro (doubtful - I think there was a dual Pentium Pro which was similarly a shared machine but not daily driver)

Re: Why doesn’t Windows use 64-bit virtual address space below 0x00000000`7ffe0000?

#49

Has anyone here ever used Windows NT on a DEC Alpha? A company in Ireland I worked for gave a mobile phone GIS demo to the Irish national phone company and Digital lent us a beefy server with two AXP CPUs (it was gonna be the future!) running windows NT. We literally pulled it on cobbled dublin streets on a a handcart to bring it to their offices.

I worked briefly on a real-estate web system which ran on it. It wasn't bad, as these things go (I was coming off OSF/1)

Re: Why doesn’t Windows use 64-bit virtual address space below 0x00000000`7ffe0000?

#50

> That is a special page of memory that is mapped read-only into user mode from kernel mode, and it contains things like the current time, so that applications can get this information quickly without having to take a kernel transition. This page is at a fixed location for performance reasons. I didn't know there was a vdso-like mechanism in Windows as in Linux.

Yeah, it's called KUSER_SHARED_DATA, and contains a lot of interesting items.

https://learn.microsoft.com/en-us/windows-hardware/drivers/d...

Post reply on HN