Frage

EDIT - I'm sorry that I made this post more complicated than it should. I won't delete this post in case someone with a similar question needs help.

I recently became interested in building my own Linux distro(probably just for family and friends). I have researched extensively on whether I should customize an existing distro(eg. Arch Linux, Debian) or build from scratch(LFS). I have come to the conclusion that building from scratch would best fit my needs(Im on no time constraint).

My main question is:

Would it be possible to build an application that functions as a full OS, and just program the linux distro to run it at launch?

Second main question:

Would doing this way restrict programs from being installed? Would developers have to make a custom version of their software to run on this mock OS?

Problems I see in this:

-If I use a language like c#, would that work? or does it require windows natives?

-If I use java(probably not), but if I would, would I have to package JRE with the distro?

-If I use something like java, can I use libraries like LWJGL(for openGL for stuff like window frames)

-Does java or c# use special file system methods? Would I need to make the Linux base build the file system for the VM language to use? Or can I arrange all that in the mock Os itself?

-Performance problems with VM languages?

-Are there any legal problems with packaging things like JRE or if I find a way to use windows natives?

Additional notes:

-I have no concern on time, even if just the file system takes me 3 years.

-If building this from scratch would not be possible, would I be able to customize a distro in order to function like this?

-I understand that I would have to make linux handle stuff like hardware drivers, because communicating with hardware is not something in my ballpark. Would this mean that I have to customize something like Arch Linux?

I am very sorry there are so many questions in this, and if I had enough reputation to add a 500 rep bounty I would.

War es hilfreich?

Lösung 2

The short answer is add this to your kernel command line:

init=/path/to/my/application

Typically the first process a Linux kernel will start is the init process. init takes care of running the startup scripts for everything else that needs to start at boot-time - e.g. kernel modules, daemons, console login/x desktop.

You can tell the kernel to use any userspace binary you like instead of the default of /sbin/init, as above, though you may still want some of the startup script to run.

Though more likely, you'll want to edit the startup scripts to just run one application (Is your application text or X-based?)

Alternatively you could hack the kernel to run your application in kernel space, and possibly never even start any processes. But that would be a nightmare to debug/maintain.

Andere Tipps

An operating system is really a huge undertaking. There have been attempts to build a system to create custom OSs in C# called Cosmos, which I've considered looking into several times. In most cases though, applications probably would have to be specifically built for the OS. I may actually bother, now that you've reminded me.

Obviously, the result would not be Linux, but rather a custom OS built using Cosmos. That's probably the closest you can manage using C#.

So in summary: If your goal is to execute managed code on a machine at the most basic level, Cosmos is probably what you want. You will still be doing almost everything, but you'll have some insulation from the actual guts of the machine.

EDIT: Alternatives include Mosa, which does not use Visual Studio, and Singularity, which you can only use for research, but was produced by Microsoft directly.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top