Open-Shell / Open-Shell-Menu

Classic Shell Reborn.
MIT License
7k stars 433 forks source link

Support for ARM/ARM64 Devices... #553

Open cocus opened 3 years ago

cocus commented 3 years ago

Current builds of OpenShell are x86 and x64, but they don't support ARM variants. Due to the "growing" popularity of ARM64 Windows systems, a native ARM x64 build would be amazing.

If I'm not mistaken, adding new targets that support the new architecture should "work" (don't quote me on that, please!). I have no idea if this is the only thing needed. I can help out the devs with access to a Lumia 950XL running Windows 10 2H20.

Dosbox-X is another project that already has native support for ARM64 Windows, and it does run pretty nice over there!

And by the way, running the x86-x64 on the ARM64 Windows doesn't work at all.

ge0rdi commented 3 years ago

Thank you for letting us know there is somebody with ARM64 device out there :)

I'd like to work on ARM64 version (I even have Surface Pro X device at hand). But honestly, there are just few people that would use it (yup, I hope it will get better over time).

Most of code should work well after recompilation to ARM64. But since Open-Shell does kind of hacks in system (hooking, etc), these may require some modifications (or maybe not).

I'll try to get to this during my Xmas vacation.

cocus commented 3 years ago

Ah, yes, the infamous hooks! Right, I didn't dive deep in the code to check if there are ASM thunks, but in the worst case that could be modified :) I tried to add ARM64 in the vs configurations but I failed miserably because for some reason the "Lib" is being compiled for x86 (even after a full clean).

Edit: I was missing half of the libraries. I did manage to build it, tho I'm not sure if that was enough. I copied the ARM64 folder from the root of the repo to the target, ran the StartMenu.exe, it "tried to load" but then explorer crashed. it restarted, and crashed again. All this time I saw StartMenu.exe open. I've managed to kill it, but seems like it left some weird traces behind, like the task buttons use ALL the space on the taskbar and the size of the rect of each element on the desktop is really wide. image I'm attaching a picture of the aftermath.

I'll try to setup the remote debugger, but I'm not sure if it'll be that easy to debug the .dll when it gets loaded on explorer.exe. Do you have any insights on this?

Edit2: I've managed to setup remote debugging and I've pinpointed the issue on the SetWindowsHookEx() of https://github.com/Open-Shell/Open-Shell-Menu/blob/283c0fce03f0804a6d8a79728b2630e588e6dcb2/Src/StartMenu/StartMenu.cpp#L101

I've validated that hHookModule and thread point to a valid element (i.e. hHookModule points to StartMenuDLL.dll's hInstance and thread seems to be the thread of the taskbar PID).

Edit3: I've stubbed out the HookDesktopThread() on StartMenuDLL.cpp (i..e returning the CallNextHookEx), and it still crashes. I found out that UpdateTaskBars() makes the thing crash instantly. Haven't dive deep enough to validate this. I'm relying on the LogToFile to debug the DLL, which is kinda a pain...

todonoghue commented 3 years ago

Running Windows 10 (ARM) on Parallels Desktop 16 Tech Preview on M1 MacMini9,1. Would really love to see and ARM port of Open Shell. Happy to help test.

Thank you!

XP-Luna commented 3 years ago

I use Windows 10 on ARM on a MacBook Air with Parallels. I would also love to see an ARM-version of OpenShell.

Mattiwatti commented 3 years ago

I installed Windows for ARM64 on a Raspberry Pi for fun recently so I thought I'd try to get this to work. It mostly went well, except for Classic IE, which I believe I could get to work if only Internet Explorer wasn't completely broken, fork bombing my poor Pi:

image (there's actually thousands of these processes after only a second or so.)

I haven't tested Classic Start and Explorer very extensively, but everything seems to be working okay:

image

@cocus: I suspect the reason for your crashes was indeed the IAT hooks. These use x86/x64 specific assembly which I rewrote for ARM. I didn't have any other issues after doing this.

Since I can't test Classic IE, I will just make a PR with that left out (to be honest I'm not sure if anyone will really miss it...) and see if it gets merged. I just need to iron out some issues with the installer first. If anyone does have an ARM64 version of Internet Explorer that actually works and wants to test this, let me know.

XP-Luna commented 3 years ago

Internet Explorer works in my installation, but what exactly did you do to get the Start Menu working?

Mattiwatti commented 3 years ago

Great. Can you let me know if the Internet Explorer in C:\Program Files\Internet Explorer is really a 64 bit ARM native IE, or is it only a wrapper that launches the WOW64 IE in C:\Program Files (x86)? (This makes a difference for the DLL that needs to be loaded into the process.)

