
Java on Playstation 2 - pjmlp
http://www.mikekohn.net/micro/playstation2_java.php
======
twic
> Java Grinder itself has some.. quirks and some things just missing, kind of
> mostly due to the fact that I was originally targetting the MSP430 as more
> of an experimental thing. One thing that was missing was the ability to do
> memory allocation of objects. I added the ability to instantiate some
> objects on Playstation 2, mostly with the Draw3D API. I didn't write any
> kind of memory allocator or garbage collector, so all calls to "new" are
> being done on the stack. I thought about doing some kind of heap memory
> allocator thing, but decided in the end to just keep it simple.

!

> I also added more "float" support for Playstation 2 (there was already some
> support in the Epiphany / Parallella code). Some other things such as "long"
> and "double" types are still not supported.

!!

Bloody well works though, doesn't it!

------
Reason077
> _”it disassembles into assembly source code for real CPUs.”_

Another way to describe this functionality is: “compiler”.

~~~
chii
more transpiler than compiler...but close enough!

------
mothsonasloth
Loved the demo, ended up headbanging to the music.

Java is truly a heavy metal language.

~~~
nineteen999
I always felt it was the "elevator musak" of languages.

------
cbanek
This makes me want to boot up my PS2 which has an official Sony Linux install.
Yep, they did that. They made a Redhat distrib that runs off of DVDs (with a
bootable disc), hard disk, ethernet controller, and video that could connect
to a monitor. Super fun. I'm not sure I ever accomplished much - you could
program the EE, but not run any retail games. Still so neat though! I wish
more platforms would have official linux support!

~~~
atgreen
I have one of those as well. Haven't turned it on in almost forever.

------
saagarjha
I'm not particularly familiar with the Playstation 2, but what's stopping you
from running the JVM on it directly?

~~~
opencl
[https://github.com/kaffe/kaffe/blob/master/FAQ/FAQ.ps2linux](https://github.com/kaffe/kaffe/blob/master/FAQ/FAQ.ps2linux)

Nothing really. It's basically a MIPS CPU with some custom additional SIMD
hardware. There's at least one open source JVM implementation that works on
PS2 Linux. Sun announced plans to release an official JVM for the PS2 but it
never happened. The Dreamcast had a web browser that could run Java applets
though.

~~~
monocasa
Just going to throw out there that the Dreamcast didn't have a MIPS, but
instead an SH4. You didn't really say that it was, but I just wanted people
passing by to know that.

~~~
AlotOfReading
The SH3/4 were cool little chips and had a surprising number of JVMs. Aside
from the planetweb implementation on the Dreamcast, IBM had one, there was a
cleanroom implementation called Kaffe project, and I had an optimizing JIT in
SH4 assembly. Sadly the architecture is little used anymore.

~~~
eggsome
> Sadly the architecture is little used anymore.

It's headed for a resurgence though. See here:
[https://www.vimore.org/watch/lZGHbMS882w/building-a-cpu-
from...](https://www.vimore.org/watch/lZGHbMS882w/building-a-cpu-from-scratch-
jcore-design-walkthrough-by-rob-landley-jeff-dionne/)

------
travbrack
It'd be neat if someone ported Minecraft

~~~
BuildTheRobots
300MHz CPU and 32MB RAM - it's not going to look great or have much draw
distance.

~~~
faragon
Probably not using a Java VM, but a Minecraft-like game would be doable e.g.
using GNU gcj (Java to native code). E.g. the PS2 (32MB RAM + 4MB VRAM, 294MHz
R5900 2-way IoE w/ SIMD + 2 x VLIW VUs @294MHz, with massive fillrate
capabilities) is more powerful than the PSP (32MB RAM -plus 32MB extra for
disc cache in some models- + 2MB VRAM, 2 x R4000 1-way @133-333MHz 1-way IoE
-main and aux-), and there is a Minecraft clone for it called "Lamecraft" [1]
:-)

[1]
[https://www.youtube.com/watch?v=J9zIb0zVFfQ&t=1m](https://www.youtube.com/watch?v=J9zIb0zVFfQ&t=1m)

~~~
tormeh
gcj does not do what you think it does. It compiles ahead of time, so you get
rid of the startup time and the warm-up time that plagues Java applications.
But the code produced is just as GC-happy and memory-intensive as before. So
the steady-state performance of gcj binaries vs JVM-run .class files are about
the same (or somewhat worse for gcj binaries).

~~~
Tsarbomb
The performance of gcj would have to be equal or worse than the jvm almost by
definition as it would lack the ability to do optimization at runtime in the
way the HotSpot VM does.

~~~
atgreen
Except for AFAIK there is no HotSpot VM port to MIPS, and gcj was well
supported there.

