Java as an alternative language in the wiki

All about the OSDev Wiki. Discussions about the organization and general structure of articles and how to use the wiki. Request changes here if you don't know how to use the wiki.
embryo2
Member
Member
Posts: 397
Joined: Wed Jun 03, 2015 5:03 am

Java as an alternative language in the wiki

Post by embryo2 »

I see there's even no mention of it (except something like "languages like Perl or Java is unlikely to succeed"). I'm ready to add Java related information to some pages, but I'm in doubts if it is really needed.

What do you think?
My previous account (embryo) was accidentally deleted, so I have no chance but to use something new. But may be it was a good lesson about software reliability :)
User avatar
Schol-R-LEA
Member
Member
Posts: 1925
Joined: Fri Oct 27, 2006 9:42 am
Location: Athens, GA, USA

Re: Java as an alternative language in the wiki

Post by Schol-R-LEA »

embryo2 wrote:I see there's even no mention of it (except something like "languages like Perl or Java is unlikely to succeed"). I'm ready to add Java related information to some pages, but I'm in doubts if it is really needed.

What do you think?
Feel free; I'm sure you aren't the only one here who would find it of interest (even if they aren't using Java themselves - there are more than a few people who want to use C#, as well, and similar issues come up with that, too), so it would be worthwhile, sure. A 'bare bones' on the subject would probably be a good starting point, though I would expect (without knowing good deal more about it than I do) that it would require more work than most of the other BB pages.

I would keep in mind that you'll have to either select a specific Java implementation (again, not knowing enough about it, I imagine gjc is probably easiest to work with for this purpose, but you would know better than I would), or else have separate sections (or even separate pages) for different compilers and JVMs. You will also need to go into detail about a number of issues that don't arise with most other languages, such as porting the JVM and the JIT compiler, implementing the garbage collector(s), handling the JNI to call native code, and so on. Being in a similar position myself (except with a language that doesn't even exist yet), I can tell you that there are more than a few issues that you will need to explain that simply don't come up with, for example, Ada. You can anticipate it taking a fairly long time to get it beyond being just a stub.
Last edited by Schol-R-LEA on Fri Nov 13, 2015 2:12 pm, edited 1 time in total.
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
User avatar
BASICFreak
Member
Member
Posts: 284
Joined: Fri Jan 16, 2009 8:34 pm
Location: Louisiana, USA

Re: Java as an alternative language in the wiki

Post by BASICFreak »

Though I would not be interested in using Java, I would enjoy reading how it is done :D.

It's becoming a more popular language - at least compared to when I was first interested in OSDev - so it will be a good addition to our ever expanding WiKi.

If you want to put the time and effort into it, it will be appreciated by anyone interested in using Java to OSDev or just wanting to expand their knowledge.

(Myself, I have been fixing spelling and grammar errors as I find them - hoping to contribute an article by the end of the year...)



Best regards,


B!
BOS Source Thanks to GitHub
BOS Expanded Commentary
Both under active development!
Sortie wrote:
  • Don't play the role of an operating systems developer, be one.
  • Be truly afraid of undefined [behavior].
  • Your operating system should be itself, not fight what it is.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Java as an alternative language in the wiki

Post by Combuster »

The thing with OSDev Java is that it requires a programmer that knows well beyond the bounds of Java to succeed in the real challenges of OS development: these are also the ones that Java actively hides from developers.

If you can formulate something truly Bare Bones, that'd certainly be a nice thing. However if it goes more into the direction of "clone this git repository" or "use this support code", then it's probably ill-advised to present the beast in sheep's clothing to the unprepared newcomer. Then again, we don't have a "Rolling your own Android" article either :wink:
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
SpyderTL
Member
Member
Posts: 1074
Joined: Sun Sep 19, 2010 10:05 pm

Re: Java as an alternative language in the wiki

Post by SpyderTL »

Your approach to writing an OS in Java is pretty specific, so writing documentation about it may give people the wrong impression -- that you can actually write an OS in Java, like you can in C. In reality, you have written a Java-to-x86 byte code assembler, and then written an OS using that.

As long as this is explicitly stated in your wiki page, I think it's fine.

To put it another way, I could add a page to the wiki discussing how to write an OS in XML. But I would need to put a huge disclaimer at the top of the page stating something like:
This article discusses the idea of writing both an XML compiler AND an Operating System using XML documents. Normally, XML cannot be compiled directly into executable code. You will need to write your own compiler, or use a pre-existing one, like the one found at http://ozone.codeplex.com
But I would still be documenting my specific implementation, not necessarily an industry "standard".

You may just want to start out by documenting your tools and your OS design, specifically, and later move some or all of it to a "generic" Java OS article, if it makes sense.

Up to you though...
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
embryo2
Member
Member
Posts: 397
Joined: Wed Jun 03, 2015 5:03 am

Re: Java as an alternative language in the wiki

Post by embryo2 »

Schol-R-LEA wrote:A 'bare bones' on the subject would probably be a good starting point, though I would expect (without knowing good deal more about it than I do) that it would require more work than most of the other BB pages.
...
I would keep in mind that you'll have to either select a specific Java implementation (again, not knowing enough about it, I imagine gjc is probably easiest to work with for this purpose, but you would know better than I would), or else have separate sections (or even separate pages) for different compilers and JVMs. You will also need to go into detail about a number of issues that don't arise with most other languages, such as porting the JVM and the JIT compiler, implementing the garbage collector(s), handling the JNI to call native code, and so on. Being in a similar position myself (except with a language that doesn't even exist yet), I can tell you that there are more than a few issues that you will need to explain that simply don't come up with, for example, Ada. You can anticipate it taking a fairly long time to get it beyond being just a stub.
Nice introduction. In case of the implementation in fact it's simpler (Java is standardized much more than C), but I'll try to write about it in the wiki.
BASICFreak wrote:Though I would not be interested in using Java, I would enjoy reading how it is done :D.
Ok, I'll try to show it from the perspective of C developers.
Combuster wrote:If you can formulate something truly Bare Bones, that'd certainly be a nice thing. However if it goes more into the direction of "clone this git repository" or "use this support code", then it's probably ill-advised to present the beast in sheep's clothing to the unprepared newcomer.
Do you think I'll start to advertise my OS? It's not the case. But it is much easier to get examples from my work.
My previous account (embryo) was accidentally deleted, so I have no chance but to use something new. But may be it was a good lesson about software reliability :)
embryo2
Member
Member
Posts: 397
Joined: Wed Jun 03, 2015 5:03 am

Re: Java as an alternative language in the wiki

Post by embryo2 »

Combuster wrote:The thing with OSDev Java is that it requires a programmer that knows well beyond the bounds of Java to succeed in the real challenges of OS development: these are also the ones that Java actively hides from developers.
Low level knowledge is what the osdev.org provides, so I'm not afraid of people who get here and knows nothing about the challenges.

And hiding the low level details is important only for beginners. As time passes a developer starts to understand importance of optimization. But actually there should be some limit to such efforts because it can take a lot of time. Java let's you to stop earlier. But if a developer wants to advance his skills then the low level becomes interesting.
My previous account (embryo) was accidentally deleted, so I have no chance but to use something new. But may be it was a good lesson about software reliability :)
embryo2
Member
Member
Posts: 397
Joined: Wed Jun 03, 2015 5:03 am

Re: Java as an alternative language in the wiki

Post by embryo2 »

SpyderTL wrote:Your approach to writing an OS in Java is pretty specific, so writing documentation about it may give people the wrong impression -- that you can actually write an OS in Java, like you can in C. In reality, you have written a Java-to-x86 byte code assembler, and then written an OS using that.
We can discuss the approaches to write an OS not in C or assembly. May be it worth to start a separate thread?
SpyderTL wrote:To put it another way, I could add a page to the wiki discussing how to write an OS in XML. But I would need to put a huge disclaimer at the top of the page stating something like:
This article discusses the idea of writing both an XML compiler AND an Operating System using XML documents. Normally, XML cannot be compiled directly into executable code. You will need to write your own compiler, or use a pre-existing one, like the one found at http://ozone.codeplex.com
That's why it is interesting to write about a general approach of writing OS in not very common (for it) language. And existing OSes can show examples for interested developers.
SpyderTL wrote:You may just want to start out by documenting your tools and your OS design, specifically, and later move some or all of it to a "generic" Java OS article, if it makes sense.
At least there should be some root in the tree of languages and their features. It can be the generic discussion about different languages for OSdeving, supplemented by wiki fragments as a result.
My previous account (embryo) was accidentally deleted, so I have no chance but to use something new. But may be it was a good lesson about software reliability :)
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Java as an alternative language in the wiki

