Ruby OS

S

Sparky Mat

I was considering porting the Ruby 1.9 VM to bare metal (something
similar to Cleese - http://code.google.com/p/cleese/). I was wondering
if someone is already working on this. The end goal is to have a Ruby
OS, with everything running on the VM. I have yet to analyze the
complete changes needed.

My original idea was for such a (Ruby) OS to be coupled with a versioned
file-system to have a completely rollback-able OS where the whole
userland and parts of the system land are in pure Ruby, with patches
being .diff files :) .

I have a discussion running on the OSDev forums regarding this (Link:
http://forum.osdev.org/viewtopic.php?f=15&t=20220)

So is there such a project already?

TLDR: Is someone working on porting the Ruby 1.9.x VM to bare metal?
 
S

SASADA Koichi

Hi,

I know one laboratory trying to such a kernel (where I had been when I'm
a student).

# And this lab made a Perl OS, last year.

Sparky Mat wrote::
 
J

Jörg W Mittag

Sparky said:
I was considering porting the Ruby 1.9 VM to bare metal (something
similar to Cleese - http://code.google.com/p/cleese/). I was wondering
if someone is already working on this.

I don't know for YARV, but I know that there was a thread on the
Rubinius mailing list, where one guy was working on porting Rubinius
running on a microcontroller. It doesn't look like it's gone anywhere,
though, but you could definitely contact him.

Here's the thread:

<https://Groups.Google.Com/group/rubinius-dev/browse_thread/thread/2e19e0ac73362f75/>

jwm
 
E

Eleanor McHugh

I was considering porting the Ruby 1.9 VM to bare metal (something
similar to Cleese - http://code.google.com/p/cleese/). I was wondering
if someone is already working on this. The end goal is to have a Ruby
OS, with everything running on the VM. I have yet to analyze the
complete changes needed.

My colleague and I have been toying with a similar idea for a couple
of years now, but we're more interested in a register-based VM than
YARV and haven't managed to settle on one yet (if only Google would
open-source Dalvik...).

We've also done some proof-of-concept work to see if writing a Unix
userland in pure Ruby is possible and I'm hoping the two ideas will
merge into something useful at some point.

From a maintenance perspective Ruby would make for a pretty sweet
systems programming language and assuming a build which supports ruby/
dl or ffi then all the functionality of C is there - or with Wilson
even assembler.
My original idea was for such a (Ruby) OS to be coupled with a
versioned
file-system to have a completely rollback-able OS where the whole
userland and parts of the system land are in pure Ruby, with patches
being .diff files :) .

The idea of a transactional file system does sound rather interesting
- especially if it were backed by transactional memory.


Ellie

Eleanor McHugh
Games With Brains
http://slides.games-with-brains.net
 
K

Kyle Schmitt

I was considering porting the Ruby 1.9 VM to bare metal (something
similar to Cleese - http://code.google.com/p/cleese/). I was wondering
if someone is already working on this. The end goal is to have a Ruby
OS, with everything running on the VM. I have yet to analyze the
complete changes needed.


Umm, have you thought perhaps of using an existing kernel and just
having one binary, that being ruby? You could then build your whole
userspace on top of that.

I've toyed with the idea, but never had the time to really do it.

It's easy, take a linux, BSD (or any other "Real OS"=E2=84=A2), and add an
entry into the bootloader, telling it that the init program is
whatever binary or executable script you wish. You could add entries
for irb, a commodore 64 basic interpreter, and an apple-basic
interpreter in less than 5 minutes.

I know just booting into irb or commodore basic may count as an OS
from the 8-bit days, but it really doesn't cut it now days :) So
after proving it works to yourself, try writing your own init as a
ruby 1.9 script.

my 2=C2=A2

--Kyle
 
D

Dylan Evans

Umm, have you thought perhaps of using an existing kernel and just
having one binary, that being ruby? You could then build your whole
userspace on top of that.


A peek inside the mind of a genius. Why not use existing code and increase
your chances of success? You will have to use binary at some level, and if
you did want to use ruby to write kernel modules you could perhaps build
on a microkernel (maybe minix) where the system is made up of daemons
running in user space.

Actually a simple way to prototype the system would be to run it in ms-dos
which is as near to no operating system as you can get anyway.

I've toyed with the idea, but never had the time to really do it.

It's easy, take a linux, BSD (or any other "Real OS"=99), and add an
entry into the bootloader, telling it that the init program is
whatever binary or executable script you wish. You could add entries
for irb, a commodore 64 basic interpreter, and an apple-basic
interpreter in less than 5 minutes.

I know just booting into irb or commodore basic may count as an OS
from the 8-bit days, but it really doesn't cut it now days :) So
after proving it works to yourself, try writing your own init as a
ruby 1.9 script.

my 2=A2

--Kyle


--=20
"The UNIX system has a command, nice ... in order to be nice to the other
users. Nobody ever uses it." - Andrew S. Tanenbaum
 
E

Eleanor McHugh

A peek inside the mind of a genius. Why not use existing code and
increase
your chances of success? You will have to use binary at some level,
and if
you did want to use ruby to write kernel modules you could perhaps
build
on a microkernel (maybe minix) where the system is made up of daemons
running in user space.

Minix has a few shortcomings, but in general this approach is doable.
A better choice of kernel though would probably be NetBSD thanks to
the large number of hardware platforms that it supports.
Actually a simple way to prototype the system would be to run it in
ms-dos
which is as near to no operating system as you can get anyway.

You can already run Ruby on top of MS-DOS so in a sense the experiment
has been done.


Ellie

Eleanor McHugh
Games With Brains
http://slides.games-with-brains.net
 
D

Dylan Evans

[Note: parts of this message were removed to make it a legal post.]

On Fri, Jun 5, 2009 at 1:58 AM, Eleanor McHugh <
On 4 Jun 2009, at 14:49, Dylan Evans wrote:


Actually a simple way to prototype the system would be to run it in ms-dos

You can already run Ruby on top of MS-DOS so in a sense the experiment has
been done.

Yes, but just the interpreter, from there you could set up a multi tasking
environment, somewhat like how win 9x worked, and because ms-dos is fairly
trivial it wouldn't be a huge leap to writing device drivers in ruby.
 
E

Eleanor McHugh

On Fri, Jun 5, 2009 at 1:58 AM, Eleanor McHugh <


Yes, but just the interpreter, from there you could set up a multi
tasking
environment, somewhat like how win 9x worked, and because ms-dos is
fairly
trivial it wouldn't be a huge leap to writing device drivers in ruby.

I'm not sure it would even be that difficult - at least in principle -
to write device drivers for unix in Ruby as ruby/dl gives you memory
buffers and callbacks. However my DD experience is on other operating
systems that get in your way less (like OS/9) so there are probably
kernel interface complexities that I'm overlooking. Might be a fun
experiment to look into though if I can find the time.


Ellie

Eleanor McHugh
Games With Brains
http://slides.games-with-brains.net
 
S

Sparky Mat

Kyle said:
Umm, have you thought perhaps of using an existing kernel and just
having one binary, that being ruby? You could then build your whole
userspace on top of that.

I suspect that this would be the most practical approach, and probably,
after failing the bare-metal thing, I would end up doing this. However,
I'd still like to give the bare-metal port a try.
 
E

Eleanor McHugh

I suspect that this would be the most practical approach, and
probably,
after failing the bare-metal thing, I would end up doing this.
However,
I'd still like to give the bare-metal port a try.

Well keep us informed on how it goes. I could really use a bare-metal
Ruby but I don't have the time to work on it right now :(


Ellie

Eleanor McHugh
Games With Brains
http://slides.games-with-brains.net
 
M

Michal Suchanek

2009/6/8 Sparky Mat said:
I suspect that this would be the most practical approach, and probably,
after failing the bare-metal thing, I would end up doing this. However,
I'd still like to give the bare-metal port a try.

What would you want the bare-metal port to do? If you just want to run
in-memory without using any hardware devices like disk drives,
graphics, etc it would be fairly simple.

However, there's a reason why Linux and BSDs have bazzilions of
drivers that took years to develop and debug and half of them are
still failing half of the time. There's simply way too much different
hardware which is either not documented or has undocumented bugs so
you will have hard time if you try to run on bare metal and support
any hardware but the main memory.

Exotic microkernels won't help you either because they suffer from the
same basic problem: they don't have drivers for most hardware so the
chance you can boot anything based on them on your machine is pretty
small.

The bare-metal approach is only viable for specialized applications
where you select and buy a well documented piece of hardware and port
the system to that.

Thanks

Michal
 
M

Mohit Sindhwani

Eleanor said:
Well keep us informed on how it goes. I could really use a bare-metal
Ruby but I don't have the time to work on it right now :(
I wish I had the time :(

Cheers,
Mohit.
6/8/2009 | 10:43 PM.
 
S

Sparky Mat

Michal said:
However, there's a reason why Linux and BSDs have bazzilions of
drivers that took years to develop and debug and half of them are
still failing half of the time. There's simply way too much different
hardware which is either not documented or has undocumented bugs so
you will have hard time if you try to run on bare metal and support
any hardware but the main memory.

Exotic microkernels won't help you either because they suffer from the
same basic problem: they don't have drivers for most hardware so the
chance you can boot anything based on them on your machine is pretty
small.

I agree with most of what you've said, and yes, I don't want to spend
the next few years writing/re-writing drivers just to get stuff working.
I had already shelved my Minix setup yesterday and am now setting up a
RubyVM on Linux kernel. Well, starting with a default Debian
installation and stripping out stuff now.
 
M

Michal Suchanek

2009/6/9 Sparky Mat said:
I agree with most of what you've said, and yes, I don't want to spend
the next few years writing/re-writing drivers just to get stuff working.
I had already shelved my Minix setup yesterday and am now setting up a
RubyVM on Linux kernel. Well, starting with a default Debian
installation and stripping out stuff now.


Note that on Linux many drivers (filesystem, USB, parallel, ...) can
be written in userspace so you can still use any language you like for
these. Hopefully the number of subsystems that are open in this way
will increase over time.

Thanks

Michal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,060
Latest member
BuyKetozenseACV

Latest Threads

Top