Is it possible to create an operating system using java?

I want to know whether it is possible to create an operating system such as windows-xp written in C, for example, I can write it in java so that I have the same functions as in C

+27
source share
7 answers

In theory, yes, but you still have to have some low-level assembler code to bootstrap the Java virtual machine, which will run on the machine, as well as low-level code to access the hardware drivers.

From wikipedia :

Given that Java Sun Microsystems is today one of the most dominant object-oriented languages, it is not surprising that attempts have been made based on Java systems. In this area, ideally, the core consists of the minimum required minimum to support JVM. This is the only component of such an operating system that should be written in a language other than Java. Built on that JVM and basic hardware support, one could write the rest of the operating system in Java; even parts of the system that are more traditionally written at a lower level, such as C, such as device drivers, can be written in Java.

Examples of attempts to such an operating system include JX, JNode, and JavaOS.

+36
source

In theory, yes. But you need to somehow get the Java virtual machine to work with low-level code (unless you want to compile Java before the build, which is probably not possible without sacrificing a lot of Java features).

+5
source

In theory, you could write an entire OS in Java using a Java processor . It mainly uses Java bytecode as a set of instructions for the processor

+5
source

It depends on what you consider "features." If you mean the graphical interface, spectacular window effects, etc., then yes, although you need assembly language or C for the very least significant bits (i.e., pairing with I / O ports, etc.). If you also include Windows ABI as a function, then it gets harder as they follow the Pascal calling conventions.

+3
source
OS

closer to the hardware (e.g. drivers). in my opinion, this is not a Java area (just the wrong solution to the problem area operating system).

+3
source

As mentioned above, this has already been done. Jnode is the only one that has stood the test of time and is actively working, although they have not released a new build for many years. But if you look at their Git commits, they are working on an imminent release when I write this. I am a fan of Java and look forward to the release. People who hate verbose imperative languages ​​like Java eat up the idea, but this is not for everyone.

Also interesting is the idea of ​​implementing Java byte code at the hardware level. I don’t think it will be anywhere, since the strength of Java is that you don’t have to worry much about hardware. You just need to get a Java OS, and you can run it on any JVM.

I believe that the true power of Java in the OS domain is virtualization. I can't think of a better way to have a virtual OS, since Java is everywhere.

Like the other posters noted above, it cannot be fully implemented in Java without the hardware implementation of Java. Jnode is completely written in assembly and Java. But then all modern operating systems use some assembly language.

+3
source

Source: https://habr.com/ru/post/984993/


All Articles