Post by Combuster »

embryo2 wrote:Do you think I'll start to advertise my OS? It's not the case.
You already did. :^o
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
embryo2
Member
Member
Posts: 397
Joined: Wed Jun 03, 2015 5:03 am

Re: Java as an alternative language in the wiki

Post by embryo2 »

Combuster wrote:
embryo2 wrote:Do you think I'll start to advertise my OS? It's not the case.
You already did. :^o
I see it as easiest way. But may be you can propose something easier? 8)
My previous account (embryo) was accidentally deleted, so I have no chance but to use something new. But may be it was a good lesson about software reliability :)
User avatar
Schol-R-LEA
Member
Member
Posts: 1925
Joined: Fri Oct 27, 2006 9:42 am
Location: Athens, GA, USA

Re: Java as an alternative language in the wiki

Post by Schol-R-LEA »

embryo2 wrote:
Combuster wrote:
embryo2 wrote:Do you think I'll start to advertise my OS? It's not the case.
You already did. :^o
I see it as easiest way. But may be you can propose something easier? 8)
'Easy' is going to vary from dev to dev. In any case, the point isn't that you might engage in SSP, but that you would be channeling the readers into a specific solution rather than giving them options. Admittedly, the entire site is guilty of that, given the heavy reliance on C and the GNU toolchain, but there has been a conscious effort to limit that and provide some guidance for that who stray from The Golden Path of Unix RighteousnessTM.
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
embryo2
Member
Member
Posts: 397
Joined: Wed Jun 03, 2015 5:03 am

