Port DotNet Core App to New CPU
How to port DotNet Core app to new cpu?
I am not sure what you mean by this question at all. Can you clarify? What do you mean by new cpu? And what do you mean dotnet core app?
Do you mean a new distro? If your application is a framework dependent application, it will work on any distro where you have the shared framework installed.
Port .NET Core app to a new CPU. The CPU has a different instruction set.
Port .NET Core console app to a CPU different with x86. The CPU has a instruction set that at least have arithmetic instructions.
Do you mean target x86 or x64? You can set the architecture for that, when publishing your application.
I mean target a CPU that is not x86. It is also not x64.
Like arm? Like I said, if your app is a framework dependent app, there really isn't anything you need to do. Just install a shared framework in the machine you want to run and use that shared framework to execute your app.
We have x86 and x64 for windows. x64 for a bunch of linux distros and arm32 and arm64 as well, for .NET Core 2.1. You can see a list of distros (with their bitness) at dotnet/core-setup.
The CPU is not x86, not x64, not arm32 and not arm64. There is no shared framework in the machine. How to install the framework?
You can go to https://www.microsoft.com/net/download to download a shared framework for the distro/CPU you want to run against.
If that distro/CPU is not available, it means it is not supported by .NET Core. You can then file an issue on dotnet/core-setup asking if/when such distro will be supported.
Can you tell us exactly where you a looking to run your application?
I want to build a new CPU as a software. And I want to run .NET Core app on that CPU.
I don't believe we have any guides regarding that, actually.
I would imagine you will have to build the whole stack for this new CPU, from CoreClr, Corefx, Core-Setup and CLI, but I like I said, we do not have such guides.
You want to port the whole .NET core stack to a new instruction set? And not to an existing instruction set that .NET Core doesn't support yet, but one that you are defining yourself and implementing with a software CPU emulator? What operating system runs on that CPU? If I understood correctly, that's a huge project.
You would have to port the runtime (https://github.com/dotnet/coreclr) first. For example, you can see just how much work has was (is) involved in (unfinished) port to Linux/x86 here: https://github.com/dotnet/coreclr/issues/8188. And I would think that would be easier than what you're asking because the runtime already supported x86 on Windows and Linux on x64.
Try coreclr gitter chat: https://gitter.im/dotnet/coreclr
You'll find some runtime experts there.
from CoreClr, Corefx, Core-Setup and CLI, but I like I said, we do not have such guides.
Actually starting with LLVM/Clang most likely. You aren't going to get much of anywhere without a C/C++ compiler that can compile the host and runtime to target your new CPU. You also need some OS library to provide many of the core functions, and if you are looking at "minimal" work, that will involve recompiling Linux (and a number of other dependencies) for your CPU.
Bringing .NET Core to an existing CPU architecture is already an immense undertaking. Bringing it to an entirely new CPU architecture would be on a whole other level.
Going to close this issue as some pointers have been provided. Plus, I don't believe this is the right repo to discuss this at this point.