I've been creating a Java-based OS in my spare time. I've been trolling around for quite some time, but before now most of what I need to be discussing has already been discussed. (The search button has been my friend indeed. : ) )
But anywho, now that the infamous intro is over, its always been my opinion that a Java-based OS has far to many advantages to not give it a second look. Imagine if a standard feature of your OS was to check for and generally make impossible stack overflows, buffer overuns, and fun with pointers; this includes most of the kernel as well. And not only is the protection done in software, so it can run on processors without or with minimal protection, but since user-space programs don't deal directly with addresses, you can run the same programs on processors with and without an MMU (which has been one of the only problems that I've heard about porting the Linux kernel to other platforms. Yes there is uC-Linux, but that has some of its own problems). And consider that fact that all Java code is type-safe. How many times have you screwed up something with a void pointer and it took days to figure out what had happened? And now that Java is the number one language on sourceforge, that means that most of the programs there are binary compatible with the OS.
But as have been pointed out, there are disadvantages too. Speed is one. However, if coding correctly (ie. brute-force = evil), it can be brought down to manageble levels. And there is the idea which JIT is a really bad idea. One shared by the singularity team as well as myself. I can only imagine the mess if the entire runtime of the system had to be compiled at boot. However if you staticaly(sp?) compile, you loose all the object file verification, or at least its not nearly as easy. I've been of the idea that a VM in the lines of Sun's HotSpot would work wonderfully here. But, I don't have an answer for everything, here's a few that I'd love to hear some debate/ideas about:
- Obtaining optimizations from hardware. Ie. How do you not waste an Altivec unit?
- Initing with all of the classes in a way pertaining to my programming model. I've been taking a lot of cues from micro-kernels in using modules, but its hard to do this without writing a whole FS/HDD driver on the C++ side of things which is something that I really want to stay away from.
- Any thing else that anybody can think of. Please poke holes in my design philosophy; if there's a problem, I don't need to be doing much more in the kernel before i get it fixed (a gram of prevention <-> a kilo of cure : P).
And thanks all. Though you dont know it because I haven't posted before now, you've all been immeasurably helpful in the creation of my project.
*edit* I forgot another plus. More or less all of the components of the operating system (excluding the init code) can be tested on more... "mature" OS's with JVMs. Ie. I can run my VFS implementation on Windows ^^)