Java-like VM for OSes
- amd64pager
- Member
- Posts: 73
- Joined: Fri Nov 25, 2011 8:27 am
- Location: In the 266 squadron of the RFC,near Maranique in the Southern Front in the WW1
Java-like VM for OSes
I just thought if you could write your OS in bytecode,you could have a OS library(remember the java library anyone?) and a VM like the one java gives,you could add features like just in time compilation and other fancy features.
Would this be a good idea?And if it is,does anyone know some more ideas for it?
Would this be a good idea?And if it is,does anyone know some more ideas for it?
It's surprising what the semiconductor industry's definition of macro is and what the CS description is.
Re: Java-like VM for OSes
Long Live AOT compilers. My OS does this. (this may actually one place where EFI helps over BIOS)
Get back to work!
Github
Github
-
- Member
- Posts: 255
- Joined: Tue Jun 15, 2010 9:27 am
- Location: Flyover State, United States
- Contact:
Re: Java-like VM for OSes
There are quite a few kernels that have been written in mostly Java; there is always a machine-dependent part that will need to be written in C or assembly however. And unless you are on a processor which can run the bytecode natively, there is an amount of overhead introduced by the interpretation or JIT.
For an example, see JavaOS, which also has links to several other Java OSes.
In short, there are some minor difficulties, but writing an OS in a language which is compiled to bytecode instead of machine code is definitely possible.
For an example, see JavaOS, which also has links to several other Java OSes.
In short, there are some minor difficulties, but writing an OS in a language which is compiled to bytecode instead of machine code is definitely possible.
- amd64pager
- Member
- Posts: 73
- Joined: Fri Nov 25, 2011 8:27 am
- Location: In the 266 squadron of the RFC,near Maranique in the Southern Front in the WW1
Re: Java-like VM for OSes
This is how it works:
It is made of different parts:
OSVM kernel
OSVM script parser
OSVM compiled executable parser
OSVM executable utilities
This is how the startup sequence goes:
-The bootloader loads the OSVM kernel
-The OSVM kernel loads the rest of the OSVM.
-Then the startup script is called
-The startup script can do things like print version,display a image etc.
-Then using the OSVM executable utilities,the script can link different parts of the kernel
-Then the scripts destroys itself and says the OSVM executable parser to run the kernel
Can you please suggest new ideas?
It is made of different parts:
OSVM kernel
OSVM script parser
OSVM compiled executable parser
OSVM executable utilities
This is how the startup sequence goes:
-The bootloader loads the OSVM kernel
-The OSVM kernel loads the rest of the OSVM.
-Then the startup script is called
-The startup script can do things like print version,display a image etc.
-Then using the OSVM executable utilities,the script can link different parts of the kernel
-Then the scripts destroys itself and says the OSVM executable parser to run the kernel
Can you please suggest new ideas?
It's surprising what the semiconductor industry's definition of macro is and what the CS description is.
Re: Java-like VM for OSes
So, you are describing a scripting engine or virtual machine?
Re: Java-like VM for OSes
@bluemoon:
The difference tends to blur a bit there.
@ amd64pager:
You are aware that this will not make your OS any simpler to develop? Your VM would have to handle memory management, hardware management and abstraction, I/O handling, i.e. all the stuff that a common OS kernel has to do.
What this approach does give you are the advantages of a virtualized environment - but that is an advantage that becomes tangible only after you're done with the VM.
I am not discouraging you from doing it. I just want you to avoid a common conceptual mistake - thinking that, by going this road, you could write your "OS" in an "easier" environment. As I said, you will still have to face the nitty-gritty of ring 0 kernel work; the benefits are mostly for later stages of development.
The difference tends to blur a bit there.
@ amd64pager:
You are aware that this will not make your OS any simpler to develop? Your VM would have to handle memory management, hardware management and abstraction, I/O handling, i.e. all the stuff that a common OS kernel has to do.
What this approach does give you are the advantages of a virtualized environment - but that is an advantage that becomes tangible only after you're done with the VM.
I am not discouraging you from doing it. I just want you to avoid a common conceptual mistake - thinking that, by going this road, you could write your "OS" in an "easier" environment. As I said, you will still have to face the nitty-gritty of ring 0 kernel work; the benefits are mostly for later stages of development.
Every good solution is obvious once you've found it.
Re: Java-like VM for OSes
To me it would be interesting to know if there is a (real) Java VM that can be compiled with Open Watcom and that provide a well-documented OS layer (like ACPICA has)? I'm not interested in designs that assume GCC, or that assume Linux-type functionality to be present (Dalvik).
I wouldn't want to write any OS-functionality in Java, just the ability to run Java-bytecode applications.
So, is there?
I wouldn't want to write any OS-functionality in Java, just the ability to run Java-bytecode applications.
So, is there?
- amd64pager
- Member
- Posts: 73
- Joined: Fri Nov 25, 2011 8:27 am
- Location: In the 266 squadron of the RFC,near Maranique in the Southern Front in the WW1
Re: Java-like VM for OSes
The scripting engine runs the scripts,the VM runs bytecode executables.bluemoon wrote:So, you are describing a scripting engine or virtual machine?
The VM is like a CISC machine.It has it's own LDT,GDT etc.Solar wrote: @ amd64pager:
You are aware that this will not make your OS any simpler to develop? Your VM would have to handle memory management, hardware management and abstraction, I/O handling, i.e. all the stuff that a common OS kernel has to do.
What this approach does give you are the advantages of a virtualized environment - but that is an advantage that becomes tangible only after you're done with the VM.
And interrupt handling(you need to use IRQs,right?) is a special exception:the LIDT contains the handlers for inside-VM interrupts,and the GIDT contains handlers for interrupts that happen in the CPU(like int 19).The GIDT works like this:The OSVM kernel gets an interrupt.After it checks the interrupt(whether it is not an OSVM exception) and then calls the function at the address of the GIDT.
And as I said before in this post,it is just a VM.The OSVM-based Kernel Framework Class Library(OSVMBKFCL)implements some of the functions that you put there,but not managers and other stuff.I also have the concept of rings and IOPL in my VM.A thread with a CPL lower than the IOPL can do I\O access directly to the hardware.Solar wrote: Your VM would have to handle memory management, hardware management and abstraction, I/O handling, i.e. all the stuff that a common OS kernel has to do.
It's surprising what the semiconductor industry's definition of macro is and what the CS description is.
Re: Java-like VM for OSes
/me confused... what are you virtualizing then?
Every good solution is obvious once you've found it.
Re: Java-like VM for OSes
Hello, the next step for my OS is to have a VM, I chose NekoVM, it's simple and elegant.
I'm writing transcompilers for python and Standard ML (both are far to be complete by now but you can help): http://github.com/narke.
I'm writing transcompilers for python and Standard ML (both are far to be complete by now but you can help): http://github.com/narke.
OS for PowerPC Macs: https://github.com/narke/Einherjar
Operating system: colorForth computing environment for x86.: https://github.com/narke/Roentgenium
Operating system: colorForth computing environment for x86.: https://github.com/narke/Roentgenium