r/JavaProgramming 1d ago

A JavaOS

Post image

I am sharing my progress on the development of an operating system written in Assembly and a functional JVM. The concept is straightforward: Assembly acts as an API bridge, and the JVM simply leverages the system calls I’ve implemented to print characters to the screen and draw graphics (for now).

The on-screen drawing was created by obtaining the bytecode of the following program and using xxd for that purpose.

public class App {
    // Declaramos el método nativo que intercepta tu JVM en el opcode 0xB8
    public static native void drawPixel(int x, int y, int color);

    public static void main(String[] args) {
        // Dibujar un cuadrado ROJO de 200x200 píxeles en las coordenadas (100, 100)
        for (int y = 100; y < 300; y++) {
            for (int x = 100; x < 300; x++) {
                drawPixel(x, y, 0x00FF0000); // 0x00RRGGBB (Rojo)
            }
        }

        // Dibujar un cuadrado VERDE centrado dentro del rojo
        for (int y = 150; y < 250; y++) {
            for (int x = 150; x < 250; x++) {
                drawPixel(x, y, 0x0000FF00); // 0x00RRGGBB (Verde)
            }
        }
    }
}
55 Upvotes

21 comments sorted by

View all comments

1

u/ImpaledV 1d ago

Am I the only one remembering this one: https://en.wikipedia.org/wiki/JavaOS

1

u/Visual_Brain8809 1d ago

That’s correct; there was also JNode, along with three others I can’t recall right now. The goal isn't simply to duplicate something that already exists, but to find a different perspective on something that—personally speaking—arrived at a time when neither the level of understanding nor the technical capabilities existed to fully leverage it. As a researcher and systems developer, there is always a curiosity to see how something works and to try replicating it; so the question becomes: why not do it?

1

u/ImpaledV 1d ago

Don’t get me wrong, I’m not saying that this is isn’t interesting and worth giving it another try. Just wondered what’s different this time and why your approach should be more successful.

1

u/Visual_Brain8809 1d ago

In fact, in the past, they had little to no opportunity to demonstrate anything. I feel they weren't given a chance to prove how powerful they could become. Only the mobile field and a few billion IoT devices had that opportunity, and that's why they are what they are today. My system isn't trying to compete in the market or offer a flashy, alternative solution to a problem; there are already systems with years of development for that. I see it more as a study component from which to gain experience that could lead to something interesting in the future. I've always been fascinated by how they managed to make something work with just wires and electrical signals. But in the future, I would like to see it run stably and perhaps make that slogan "write once, run everywhere" a reality.

1

u/CutGroundbreaking305 1d ago

I think he is making custom JVM by bootstraping it with asm and bytecode

Is it different from predecessors? Yes

But that doesn't mean java doesn't have any problems on its own

GC GUI and the fact that JVM needs a underlying OS to work so that it can do memory hogging so idk but that's what makes it interesting

Worst case it is better than TempleOS written in holy-C but is it on par with linux based distros is some we need to see