100% Java OS
Posted: Sat Mar 01, 2014 4:00 pm
Here www.jembryos.org is new OS description. If somebody is interested in architectural features or it's business applications we can discuss it here.
Sorry for my english, but what the 'legit' means ? Why it should be illegal ?VolTeK wrote:Ill be honest, i wasn't expecting this to be legit
The opposite of "illegal" is "legal", which has to do with laws and rules. Also, there's never a space in front of periods, commas, question marks and exclamations - that reads like you've had cheap Asian schooling. Enabling and listening to your browser spell checker also helps a lotSorry for my english
It is not the case for my system.Combuster wrote:most people claiming to have a Java OS actually have a C(++) kernel running a JVM
Ok, I'll pay respect to your explanation.Combuster wrote:there's never a space in front of periods, commas, question marks and exclamations
Yes, there is a one to one translation of bytecodes into the machine representation. The translation takes compiled Java class (bytecodes and class definition) and generates machine code.Bender wrote:I am curious to know about how did you manage to use Java as a programming language for such low level tasks. Did you write a bytecode translator that translates Java Bytecode to x86?
It's a good ideaAntti wrote:I will check your project because it seems that there might be something interesting.
ThanksAntti wrote:At least I wish you good luck.
Of course. And there already are drivers, but not so much - just the ps2 keyboard and text screen.Pancakes wrote:It should be absolutely possible to write the drivers in Java too
The I/O space access is actually done as a set of special methods.Pancakes wrote:You might even use some tricks like special objects where the method calls directly translate into direct memory writes, I/O port read/writes, and such.
Currently only x86 instructions are supported. To support ARM or another processor there should be some means to translate bytecodes into ARM machine code representation. Now it is relatively straightforward to write such representation by a way of simple copying of the existing solution for x86.Pancakes wrote:You know there is a difference between different achitectures like X86 and ARM so you just have to have specific methods for those to handle those cases.
It is still Java, not assembly. But the part, responsible for machine code generation, looks like assembly when actually it is a Java code. And the look and feel can be changed if there will be a need for it, but an assembly look and feel seems more convenient.Pancakes wrote:Some of your kernel would have to be in assembly though like you said
There is such project in the downloadable part of the jEmbryoS. Of course, it is possible to copy classes from the bin directory into a jar and to use it separately. But the project is better than the jar only, that's why there is a project.Pancakes wrote:Have to create a JAR with them just for people who write using an IDE so auto-complete will work but that is it.
The translator is already there. There are two levels of it - the Java Assembler and one to one bytecode translators. The second is implemented with the help of the first.Pancakes wrote:I am curious are you going to write the java compiler/translator in assembly?
I have looked at it quickly, but it is in C. My experience with the C environment is almost non existent and I have no tools for C code to be compiled or browsed with some help (like Java IDEs can do).Pancakes wrote:I have written a fairly large Java interpreter, http://code.google.com/p/rhino-java-virtual-machine/
In fact it is more simple to write a translator than a complete interpreter. The translator just produces some bytes while the interpreter also runs the bytes (from bytecode). Just writing to the disk is a simple task, but to run something on the processor is a more complex task because of the running system should produce something useful while the translated code is just a bunch of bytes and the usefulness of it is achieved by another system.Pancakes wrote:I went along so writing something to translate into machine code would really add another layer of complexity and challenge
Code: Select all
public class Translator extends EmbryoConstants implements CompilerConstants
That directory contains 144 files for every single byte code instruction, and on top of that all of those all contain static methods!./jEmbryoCompiler/src/org/jembryos/compiler/x86/translators
Code: Select all
write_arrayNullPointerAndIndexCheck_dataAddressEDX_arrayIndexEBX
For all your isWhateverOn() methods, you can replace that ALL with a simple Enum and use an EnumSet.jEmbryoService/src/org/jembryos/service/driver/Ps2KeyboardDriver.java
Your assembler is overly complex and splayed into 89 class files mostly consisting of individual instructions in their own class files.jEmbryoAssembler/src/org/jembryos/assembler/
Too many directories, especially since they all contain /src/org/jembryos in them anyway. If you read the javac manpage along with the java manpage, you would see there is such as an option such as -bootclasspath?jEmbryoApp jEmbryoClassFile jEmbryoCore jEmbryoFAT jEmbryoS
jEmbryoAssembler jEmbryoClassModel jEmbryoDebug jEmbryoHelperAPI jEmbryoService
jEmbryoBootstrap jEmbryoCompiler jEmbryoDocs jEmbryoJavaAPI jEmbryoTest
It appears that you fail to mention that you even include these, one has to look at the source code to determine this. You must also specify the licenses of those projects and make sure that they are compatible with your own.JNode, SUN Classpath, GNU Classpath.
Wow! That was a bit harsh especially for someone who hasn't offered up any of his own code to be placed under scrutiny. I'm going to have a guess that you're not so perfect yourself.GhostlyDeath wrote: In short: It seems clear that you lack programming experience, you really need to reconsider these basic points. Your code is complete garbage. The code is an unmaintainable mess.
Yes, there is the unnoticed license incompatibility issue. But actually the problem is related to the Sun's (now Oracle's) code. The GNU Classpath allows to use later versions of GPL. However the issue should be resolved and your notice is useful. Thanks for the point.GhostlyDeath wrote:Your OS has licensing issues:
You must either:
- Your OS is GPLv3+
- GNU Classpath is GPLv2+
- Oracle's Classpath is GPLv2
- Upgrade GNU Classpath to GPLv3+ and drop Oracle's Classpath.
- Downgrade your GPLv3+ to GPLv2+
The comments are in the source code. If you have not noticed them it only means that not every source file has comments. The commenting process is ongoing and the situation should be improved some day.GhostlyDeath wrote:Where are all the comments?
There's no JavaDocs generated yet because of incomplete source code commenting.GhostlyDeath wrote:JavaDoc elements are also extremely helpful in knowing what classes, methods, fields, and annotations do.
Do you want OOP purity or working system? If you still do not know the pattern of extending an interface with constants for using them without full interface name inserted then it is better to pay attention to such pattern advantages.GhostlyDeath wrote:That class virtually only contains static methods! Where did the OOP go?
And what's the problem? If it is only about your aesthetic feelings then may be it is not the best place to write about your irritation?GhostlyDeath wrote:That directory contains 144 files for every single byte code instruction, and on top of that all of those all contain static methods!
Yes, the name is long, but it is descriptive. If you can use any IDE that is a bit better than a text editor then just press point button after class name and select method name from the list - in such a way you can save efforts for typing method name.GhostlyDeath wrote:That is a very nice and far TOO descriptive name of a method and consists of far too many characters.Code: Select all
write_arrayNullPointerAndIndexCheck_dataAddressEDX_arrayIndexEBX
There are many variants we can do some things. And your personal choice is not the best. And insisting on it is something not very nice.GhostlyDeath wrote:For all your isWhateverOn() methods, you can replace that ALL with a simple Enum and use an EnumSet.
As described in the "so long" documentation the goal was to emulate assembler in Java. If you consider this goal then you should understand that your solution is just not working.GhostlyDeath wrote:In reality, your byte code recompiler should take logic in and output logic, it appears that you may eventually plan to add support for other architectures. Rather than implement every bit of an assembler, it would be much simpler to output instructions using abstract logic. If not, at least use some kind of table rather than 10,000 methods for every single variant of every single instruction.
It's just modularity. You can read about the profit it can bring to you.GhostlyDeath wrote:Too many directories, especially since they all contain /src/org/jembryos in them anyway.
It seems you are trying to compile the project under Linux using text interface only. It is interesting idea, but the modern IDE is much better way to write big programs. Of course, your habit is always for your service, but please consider to try any free IDE and there will be no problems with options and long method names.GhostlyDeath wrote:If you read the javac manpage along with the java manpage, you would see there is such as an option such as -bootclasspath?
The inclusion is described in the documentation.GhostlyDeath wrote:It appears that you fail to mention that you even include these, one has to look at the source code to determine this.JNode, SUN Classpath, GNU Classpath.
It seems nobody in the world can tell the difference between a person's code and the code you can think is not written by the person. So you can claim your right on every open source project, because all the files there are at least a bit different. It's a very nice claim!GhostlyDeath wrote:Seeing that none of your code is commented in any fashion, and bumping into code that actually is commented such as in jEmbryoAssembler/src/org/jembryos/assembler/x86/AssemblerProgram.java, puts serious doubt on whether or not you've written said code.
At least some useful points about licensing is appreciated, but everything else is just your irritation, I suppose.GhostlyDeath wrote:In short: It seems clear that you lack programming experience, you really need to reconsider these basic points. Your code is complete garbage. The code is an unmaintainable mess.
Please, let the business decide what is risky and what is not.GhostlyDeath wrote:You want businesses to use your operating system, but your mess has one problem. The only person who could ever work on your OS reliably is yourself and if you die or lose interest then the OS is dead and unsupportable. That is too risky for a business.
Good, readable and reasonable code is a very fuzzy definition. But you always can insist on it in order to throw your irritation on somebody else, it even works sometime.GhostlyDeath wrote:If you spent your time actually writing good, readable and reasonable code instead of writing over readable design documents and forum comments, your OS would fare much better.
It is very important to comment your code as you write it, at least a description of what each method does, what the purpose of a class is, why a field exists.embryo wrote: The comments are in the source code. If you have not noticed them it only means that not every source file has comments. The commenting process is ongoing and the situation should be improved some day.
There's no JavaDocs generated yet because of incomplete source code commenting
The reason I raised such point is the extreme lack of comments everywhere, then all the sudden comments. After glancing over the source files you eventually see that there are virtually no comments, then once some commented things start to appear out of nowhere, there is a stylistic clash.embryo wrote: It seems nobody in the world can tell the difference between a person's code and the code you can think is not written by the person. So you can claim your right on every open source project, because all the files there are at least a bit different. It's a very nice claim!
Java has the notion of packages, similar to namespaces in C++. Rather than having a directory tree of:embryo wrote: It's just modularity. You can read about the profit it can bring to you.
Code: Select all
foo/bar/assembler
foo/bar/compiler
foo/bar/bootloader
Code: Select all
FooBarAssembler/src/foo/bar/assembler
FooBarCompiler/src/foo/bar/compiler
FooBarBootLoader/src/foo/bar/bootloader
Using an IDE, long names do not seem to be that of a problem. But with extremely long names, it takes up more space on the screen, in memory, and on the disk. Also as per memory, Java uses UTF-16 strings so "write_arrayNullPointerAndIndexCheck_dataAddressEDX_arrayIndexEBX" which is 65 characters will end up taking up 130 bytes instead. Any meaningful stack traces on say an 80x25 terminal will be word wrapped. It may be better to just use annotations or JavaDoc to convey the information rather than putting it in the name itself. And I am pretty sure Eclipse understands JavaDoc and will show what it says when you start typing a method or a field.embryo wrote: Yes, the name is long, but it is descriptive. If you can use any IDE that is a bit better than a text editor then just press point button after class name and select method name from the list - in such a way you can save efforts for typing method name.
Personally, I would just replace the "ldc #?; ldc #?; invokestatic (Ljava/lang/String;Ljava/lang/String;)V foo/bar/Assembly.asm" with inline assembly (provided the target is the kernel and not a program the user would run otherwise that would be a major security flaw).embryo wrote: As described in the "so long" documentation the goal was to emulate assembler in Java. If you consider this goal then you should understand that your solution is just not working.
Code: Select all
package foo.bar;
/**
* This is a special class which contains a static method for encoding assembly
* instructions for use in the recompiler pass.
*/
public final class Assembly
{
/**
* Encodes an assembly instruction from the specified string.
*
* @param is The target instruction set to use for the statement.
* @param whatever Whatever assembly statement you want to encode.
* @see InstructionSet
*/
@AOTSpecialMethod
public static void asm(String is, String whatever)
{
throw new Error("This is an AOT special method, it cannot be invoked.");
}
}
Fair enough.embryo wrote: Please, let the business decide what is risky and what is not.