Is there any way to write an operating system in Java? I know it's possible to use C, but I prefer Java. It's easier to use.

Recommended Answers

All 38 Replies

A small portion of the OS would need to be written in assembly, beyond that it's theoretically possible to use Java, though I'm not sure if it's been attempted.

You would probably wind up using JNI(think that's the right now), and a lot of other third party api's and such...Just my guess though.

just remember that you'd probably have to code your own jvm into the OS somehow

Dogtree- Yeah, I know that, same as with C.
server_crash- Yeah, I know that, same as with C.
Phaelax- Yeah, I know that, same as with C. :)
Actually, I was looking at Kaffe. Does anyone know of a JVM written in C or assembly that doesn't require things such as stdio.h? (which I apparently can't write, BTW)

Found one- I'm just going to modify jNode.

Why... of course that isn't a JNode code snippet.. what a coincidence that the same exact code shows up in jNode and my OS!


PS: I need a name for it now.

If you have hardware with a JVM built into it (which is possible) you can indeed write the rest in Java.

PS: I need a name for it now.

Name it after me.


PS: I wrote Windows XP in java(not many know this), so if you need any help you can contact me.

Hi everyone,

PS: I wrote Windows XP in java(not many know this)

Is this really true?? Did you also write the kernel in java??
What about the networking part(talking to the modems using java)??

What about disk partining and formatting - were these codes also written in java??

Can your OS support most of the hardware on the market??


If you have really created something like that i think you should open-source it so people could further develop it as i think that such an OS could be very beneficial to the computer world.

It would really be great to hear a reply from you on this topic

Thank You

Yours Sincerely

Richard West

server_crash: No, that would imply that it crashes when used as a server. :( But I might need a little help. It will be open source, probably under the GPL.

You people actually believed that I wrote XP? Did you know that I also invented the internet(Not many know that either)?

Actually, no, I didn't believe that. But I do know that you're good with Java...

And I built ENIAC :)

(now take a guess at how old I am... just kidding)

Update: It will be a Linux distro with most of the tools written in Java. I still need a name...

w00t (what's that mean anyway?) I'm now a "Posting Whiz" :)

Update: It will be a Linux distro with most of the tools written in Java. I still need a name...

w00t (what's that mean anyway?) I'm now a "Posting Whiz" :)

What are you thinking? Name it after me...

By the way, get some more traffic to your forum so I can start posting again.

Start telling people about it :)
Like I said, naming it after you would imply that it would crash when used as a server...

How long do you think this will take you?

Until I can get a Linux distro to install... plus a few weeks.

BTW, I just got a PM asking for advertising at Compuchat :)

ohhh that's good. I'll visit and click on the ads as often as I can.

Update: I'm back to writing the OS again. Eventually, I'll at least get it to boot... then I'll worry about the Java part. All it does now is say "Loading MikeOS... Boot failed."

I didn't finish the kernel yet :( Anybody know C?

so what language did you use when you dont know c?

Java.
(duh :)

You need to post screenshots of your work in progress.

<table bgcolor="black">
<tr><td>
<font color="white">Loading MikeOS...
Boot failed - kernel not found.
</font>
</td></tr>
</table>
I haven't gotten the kernel to compile yet :(

Update: The kernel (which is now C++, java support will be added later) just compiled!

How do you actually implement the code on a bare bones system? I mean, will the code run from a cd and know everything to do from there?

I'm still working on it. I haven't quite figured out how to take a screenshot in text mode, but I just booted it from a floppy and it said "Hello World!" and hung. That was written in C++ though.

EDIT: I misunderstood the question. To make the code run without an OS, you have to write a "stub" program in assembly.
(Or do what I did, take an existing one and change the name of the file that it loads :)) Not sure why it's under the VB section, but here's anarticle on how to do it: http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=6718&lngWId=3

Hi everyone,

Okay i really thought servercrash had written winxp in java

Richard West

You can't write an OS purely in Java. I've even heard you can't do it in c/c++ either...But don't know if that's true or not.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.