Page 1 of 2
Java
Posted: Thu Aug 28, 2003 3:17 pm
by Adek336
ok, you see my point: if there was a java port for the system, ah, how cool features it would have! ;D do you think it would be possible for an advanced programmer (buuu, I wish I was one) to port a java system onto an osdev project? Somebody ported to OS/2 lately.
Re:Java
Posted: Thu Aug 28, 2003 4:39 pm
by nullify
I'm not exactly sure what you mean by "port" in this case: running Java code on top of your operating system, or developing the system itself in Java. In the former case, yes it is possible, provided you implement the underlying features necessary to support the JRE, etc. If you plan to develop the system in Java, you may have to overcome some obstacles (for example, how are you going to deal with garbage collection) before you can use it for osdev (that's if its possible to do osdev in Java).
Re:Java
Posted: Fri Aug 29, 2003 12:53 am
by Pype.Clicker
well, basically what you'll have to do is find some open-source JVM ...
Re:Java
Posted: Fri Aug 29, 2003 1:19 am
by Solar
Pype.Clicker wrote:
well, basically what you'll have to do is find some open-source JVM ...
...and provide the runtime it expects...
Re:Java
Posted: Fri Aug 29, 2003 4:43 am
by Adek336
It would be interesting though to have a java vm for my os, I could run external applets.
As to osdev in Java - I think there was once... JOS (or JavaOS) but I'm not sure.
Cheers,
Adrian
Re:Java
Posted: Fri Aug 29, 2003 5:43 am
by Ozguxxx
I think high java people at sun could not manage writing os in java although they once tried to. How pathetic... ;D
Re:Java
Posted: Fri Aug 29, 2003 5:50 am
by Pype.Clicker
java being running in a virtual machine, that makes it a poor candidate for managing the *real* machine ..
Re:Java
Posted: Fri Aug 29, 2003 11:40 am
by Schol-R-LEA
Well, there are three approaches you can take, each of which require considerable commitment of code before any Java code can run.
The classic approach, used by OSes like UCSD Pascal and Smalltalk-80, is to implement the interpreter and low-level routines - the kernel, for all intents and purposes - in assembly or some other low-level language, and then write the high-level code in the interepted language.
The next approach is to write a native-code compiler that can produce standalone code. This would essentially require you to write a whole runtime environment - thread scheduling, garbage collection, security checking - as a set of libraries. Like with the previous alternative, this essentially means that the kernel is in the low-level language.
Most systems that use the first approach combine it to some degree with the second, for efficiency's sake, and that is probably how I would implement ENOS if I got around to doing so.
The third approach is to use a proper subset of the language, minus the more advanced facilities (i.e., garbage collection, threads) to implement the lowest-level parts of the kernel, and then finish the OS with the ful implementation. This is the approach used by Squeak, which is implemented in a compiled subset of Smalltalk called Slang; the current implementation of Slang compiles into C code for the sake of portability, but there's no reason it couldn't produce native object code. It is also one of the approaches I am considering using in desigining Thelema (in keeping with the joke, I suppose I could call the languages Malkuth and Kether
). However, a low-level version of Java would closely resemble C, so much so that it would probably be easier just to use C and be done with it.
Re:Java
Posted: Fri Aug 29, 2003 11:52 am
by Schol-R-LEA
Ozgunh82 - The Ozguxxx- wrote:
I think high java people at sun could not manage writing os in java although they once tried to. How pathetic... ;D
AFAIK, JavaOS was in fact released, and quite early on at that; it's just that there wasn't as much demand for a portable embedded-system real-time kernel as Sun anticipated, and the performance was too weak to be really competitive. To the best of my knowledge, the idea of 'portable' embedded systems software like JavaOS or Inferno still hasn't taken off; in fact, I gather that many embedded designers have been dropping C in favor of assembly, and sticking to older, familiar processor lines that are easy to code for. This could be a misunderstanding on my part, however.
JOS is a different matter; that was an independent project to write a general-purpose OS using Java. I took a look at it early on; my impression was that they would never get themselves organized enough to do it, and they didn't.
Re:Java
Posted: Sat Aug 30, 2003 7:40 am
by Adek336
If anybody's interested, there is a Java-like VM at
http://www.wabasoft.com/. It is said to be very portable (there is even a port to the gameboy), would-be intereseting to see it working.
Re:Java
Posted: Wed Mar 22, 2006 7:13 pm
by Candamir
Can't gcc compile java to asm?
PS: I haven't ever done this, but I'm a really great Java fan, so I think it would be possible with a large amount of set-up-the-stage work, but then it would be quite cool.
PS: Aren't there Java processors?
PS: Another option would be to provide a JVM and a JRE at the very lowest level of the OS, so that the user can transparently invoke both native and interpreted code (this would also work for other interpreted languages, although I'm not that keen on them)
Re:Java
Posted: Thu Mar 23, 2006 10:35 am
by bubach
I think that my signature speaks for itself.. ;D
Re:Java
Posted: Thu Mar 23, 2006 4:07 pm
by Schol-R-LEA
"Object-oriented programming is an exceptionally bad idea which could only have originated in California", Edsger W. Dijkstra (1930 - 2002)
I always find it amusing when someone who hasn't the slightest idea of who Dijkstra was, and what he stood for, repeats this quote for all the wrong reasons.
By Dijkstra's view of things, not only would few if any of us on this message board be qualified to call ourselves programmers, few of us would be even qualified to study to
become programmers. He thought that only degreed mathematicians should be allowed to write programs. His main focus was on formal proof: he argued that one shouldn't write a single line of code until after you've demonstrated that the algorithms and design in question were formally correct, and that formal techniques for program proof should be taught before the actual programming languages themselves. Most of his programs were worked out in a personal mathematical notation first, and then rewritten in code: Algol-60 or Pascal early on, then later a variety of functional languages (by his own assertion, he was slow in embracing FP, mainly because he was displeased with Backus' Turing Award lecture and because he disliked Lisp's syntax and weak typing, but IIUC he was coding almost exclusively in functional languages by the mid-1990s).
To the end of his life (or so I understand), he was adamantly opposed to personal computers, internetworking, e-mail, word processing, GUIs (indeed, graphics of any kind, including mathematical projections) or general-purpose user interfaces of any other kind for that matter (he once wrote,
"I cannot even regard [user design] as a subfield of computer science"), and computer gaming; he felt that computing was properly used only for mathematics and science, not for business, personal use or entertainment. He avoided many of thsoe things when he could: it is my understanding that even into the 1990s, he wrote out all of his papers by hand, then typed them on a typewriter, refusing to use computerized typesetting. This wasn't Luddism; quite the contrary, he felt it was a waste of computing resources better applied to 'legitimate' (i.e., mathematical) computations.
This isn't a knock against him (or agains tyou for quoting him, Bubach); he was genuinely brilliant, and contributed greatly to the field. I just wonder how many people who quote him really know why he said what he did.
Comments and criticisms welcome; if I have misunderstood or misrepresented anything here, please correct me on it.
Re:Java
Posted: Fri Mar 24, 2006 2:13 am
by bubach
Well, i don't really care about his other opinions, i just like that quote.
Re:Java
Posted: Fri Mar 24, 2006 3:23 am
by Solar
Schol-R-LEA wrote:
This isn't a knock against him (or agains tyou for quoting him, Bubach); he was genuinely brilliant, and contributed greatly to the field. I just wonder how many people who quote him really know why he said what he did.
Alas, the fate of many famous quotes. Like Donald Knuth being quoted with: "Premature optimization is the root of all evil"... (he meant
premature optimization, not optimization in general or the effort to devise efficient algorithms...)