Ok , I have been programming my own operating system from scratch with c and asm. Wrote my own bootloader.
changed my system from real mode to protected mode , setup interrupts , paging, TSS ,...etc etc
started writing kernel network nic drivers , VGA driver , ....etc
I can theoritically write an OS in pascal , or any other computer language that is compiled down to machine code.
What I am wondering is how you create an OS in
java? I have seen these OS they exist.
Bascially I have to beable to compile the JVM into the kernel and pass it the java bytecode. ( I don't even know if this is the best way to go about it)
I don't know if their is any open source JVM that I can tweak so when I start my kernalMain function I can jump to some function of the JVM in memory passing it the bytecode.
Eitherway even if this is the way to go about it I don't know how I can convert the JVM to be a flat binary instead of dll ... I am just a little lost in what is the correct way to go about it.
Their are tools like gcj that compile java down to .exe file format but I would really need it to be a flat binary format....
something like nasm -f bin filename.asm would give me or something that a linker script FORMAT(BINARY) would do when passing it to ld.
With gcj I don't know if it allows linker scripts and compiling to bin. If their was a way to use gcj and compile/link to a bin then I could bypass the whole trying JVM issue above.
Thanks for any help
This is about as advanced as it gets so I don't except anybody to beable to answer it completely. But any help would be great.
Also If their is some way I can use the JNI as well since I need this to make calls to c and asm to do outb(0x60 or 0x64 ,...etc for the keyboard ,......and main other driver thing.
Things that asm or c can only do which is why I need the JNI as well.
I have used the JNI
alot however I always had to create a dll or .so and load the library. My problem is can you use the JNI with out making a dll. The reason why I say that is I need a way from java to directly call a c function not be going thru a dll /loading a dll . .. my os is not that smart and and doesn't support dll, exe PE file format.
It only supports .com , a.out the simple exe file format nothing as complex as PE or ELF yet.