News for hackers. Stuff that matters.
Re:Welcome to the M1 Windows project by foo92691 on Tuesday June 07, 2022 @02:04PM (#31658008)
I'm a bit shocked that it would even be possible for a third party to implement such a thing without rebuilding Windows itself. Is it a matter of implementing "device drivers"?
Re:Welcome to the M1 Windows project by dboreham on Tuesday June 07, 2022 @02:22PM (#31658211)
Windows (really: NT) has always been hardware independent. So it's a matter of a) having binaries and a HAL (Hardware Abstraction Layer) for aarm64 (this exists -- Microsoft already sells arm-based devices such as the Surface Pro X), and b) having the necessary set of device drivers. These may exit already from MS, or may need to be compiled from source already used for x86, or may need to be written from scratch if no driver exists already. But you definitely don't need to build Windows in order to port it to new hardware, unless it's using an unsupported CPU (and then you'll have much bigger problems than just building it).
Re:Welcome to the M1 Windows project by roblabla on Tuesday June 07, 2022 @02:29PM (#31658303)
That's only true up to a certain point. ARM is a very weird target, because a lot of standardized stuff we take for granted in x86/PC land aren't standardized on ARM. In particular, take the Interrupt Controller: x86 has a standard for it (well, technically has two, the PIC and APIC). The "standard" in ARM-land is the GICv3 or GICv4, but many different CPU vendors have their own. Apple has the "Apple Interrupt Controller", or AIC.

The thing is, AFAIK, how to talk to the interrupt controller isn't part of the drivers, but part of the kernel. So you can't just "write a driver" for it. So if Windows doesn't support apple's interrupt controllers, I guess a lot of shenanigans will be needed.

Re:Welcome to the M1 Windows project by AshamedCaptain on Tuesday June 07, 2022 @02:56PM (#31658621)
Actually you might be surprised. Windows NT is _older_ than many of the "standards we take for granted in x86/PC land", and for example it does support multiple types of pre-ACPI ways of bringing up multiprocessor systems and specifically multiple types of interrupt controllers. Heck, x86 Windows even supports non-PC servers from Compaq and others; ever tried to press F5 during (old) Windows NT setup ?

As the OP said, all of this is abstracted by the Windows HAL, so it's just a matter of replacing the HAL (a separate binary). The problem is that the HAL is closed source. Outside of simple binary patches, I don't think anyone has come close to writing a new one.

Re:Welcome to the M1 Windows project by amarioguy on Tuesday June 07, 2022 @04:53PM (#31659916)
Generally speaking part of the issue with a custom HAL nowadays is that Microsoft moved the HAL from being a DLL to being a statically linked library within the kernel (likely as a performance optimization and because there's no real need for a new HAL in most instances when HAL Extensions exist)

This merger of the kernel and HAL invariably means patching the HAL is now equivalent to patching the kernel

Re:Welcome to the M1 Windows project by monocasa on Tuesday June 07, 2022 @03:49PM (#31659230)
ReactOS has written their own HALs.
Re:Welcome to the M1 Windows project by xattt on Tuesday June 07, 2022 @06:31PM (#31660838)
> x86 Windows even supports non-PC servers from Compaq

Were there x86 but non-IBM compatible models or did you mean the alternate instruction sets (Alpha, PPC, RISC)?

Re:Welcome to the M1 Windows project by zinekeller on Tuesday June 07, 2022 @07:05PM (#31661116)
Not GP. I'm not sure if there's a special Compaq version but there's a version (until Windows 2000, https://winworldpc.com/download/5204c39d-c3a9-5a68-11c3-a7c2...) for NEC PC-98 architecture which is x86-based but IBM PC-incompatible, so it's likely that a Compaq version exists.
Re:Welcome to the M1 Windows project by yuhong on Tuesday June 07, 2022 @11:16PM (#31662778)
The Compaq is IBM PC compatible but uses a different HAL for SMP support. You can see all of them by looking at what NT4 shipped with for example.
Re:Welcome to the M1 Windows project by zinekeller on Thursday June 09, 2022 @11:17AM (#31682288)
Ah, Uniprocessor versus Multiprocessor HALs, I remember now!
Re:Welcome to the M1 Windows project by DeathArrow on Wednesday June 08, 2022 @12:26AM (#31663187)
>Outside of simple binary patches, I don't think anyone has come close to writing a new one.

What about ReactOS, do they use a HAL implementation or not?

Re:Welcome to the M1 Windows project by mlyle on Tuesday June 07, 2022 @02:32PM (#31658339)
> The thing is, AFAIK, how to talk to the interrupt controller isn't part of the drivers, but part of the kernel. So you can't just "write a driver" for it. So if Windows doesn't support apple's interrupt controllers, I guess a lot of shenanigans will be needed.

He's planning on a thin hypervisor layer to map GIC to AIC.

Re:Welcome to the M1 Windows project by emptysongglass on Tuesday June 07, 2022 @03:38PM (#31659121)
This part is why I hope x86 has a long life ahead of it. Everybody and their dog have their own standard for things in ARM-land.
Re:Welcome to the M1 Windows project by avianes on Wednesday June 08, 2022 @05:31AM (#31665067)
This is not true.

Most manufacturers take standardized IP and IP-providers provide an appropriate linux drivers. Few manufacturers are willing to develop and maintain their own GIC hardware and GIC driver, most of the time they just take the ARM standard GIC.

The fact that Apple does not provide drivers is a consequence of the Apple business model. And the fact that the ARM ISA does not stipulate a unique GIC is actually a strength. It makes the architecture more versatile and suitable for evolution (maybe Apple found out that the ARM standard GIC is not complete enough for them).

Re:Welcome to the M1 Windows project by emptysongglass on Wednesday June 08, 2022 @07:08AM (#31665671)
I think that's uncharitable even if I am using superlatives to describe the situation.

We have plenty of examples in the wild. Just look at the state of Pine64 and u-boot, for example. It's a mess of standards.

And what you see as a strength others don't.

Re:Welcome to the M1 Windows project by avianes on Wednesday June 08, 2022 @08:36AM (#31666348)
Pine64 is based on an Allwinner A64 which has a ARM GIC-400. ARM GIC-400 is a standard GIC IP from ARM and compliant with ARM GICv2 specification.

It seems pretty standard to me, not a custom GIC as Apple.

And yes, in u-boot there are plenty of device-trees for each target. What's wrong with that?

The device tree is usually provided by the manufacturer, the compiled device tree is usually very small and allows genericity.

Re:Welcome to the M1 Windows project by amarioguy on Tuesday June 07, 2022 @04:54PM (#31659931)
for what it's worth amd64 is not going anywhere outside of Macs for at least the next decade, possibly two.

Despite the benefits ARM provides amd64 undeniably has advantages and non-trivial ones at that.

personally, I'm of the opinion it'll come to a coexistence for a time rather than one dominating the other immediately.

Re:Welcome to the M1 Windows project by avianes on Wednesday June 08, 2022 @05:14AM (#31664958)
Are you confusing "amd64" with "Aarch64"? "amd64" has nothing to do with Macs/Apple products.

Anyway, both amd64 and Aarch64 are already being used outside of Macs/Apple products.

Re:Welcome to the M1 Windows project by 14u2c on Wednesday June 08, 2022 @05:30AM (#31665052)
Apple still sells many computers that execute the amd64 insurrection set.
Re:Welcome to the M1 Windows project by jhgb on Tuesday June 07, 2022 @04:00PM (#31659379)
One can hope that RISC-V in the future will not follow ARM's past mistakes.
Re:Welcome to the M1 Windows project by als0 on Tuesday June 07, 2022 @06:18PM (#31660721)
The mistakes are already happening. There are RISC-V processors being shipped with unfinished extensions and weird MMUs and now Linux has to decide whether to support those or only support finished standards
Re:Welcome to the M1 Windows project by conradev on Wednesday June 08, 2022 @01:31AM (#31663610)
The author plans on using this feature to help bridge the interrupt controller:

“There’s an somewhat obscure feature on M1 (and M1 Pro/Max/Ultra, henceforth referred to as M1 v2) chips where part of the GICv3 can be virtualized to guest OSes to enable faster interrupt handling.”

Seemingly implementing it in a hypervisor?

Re:Welcome to the M1 Windows project by anyfoo on Tuesday June 07, 2022 @02:37PM (#31658388)
You also have to have the abstractions and hooks at the right places, though. Linux had that problem: The AIC (interrupt controller) is sufficiently different from the standard ARM GIC that ARMv8 Linux had to receive more fundamental patches before AIC support could be cleanly added.

To illustrate the issue with a silly example, imagine the Windows kernel assumes that every interrupt controller speaks Spanish, but suddenly AIC comes along and speaks Portuguese. The driver is going to have a hard time communicating.

A sibling commenter, gjsman-1000, explains that the idea is apparently to instead have a very lightweight hypervisor that actually presents a GIC to Windows, instead of trying to add an AIC driver, which might also have needed further kernel changes if Windows even has the concept of interrupt controller support being abstracted away enough to support interrupt controller "drivers" in its HAL. (I am not a Windows person at all, I don't know.) Basically not only having someone in between that seamlessly translates between Portuguese and Spanish, but actually pretending to be the interrupt controller itself.

Re:Welcome to the M1 Windows project by gjsman-1000 on Tuesday June 07, 2022 @02:20PM (#31658190)
Well, if you ask the Asahi Linux team, heck no this isn't possible. Windows doesn't understand the Apple Interrupt Controller and a driver (at least in theory) should not be able to fix that without major kernel changes.

However, they actually address this with the "What makes Windows on M1 hard?" area and talk about using a vGIC to do an extremely lightweight pseudo-hypervisor as a workaround. An interesting theory.

The main issue though is that Windows for ARM isn't for sale and can't be legally purchased outside of buying a WoA device. Microsoft could send a legal letter at any time.

Re:Welcome to the M1 Windows project by sgjohnson on Wednesday June 08, 2022 @04:18AM (#31664654)
> Microsoft could send a legal letter at any time.

If the author doesn't distribute any Microsoft IP, there's nothing Microsoft can do.

Re:Welcome to the M1 Windows project by gjsman-1000 on Wednesday June 08, 2022 @03:09PM (#31672472)
"If the author doesn't distribute any Microsoft IP, there's nothing Microsoft can do."

Only in theory. Microsoft could allege DMCA violations, or any number of threats. They might not have merit but they are still scary and could shut down the project regardless.

Re:Welcome to the M1 Windows project by brundolf on Tuesday June 07, 2022 @02:09PM (#31658080)
My understanding is that drivers aren't part of the kernel in Windows like they are in Linux. And I believe an ARM build of some kind or another already exists out there for Windows
Re:Welcome to the M1 Windows project by TheNewsIsHere on Tuesday June 07, 2022 @02:20PM (#31658198)
It does. Officially there is an ARM build of Windows that Microsoft licenses to OEMs, and there is (or maybe was?) Windows IoT Core which has a build for ARM.

If I recall (grain of salt then) a while after the first M1 Mac came out one of Apple’s VPs had said something on the record about Apple having tried to get Microsoft to sell retail licenses of a Windows 10 for ARM build, because they didn’t want to deprecate Boot Camp for Windows. But Microsoft said no.

Re:Welcome to the M1 Windows project by GeekyBear on Tuesday June 07, 2022 @05:47PM (#31660460)
>a while after the first M1 Mac came out one of Apple’s VPs had said something on the record about Apple having tried to get Microsoft to sell retail licenses of a Windows 10 for ARM build

Not quite. The Craig Federighi quote is:

>As for Windows running natively on the machine, “that’s really up to Microsoft,” he said. “We have the core technologies for them to do that, to run their ARM version of Windows, which in turn of course supports x86 user mode applications. But that’s a decision Microsoft has to make, to bring to license that technology for users to run on these Macs. But the Macs are certainly very capable of it.”

https://arstechnica.com/gadgets/2020/11/we-are-giddy-intervi...

The scuttlebutt says that Microsoft is locked into a requirement to only run Windows ARM on Qualcomm chips for an unknown period of time, although I've never seen anything from Microsoft to confirm that.

Re:Welcome to the M1 Windows project by qzw on Tuesday June 07, 2022 @10:18PM (#31662458)
My own pet theory, based on absolutely no inside knowledge, is that MS doesn’t want to have Windows on M1+ until other CPU makers have caught up to Apple. It would be a huge embarrassment to have Apple hardware running Windows that much better than all the native PCs. All the PC OEMs would slash Nadella’s tires.
Re:Welcome to the M1 Windows project by 1123581321 on Wednesday June 08, 2022 @12:01AM (#31663041)
I like the theory, but I’ll counter with my own theory that MacBook Pros were the best Windows laptop for many years, and they ended up pushing PC quality to catch up which was good for the Windows install base and Office. :)
Re:Welcome to the M1 Windows project by GeekyBear on Wednesday June 08, 2022 @07:02AM (#31665633)
> It would be a huge embarrassment to have Apple hardware running Windows that much better than all the native PCs.

That boat already sailed over a year ago.

>How did Microsoft screw this up? - Surface Pro X (SQ2) vs M1 Macbook Air

https://www.youtube.com/watch?v=OhESSZIXvCA

Re:Welcome to the M1 Windows project by rtpg on Tuesday June 07, 2022 @09:24PM (#31662177)
Pretty surprising that MSFT would end up with a deal like that, I'd feel like they would be in a position of strength. Unless all the ARM vendors were pretty supicious of whether Microsoft would succeed/invest properly in the ecosystem?
Re:Welcome to the M1 Windows project by ntauthority on Wednesday June 08, 2022 @05:59AM (#31665216)
Qualcomm has even ended up in a legal quarrel with Apple over a modem contract that in the end led to Qualcomm getting what they wanted.

They're a ferocious company when it comes to legal.

Re:Welcome to the M1 Windows project by gjsman-1000 on Tuesday June 07, 2022 @02:23PM (#31658229)
We learned last November that Qualcomm had an exclusivity agreement for Windows on ARM that lasted a (speculated) 5 years... which they then did almost absolutely nothing worthwhile with. As of November it was "expiring soon" but what "soon" means is still not clear. Perhaps it was renewed.

However, just two weeks ago Microsoft announced their "Project Volterra" Mac mini clone for Windows on ARM development, which makes it seem mighty certain that Windows on ARM for Mac is not coming anytime soon because otherwise why on earth would anyone buy that thing...

On the other hand, if Project Volterra doesn't sell very well and Windows on ARM continues to flounder, maybe Microsoft will finally make Windows on ARM for Mac a real option in the hopes of capturing mindshare and gathering interest from all the people with Macs.

Re:Welcome to the M1 Windows project by twoodfin on Tuesday June 07, 2022 @06:56PM (#31661026)
However, just two weeks ago Microsoft announced their "Project Volterra" Mac mini clone for Windows on ARM development, which makes it seem mighty certain that Windows on ARM for Mac is not coming anytime soon because otherwise why on earth would anyone buy that thing…

Reading the tea leaves, if Windows were to come to Apple silicon Macs in an Apple-Microsoft mutually supported form, it would almost certainly be as a guest VM under the macOS hypervisor rather than as Boot Camp 2.0.

That would still leave room for Project Volterra.

Re:Welcome to the M1 Windows project by johnwalkr on Tuesday June 07, 2022 @02:26PM (#31658263)
I don't remember that, but Apple have actively made changes to support Asahi Linux (I wouldn't go so far as to say they support Asahi Linux) and not backtracked on not-blocking other OSs.
Re:Welcome to the M1 Windows project by wolpoli on Tuesday June 07, 2022 @03:35PM (#31659083)
It seem a bit disingenuous for Apple to shift blames to Microsoft.

Microsoft does not sell retail licenses of Windows for ARM devices and what Apple proposed isn't the way Microsoft currently does business for ARM hardware.

Yes, Microsoft could change how they do business to accommodate, but so too could Apple.

If Microsoft turn around and ask Apple to license Windows and provide the OS as an option to buyers, or ask Apple to supply Macbook hardware so Microsoft could sell Macbooks with Windows on it, Apple likely would have said no too.

Re:Welcome to the M1 Windows project by FireBeyond on Tuesday June 07, 2022 @03:49PM (#31659229)
Yeah. "Well Microsoft has Windows running on Surface ARM tablets, so..."

Maybe Apple can offer to run Windows on iPad? No...?

I agree with you.

Re:Welcome to the M1 Windows project by Arnavion on Tuesday June 07, 2022 @02:20PM (#31658194)
Yes, there is a public stable API for Windows drivers. Even the built-in drivers are dynamically loaded.

Windows on ARM isn't new. The oldest Windows on ARM was Windows 8 RT (ARM32 only, I believe). Right now it seems Windows 10 and Windows 11 have ARM64 versions, but there was also Windows IoT Core from the Windows IoT OS branch a few years ago.

Re:Welcome to the M1 Windows project by oneplane on Tuesday June 07, 2022 @03:17PM (#31658858)
Windows CE on ARM and Windows PocketPC on ARM is older than that. But all of it has the same issue: you nearly always need a specific rebuild for a different ARM-machine because there isn't a single "ARM PC". Just like x86 pre-ACPI where you need different HALs and bringups for different systems. The problem here is twofold: firstly windows is closed so you can't actually add/modify components and rebuild it, only binary hacks and additive installation (like driver packages). Second issue: licensing. ARM isn't available unless you are an OEM. So there is no legal way to run Windows on M1 unless you are Apple and Microsoft signs you a contract (and that hasn't happened either).
Re:Welcome to the M1 Windows project by Arnavion on Tuesday June 07, 2022 @03:48PM (#31659223)
Haha, yes, I completely forgot about PocketPC.