what exactly did you do to get the Start Menu working?

Not all that much really, I just grepped for _WIN64 specific stuff that was really x64 specific stuff and added ARM alternatives there. The only tricky part was the x86 specific IAT hooking that Open Shell uses, this took me a little while to figure out because I don't know much about ARM assembly.

XP-Luna commented 3 years ago

Great. Can you let me know if the Internet Explorer in C:\Program Files\Internet Explorer is really a 64 bit ARM native IE, or is it only a wrapper that launches the WOW64 IE in C:\Program Files (x86)? (This makes a difference for the DLL that needs to be loaded into the process.)

Bildschirmfoto 2021-02-09 um 11 43 41

I think it is emulated because it´s showed as 32-bit in Task Manager. (Windows is not in English, sorry)

Not all that much really, I just grepped for _WIN64 specific stuff that was really x64 specific stuff and added ARM alternatives there. The only tricky part was the x86 specific IAT hooking that Open Shell uses, this took me a little while to figure out because I don't know much about ARM assembly.

Is it possible for you to upload your version of OpenShell for ARM?

Mattiwatti commented 3 years ago

Yes, that's definitely 32 bit. Thanks.

Is it possible for you to upload your version of OpenShell for ARM?

Well I was actually going to make a pull request, but while you're here and since you have a working IE, if you don't mind could you try out this build first to see if Classic IE works at all?

OpenShellSetup_4_4_1000.zip

XP-Luna commented 3 years ago

So I think... no. It doesn´t look different at all. But the Start Menu works.

Bildschirmfoto 2021-02-09 um 14 02 54
Mattiwatti commented 3 years ago

After trying Classic IE, I have the same thing on Windows x64. It took me a long time to find out that it was actually doing anything at all. For example, there is no 'classic explorer bar' as far as I can tell. I'm not sure if it's always been that way (I've never used it) or that this is some bug. But if Classic IE is working, there will be a 'Classic IE Settings' item in the Tools menu, like this:

image Then there should be some (fairly minimal) settings, such as what to display in the title bar. Make sure that the Classic IE addon is enabled (click the cogwheel and go to 'manage add-ons' to verify.)

Edit: I've since managed to fix my own IE and Classic IE appears to work. So I will make a PR for this shortly.

XP-Luna commented 3 years ago

No setting makes any difference but the menu is there

Bildschirmfoto 2021-02-09 um 17 43 33
Ibuprophen commented 2 years ago

First a bit of background...

Windows on ARM: Windows on an ARM system uses a system called CHPE Files (Compiled Hybrid Portable Executable Files). This is something that's specially compiled coding for ARM devices.

Windows on ARM64: Windows on an ARM64 system still uses a system called CHPE Files (Compiled Hybrid Portable Executable Files), but it's technically an ARM64EC (Emulation Compatible). This is both backwards compatibility to ARM and the additional Emulation Compatibility for software to run within an Emulation Environment that's not specifically developed for Android Specific Architecture/Hardware.

With that stated...

The Open Shell software is not developed under this environment without the assistance of an Emulator.

This ability would require allot of work in creating a new repository branch and a complete revamp in a different Coding Language.

I tried to explain the above the best way I can via text...

Any further input from @ge0rdi would be great. 👍

~Ibuprophen

hyllm commented 10 months ago

Calling also for ARM64 support (Windows 11 in Parallels on Mac). :)

Ibuprophen commented 3 months ago

Though, I'm not promising/guaranteeing anything, but I'm looking to revive an older Asus Transformer Tablet that has Windows (ARM) OS to see if I can (possibly) get Open Shell running on it.

It will some take time and I'll post any information that may/might be helpful here (and anything applicable on the https://github.com/Open-Shell/Open-Shell-Menu/pull/641 pull request.

Anything new on your side @ge0rdi, @coddec & @XenHat?

~Ibuprophen

XenHat commented 3 months ago

I don't have any ARM64 device capable of running Windows so I cannot test this sadly

billearl commented 2 weeks ago

Running Win 11 Arm in Parallels VM on an M1 Mac using StartAllBack is not nearly as nice as using Open-Shell on previous Macs. I have an M4 Mac on order now, so Apple silicon has been around for quite a while. This might not be an issue if Parallels is near a release for Apple silicon that accepts non-Arm Win 11, but I keep hoping to see a compatible version of either Open-Shell or Parallels Desktop.

Neustradamus commented 1 day ago

It is linked to: