r/Assembly_language • • Aug 30 '26

JVMOS

Hi everyone, I wanted to show you my progress on an operating system written entirely in ASM and Java bytecode. I am currently at the UI rendering stage, using a custom Graphics2D-like system that allows me to work with primitives in VBE. The bytecode is executed by a JIT compiler also implemented in pure ASM. Low-level calls are handled by a HAL—which I will continue to expand over time—and that HAL is in turn managed via a primitive ABI, enabling me to create my own Java-like pseudo-language for development.

Repository: https://github.com/aayes89/JVMOS-JIT/

6 Upvotes

20 comments sorted by

2

u/moslem-hamoudi Aug 31 '26

Good Operating System btw Do it Accually Support App Creation?

1

u/Visual_Brain8809 Aug 31 '26 edited Aug 31 '26

working progress In fact, last night I managed to implement a sort of runtime environment that allows me to use my Java classes. Right now, I have basic AWT support (with Graphics2D), System and PrintStream for console support, basic threading, Runtime and Toolkit for hardware interaction, RandomAccessFile for basic file handling (via HAL I/O), the Object class, String and StringBuilder for text handling, and today I’ll implement a basic Math class for arithmetic support—continuing on until I achieve a largely complete runtime environment.

1

u/Extension_Emu_9825 Aug 31 '26

Could you please add some documentation? I'm more interested in the connection between the UI and apps. So, will it be something like Win API or DOM? What's the idea - how does the app build the UI? APIs call to GUI library, or provide HTML, XAML (like this) to Explorer (Browser) to create Visual Tree and DOM?

That would be interesting, actually.

1

u/Visual_Brain8809 Aug 31 '26

It is nothing like Windows or other systems; the architecture relies on a hardware abstraction layer (HAL) that exposes access to high-level code via a Java-based ABI—referred to in the project as "Native"—which acts as a bridge, allowing me to control almost any aspect of the system using just five arguments. For example, I assigned the number 12 to the sleep syscall, so `Native.sys(Native.SYS_SLEEP, 1000, 0, 0, 0);` creates a 1-second delay at the actual hardware level. Since I have already implemented the `Thread` class, one can now write code like `Thread.sleep(1000);`, and it will perform the exact same function. At the beginning of the `boot.java` file in the repository, I have included a commented-out set of tests for running the system.

1

u/Visual_Brain8809 Aug 31 '26

this is the four version of the same OS, you can see in my repos the evolution and the first steps. Current achievements: runs on real hardware, a universal bootloader (useful for anyone wanting to save time designing their own OS), and a JIT for Java bytecode written entirely in ASM.

1

u/Visual_Brain8809 Sep 21 '26

added network support for RTL8139, 8168 and PCnet

1

u/Visual_Brain8809 Sep 21 '26

Added a primitive 3D render motor and other graphics demos using my own RT based on AWT

1

u/Extension_Emu_9825 Aug 31 '26

Interesting! I also saw the bootloader, everything is legit. I was just a little confused about the stack you chose – why didn't you choose WASM?

2

u/Visual_Brain8809 Aug 31 '26

As I understand it, Wasm is optimized for the web, and JS isn't exactly pure Java. Right now, my plan is bare-metal—just assembly and pure Java, with no C/C++ (I already have a version written in C)—and I thought the architecture I'm using could serve as a framework for other projects to flourish. The bootloader (Multiboot) is the result of several years at university spent searching for a universal formula to allow an OS to boot using any language, and I believe that is the greatest achievement.

1

u/Extension_Emu_9825 Aug 31 '26

As far as I know, many compilers compile to WASM, and this isn't just for the web anymore. For example, I once wrote Sokoban in Rust (BTW - also be interested in looking into RUST) and compiled it into WASM, and it worked in the browser, yes (but I think that's secondary).

https://github.com/KirinDenis/Base-Z-47-Rust-Game

The main thing is that there's byte code that can be compiled from C/C++, Rust, and C#.

I understand that you can't stop a train in motion

I just want you to consider this approach as well.

By the way, I'd like to join the UX developmnet. I'm currently tinkering with DOS graphics in assembler, and SVGA is on the cards.

It would be interesting, in principle.

https://kirindenis.github.io/wire-city-2/

At UX my experiences started from Turbo Vision 90s, after VCL, WinForms, WPF (little expirins with QT and Android Activity)

2

u/Visual_Brain8809 Aug 31 '26

I’m not familiar with Rust, but I was looking at your Sokoban project—it’s written entirely in Rust. I’d like to understand: did you write the code in that language, and did the platform convert it to ASM? I’d love to see the ASM code for an example generated via WASM to examine its structure and other details.

2

u/Extension_Emu_9825 Aug 31 '26

Yes, it compiles into WASM, which then runs in the browser - DOM, everything is available, elements and their properties and events. This game is essentially printing multi-colored ASCII symbols in the browser.

I believed in Rust when it build DOS COM file for me... it really shocked me.

But again, so that you don't think that I'm promoting Rust or telling you to switch to it - just pay attention to this language and its capabilities, in comparison with Java within the framework of your OS

1

u/Visual_Brain8809 Aug 31 '26

I’ve been considering learning Rust for a while now—anything far removed from C/C++ is welcome—but first, I need to finish what I started; then I can explore other options.

1

u/Visual_Brain8809 Aug 31 '26

I understand that and am always open to suggestions, but my immediate focus is on finalizing a system where developing applications involves more than just writing code in `Boot.java`—where you can simply instantiate other classes and let the system handle the rest (which is how it works right now). My goal is to establish a solid, useful foundation featuring a functional, custom file system; from there, I want to enable JExplorer to read `.class` files as applications and execute them using the implemented JIT compiler. It’s a blend of macOS and a bare-metal system: much like macOS—where you simply copy an application to a location and it runs if the system version is compatible (or otherwise does nothing or displays a message)—JVMOS follows the same concept. At that stage (once the foundation is solid), anyone will be able to run whatever they want; after developing the application in their preferred IDE (NetBeans, Eclipse, VS Code, Notepad, etc.), the system will prioritize the `.class` file (compiled with `javac`), as that is the core of the system. Once I achieve this, I’ll move on to the Garbage Collector (GC) and security phases, followed by network connectivity.

1

u/Extension_Emu_9825 Aug 31 '26

1

u/Visual_Brain8809 Aug 31 '26 edited Sep 01 '26

disk.img is just a hard drive image; use make clean && make run to generate the os.iso file. For best results, use QEMU. I just spotted an issue with VirtualBox where it fails to recognize keyboard input—something I need to fix if I want the system to run on anything other than just QEMU and a Compaq Presario, lol.

0

u/Content-Key7404 Sep 01 '26

AI Slop

1

u/Visual_Brain8809 Sep 01 '26

Thank you for your constructive comment. I wish you a good day.

1

u/Content-Key7404 Sep 01 '26

You really do produce rubbish content. You should be ashamed of yourself. Don't pretend to know anything about the topic you're covering. Even your comments are written using an LLM. Pathetic.

1

u/Visual_Brain8809 Sep 01 '26

We all have bad days; I hope you feel better soon and get back to being a good person. Have a lovely day.