sdk icon indicating copy to clipboard operation
sdk copied to clipboard

Port DotNet Core App to New CPU

Open zero0000zero opened this issue 8 years ago • 13 comments

How to port DotNet Core app to new cpu?

zero0000zero avatar Aug 02 '18 09:08 zero0000zero

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.

livarcocc avatar Aug 02 '18 15:08 livarcocc

Port .NET Core app to a new CPU. The CPU has a different instruction set.

zero0000zero avatar Aug 02 '18 20:08 zero0000zero

Port .NET Core console app to a CPU different with x86. The CPU has a instruction set that at least have arithmetic instructions.

zero0000zero avatar Aug 02 '18 20:08 zero0000zero

Do you mean target x86 or x64? You can set the architecture for that, when publishing your application.

livarcocc avatar Aug 02 '18 20:08 livarcocc

I mean target a CPU that is not x86. It is also not x64.

zero0000zero avatar Aug 02 '18 20:08 zero0000zero

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.

livarcocc avatar Aug 02 '18 21:08 livarcocc

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?

zero0000zero avatar Aug 02 '18 21:08 zero0000zero

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?

livarcocc avatar Aug 02 '18 21:08 livarcocc

I want to build a new CPU as a software. And I want to run .NET Core app on that CPU.

zero0000zero avatar Aug 02 '18 21:08 zero0000zero

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.

livarcocc avatar Aug 02 '18 21:08 livarcocc

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.

nguerrera avatar Aug 02 '18 22:08 nguerrera

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.

tannergooding avatar Aug 02 '18 22:08 tannergooding

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.

livarcocc avatar Aug 06 '18 18:08 livarcocc