OSDev.org

The Place to Start for Operating System Developers
It is currently Wed Jul 26, 2017 6:39 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 29 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Java as an alternative language in the wiki
PostPosted: Fri Nov 13, 2015 8:56 am 
Offline
Member
Member

Joined: Wed Jun 03, 2015 5:03 am
Posts: 397
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 :)


Top
 Profile  
 
 Post subject: Re: Java as an alternative language in the wiki
PostPosted: Fri Nov 13, 2015 12:23 pm 
Offline
Member
Member
User avatar

Joined: Fri Oct 27, 2006 9:42 am
Posts: 886
Location: Athens, GA, USA
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.

_________________
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
μή εἶναι βασιλικήν ἀτραπόν ἐπί γεωμετρίαν
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.


Last edited by Schol-R-LEA on Fri Nov 13, 2015 2:12 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Java as an alternative language in the wiki
PostPosted: Fri Nov 13, 2015 1:39 pm 
Offline
Member
Member
User avatar

Joined: Fri Jan 16, 2009 8:34 pm
Posts: 284
Location: Louisiana, USA
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.


Top
 Profile  
 
 Post subject: Re: Java as an alternative language in the wiki
PostPosted: Fri Nov 13, 2015 2:06 pm 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 3:45 am
Posts: 9228
Location: An der schönen blauen Donau, watching muppets
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 ]


Top
 Profile  
 
 Post subject: Re: Java as an alternative language in the wiki
PostPosted: Fri Nov 13, 2015 4:47 pm 
Offline
Member
Member
User avatar

Joined: Sun Sep 19, 2010 10:05 pm
Posts: 1008
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:
Quote:
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: Software 3D Pixel Shader

"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott


Top
 Profile  
 
 Post subject: Re: Java as an alternative language in the wiki
PostPosted: Sat Nov 14, 2015 2:34 pm 
Offline
Member
Member

Joined: Wed Jun 03, 2015 5:03 am
Posts: 397
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 :)


Top
 Profile  
 
 Post subject: Re: Java as an alternative language in the wiki
PostPosted: Sat Nov 14, 2015 2:43 pm 
Offline
Member
Member

Joined: Wed Jun 03, 2015 5:03 am
Posts: 397
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 :)


Top
 Profile  
 
 Post subject: Re: Java as an alternative language in the wiki
PostPosted: Sat Nov 14, 2015 2:51 pm 
Offline
Member
Member

Joined: Wed Jun 03, 2015 5:03 am
Posts: 397
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:
Quote:
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 :)


Top
 Profile  
 
 Post subject: Re: Java as an alternative language in the wiki
PostPosted: Sun Nov 15, 2015 4:50 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 3:45 am
Posts: 9228
Location: An der schönen blauen Donau, watching muppets
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 ]


Top
 Profile  
 
 Post subject: Re: Java as an alternative language in the wiki
PostPosted: Sun Nov 15, 2015 6:50 am 
Offline
Member
Member

Joined: Wed Jun 03, 2015 5:03 am
Posts: 397
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 :)


Top
 Profile  
 
 Post subject: Re: Java as an alternative language in the wiki
PostPosted: Sun Nov 15, 2015 9:33 am 
Offline
Member
Member
User avatar

Joined: Fri Oct 27, 2006 9:42 am
Posts: 886
Location: Athens, GA, USA
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
μή εἶναι βασιλικήν ἀτραπόν ἐπί γεωμετρίαν
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.


Top
 Profile  
 
 Post subject: Re: Java as an alternative language in the wiki
PostPosted: Sun Nov 15, 2015 11:21 am 
Offline
Member
Member

Joined: Wed Jun 03, 2015 5:03 am
Posts: 397
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 :)


Top
 Profile  
 
 Post subject: Re: Java as an alternative language in the wiki
PostPosted: Sun Nov 15, 2015 2:56 pm 
Offline
Member
Member
User avatar

Joined: Sat Jan 15, 2005 12:00 am
Posts: 8020
Location: At his keyboard!
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.


Top
 Profile  
 
 Post subject: Re: Java as an alternative language in the wiki
PostPosted: Mon Nov 16, 2015 9:29 am 
Offline
Member
Member

Joined: Wed Jun 03, 2015 5:03 am
Posts: 397
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 :)


Top
 Profile  
 
 Post subject: Re: Java as an alternative language in the wiki
PostPosted: Mon Nov 16, 2015 2:12 pm 
Offline
Member
Member
User avatar

Joined: Sat Jan 15, 2005 12:00 am
Posts: 8020
Location: At his keyboard!
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 29 posts ]  Go to page 1, 2  Next

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group