Microkernel for JVM
Posted: Sun Oct 17, 2010 3:42 pm
Hello,
I'm currently trying to design a microkernel (currently only x86 32bit, but 64bit would be fun though later on) that is solely able to run a SINGLE Java Virtual Machine (my plan is to put an osgi container in this and implement drivers and such as bundles, so no tasks, but threads and everything running in ring zero). I know that is it difficult, but I'm willing to invest time and efford in that, because I would really like to see it working and besides I'm learning a lot of stuff from kernel dev I didn't know before, even if I could not finish this thing.
So, I'm just asking here for some advise, how you would, e.g., implement the memory manager for such a project, just to be sure I get it right, before wasting a lot of time. My plan is, just to identity map the whole available mem. Well not exactly identity mapping, just mapping around memory holes so it seems like there is a contiguous space of memory. Is there any kind of problem or issue attached with this? Other than that I'm not going to be able to use 4MB pages for addressing 64GB in 32 bit.
So actually, in this design I would have my kernel starting at 0x100000 (1MB) and ending a few megs after. From this space on, there will be the heap (and maybe some sort of stack, I'm currently figuring out how it works) for the jvm.
The libraries I think I would have to port to make a simple JVM implementation working (like JamVM, I guess) are (mainly) libc, libm and pthreads. The first ones (libc and libm) are covered by newlib, as far as I know. The last one I would have to implement on my self, right? So do you know any good tutorial for threading or even porting the POSIX threads?
Rgds Farok
Edit: Typo
I'm currently trying to design a microkernel (currently only x86 32bit, but 64bit would be fun though later on) that is solely able to run a SINGLE Java Virtual Machine (my plan is to put an osgi container in this and implement drivers and such as bundles, so no tasks, but threads and everything running in ring zero). I know that is it difficult, but I'm willing to invest time and efford in that, because I would really like to see it working and besides I'm learning a lot of stuff from kernel dev I didn't know before, even if I could not finish this thing.
So, I'm just asking here for some advise, how you would, e.g., implement the memory manager for such a project, just to be sure I get it right, before wasting a lot of time. My plan is, just to identity map the whole available mem. Well not exactly identity mapping, just mapping around memory holes so it seems like there is a contiguous space of memory. Is there any kind of problem or issue attached with this? Other than that I'm not going to be able to use 4MB pages for addressing 64GB in 32 bit.
So actually, in this design I would have my kernel starting at 0x100000 (1MB) and ending a few megs after. From this space on, there will be the heap (and maybe some sort of stack, I'm currently figuring out how it works) for the jvm.
The libraries I think I would have to port to make a simple JVM implementation working (like JamVM, I guess) are (mainly) libc, libm and pthreads. The first ones (libc and libm) are covered by newlib, as far as I know. The last one I would have to implement on my self, right? So do you know any good tutorial for threading or even porting the POSIX threads?
Rgds Farok
Edit: Typo