Re: Java as an alternative language in the wiki

Post by embryo2 »

Have just finished Java Bare Bones. Please, take a look if interested. Also mistake correction (or pointing at) would be appreciated.

Some changes also have been made in the Languages, and Introduction sections.
My previous account (embryo) was accidentally deleted, so I have no chance but to use something new. But may be it was a good lesson about software reliability :)
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Java as an alternative language in the wiki

Post by Brendan »

Hi,
embryo2 wrote:Have just finished Java Bare Bones. Please, take a look if interested. Also mistake correction (or pointing at) would be appreciated.

Some changes also have been made in the Languages, and Introduction sections.
For a start, you probably should change the page's title to something more like "Writing an Assembler in Java (and using it to generate a boot loader written in your new dialect of assembly)"... ;)


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
embryo2
Member
Member
Posts: 397
Joined: Wed Jun 03, 2015 5:03 am

Re: Java as an alternative language in the wiki

Post by embryo2 »

Brendan wrote:For a start, you probably should change the page's title to something more like "Writing an Assembler in Java (and using it to generate a boot loader written in your new dialect of assembly)"... ;)
It's a way of using Java for OSdeving. The way C is used is as such:
  1. Somebody writes assembly translator
  2. Somebody writes assembly program, which is used as a C translator
  3. Somebody writes C program
  4. C translator is executed
  5. C program (in it's the very new form) is executed
In case of Java only the steps of writing Java were omitted.
My previous account (embryo) was accidentally deleted, so I have no chance but to use something new. But may be it was a good lesson about software reliability :)
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Java as an alternative language in the wiki

Post by Brendan »

Hi,
embryo2 wrote:
Brendan wrote:For a start, you probably should change the page's title to something more like "Writing an Assembler in Java (and using it to generate a boot loader written in your new dialect of assembly)"... ;)
It's a way of using Java for OSdeving. The way C is used is as such:
  1. Somebody writes assembly translator
  2. Somebody writes assembly program, which is used as a C translator
  3. Somebody writes C program
  4. C translator is executed
  5. C program (in it's the very new form) is executed
You're conflating "writing a C compiler" with "using a C compiler". The normal way people use C is:
  1. Somebody writes C source code
  2. C translator is executed
  3. C program (in it's the very new form) is executed
It's entirely possible to use C differently. For example, you could write an assembler in C that uses "assembly source code" embedded directly in the assembler's own C (e.g. as data and/or macros and/or functions, not as inline assembly); so that when you execute the compiled C program it assembles the assembly source code that was embedded into it. Of course nobody does this in C because it's hideous (much better to get the assembly source code from separate file/s instead of building it directly into the assembler); but if someone did do this then the boot loader would be written in (an awkward/ugly dialect of) assembly and the boot loader wouldn't be written in C at all.

In the same way; you could write an assembler in Java that gets the assembly source code from separate file/s (and then write a boot loader in assembly); or you could write an assembler in Java where the assembly source code is embedded directly into the assembler itself (and then write a boot loader in assembly).

Basically; you're writing an assembler, and then writing a boot loader in assembly. You're not writing a boot loader in Java.


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Post Reply