Now before you say I'm flogging a dead horse, hear me out. I've made some serious progress! After a lot of blood, sweat and determination, I more or less have Gentoo running on my PlayStation 2. Here's what I have at the base.

linux 2.4.17

binutils 2.14

gcc 3.0.4 (C and C++)

uclibc 0.9.27 (quite recent!)

xorg 7.0

I hope you'll agree that list is not quite so ancient as what we've come to expect from this platform. If the thought of compiling on such a slow machine puts you off, don't worry, I have cross-compiling working too. Both "ROOT=/gentoo-ps2 emerge blah" and distcc work just fine. The former case doesn't always work but that's just because not all packages are cross-compile friendly.

In terms of how much "fiddling" with Gentoo is necessary, I have written ebuilds for all the extra packages. There's a few patches involved and they will need some further adjustments before they can be officially accepted but most of the work has been done there. I've written my own Portage profile, which lives in /usr/portage/profiles/uclibc/mips/ps2. It's basically a combination of mips/ps2/uclibc/2.4 stuff.

As I said above, I more or less have it working. I have a few outstanding problems but none of them are showstoppers and with a bit of help, I think we can have a fully working system. Yeah! So here's the list.

********************

emerge system
"emerge system" is almost complete. I think psmisc, busybox and kbd are failing due to uclibc-specific issues. No biggy. busybox can be made to work if you leave out hdparm and I have actually seen it working. The problems might even be 0.9.27 specific because I tried 0.9.28 before (broken on MIPS) and busybox compiled with that no problem.

epatch always fails
This is a pretty weird problem. Portage works fine except that epatch, the function used for patching, always fails, even though the debug output shows that the patch applied cleanly. I only run Portage on the PS2 for the stubborn packages and I can easily unpack/patch the files using ebuild on my PC. Setting FEATURES="keepwork" stops the PS2 from screwing it up again.

gcc 3.2.2
A more recent version of gcc would be nice. gcc 3.2.2 was ported to the PS2 by MrHTFord but that version wasn't for Linux. I monkeyed around with it for ages, trying to get it to work but the best I managed was a statically compiled "Hello World". Anything more resulted in bus errors or segmentation faults. The main problem was that the compiler was geared for 64-bit and I had to hack the crap out of the specs file to get it back to 32-bit. As far as I understand it, we can't use 64-bit until we have a 64-bit kernel for the PS2. Pigs will fly before that happens. Still, I think I wasn't far off from getting gcc 3.2.2 to work, maybe someone with better knowledge can figure it out.

Graphical support (Xorg / XDirectFB / framebuffer)UPDATED 23rd May 2006
We are now in a MUCH better position in this area than we were a month ago. At that time, I firmly believed that we were going to need someone very experienced to write a new driver for us. I decided to have a shot at updating the framebuffer driver from 2.2.1 myself. Despite never having done any real kernel hacking before, I somehow managed to pull it off. You should have seen my face the first time it worked. So where are we at now? We have a fully functioning, albeit somewhat inefficient, framebuffer driver. Despite the inefficiency, it runs lsdldoom at full speed without problems. We also have modular xorg 7.0 running on the fbdev driver. Early indications show that it is working well. While all this is sufficient for simple desktop apps, it is perhaps less than sufficient for anything more intensive like games. The basic requirement here is to get some 2D acceleration working. This would involve porting XDirectFB to xorg 7.0 and writing a DirectFB driver specifically for the PS2. I anticipate that I may be able to do both of these things myself. More advanced requirements in the form of 3D acceleration would probably require writing DRI/DRM drivers. I anticipate that this may be beyond my capabilities. Having said that, I seem to recall there being some existing 3D acceleration on the original distribution. I don't know at this point whether any of that code is still useful.

********************

Okay so that's pretty much all the problems I've encountered. Anyone care to help? Let me know and I'll send you a tarball of my system as it stands. I'm netbooting my system over NFS but you can use a hard drive if you prefer. If you want to help out but don't have the PS2 Linux DVD, which is needed to boot then send me a PM.

Last edited by Chewi on Sun May 28, 2006 10:37 pm; edited 6 times in total

how did you manage this with the linux kit or some other way??
forgive me if this has been beaten to death i only asked this because it is getting harder to find the linux kit and if possible i would like to avoid getting it if possible

Last edited by 22bsti on Tue May 02, 2006 12:45 pm; edited 1 time in total

Weeell... I didn't want to say this because I don't want to be hauled up as some pirate - I don't condone piracy. It's true, I don't have the kit. The only part of the kit you actually need that you can't buy separately is the first DVD. It has the PS2Linux RTE on it. The problem is that you can't buy the kit at all anymore, let alone buy the DVD separately. Yeah sometimes you can get in on eBay but it's like gold dust there. Because of all that, I had to download the first DVD via torrent and use certain risque methods to make it work. Some people might say "Well I bought the kit, why didn't you?" but I didn't get into this until recently. They stopped selling it years ago. If Sony were to start selling the DVDs again, separately from the kit and at a reasonable price than I would certainly buy it. I don't want to make further excuses for myself but I think it may be fair to say that the kit's price was largely to cover the cost of the hardware rather than the software anyway.

Where's my band of helpers? I guess if you want something done, you've got to do it yourself. Consequently I've started working on bringing the framebuffer driver to 2.4. I've only ever made small adjustments to the kernel before but it seems to be working out. Despite the fact that the PS2-specific code was moved all over the place between 2.2 and 2.4, I have managed to fix several compiler errors so far. This is what's left!

All I got was a blank screen! I was able to see that dmesg output by SSHing in. To be honest, that's a better result than I was expecting. I didn't really expect the kernel to boot at all, especially not first time! The /dev/fb0 device node is there and fbset seems happy so I'm definitely on the right track.

If you have a way of working around the sync-on-green requirement for the monitor, let me know. You say you don't have the kit so maybe you don't know what I'm talking about. The only monitor I have that worked with the kit is a 24" beast of a CRT. There's no way I'm taking that thing all the way to school with me and then up four flights of stairs to my room .

Sync-on-green is only a requirement if you're using a monitor. You can just use a TV as I have been doing - I don't have the monitor adapter myself. TV resolutions are a bit odd and not great - something like 640x200 or 640x240 (I think it's different for PAL and NTSC). However 640x400 and 640x480 are possible if you use interlacing. This usually results in a really bad flicker but I found an optional "trick" being used in the framebuffer driver, which majorly reduces the flickering. I haven't got the framebuffer driver to work yet (been away for a few days) but I've seen exactly the same technique used on the Amiga and it does work really well. If you really want to use a monitor, check out this list. You've probably seen this already though. http://playstation2-linux.com/sog.php

Great news! I've almost got the framebuffer driver completely working! It works right now but only with text, any graphical stuff doesn't appear. A simple framebuffer test program says its working but nothing appears. fbv (framebuffer image viewer) shows nothing. links2 complains about the mouse, not sure why, gpm is working fine. lsdldoom bombed the first time I tried it and then crashed the machine the second time I tried it. I'll get there soon enough.

I think the Gentoo MIPS guys will be reluctant to support this even after I get much of it working but I certainly don't blame them. It's a lot to ask. Consequently, I will probably launch an independent site for this, with its own bug tracker where people can look up solutions to common problems.

Coincidentally, the GentooX developer, the only official Gentoo developer in Scotland, lives in Edinburgh, which is just an hour and a half from here. He has a much easier a much easier job than I do though, the Xbox is basically just a stripped down PC in a fancy case!

My girlfriend was playing Doom this afternoon so as I said in the last post, it really does work. I'm trying to get X working now, either through XDirectFB or Xfbdev. I'm not sure which route to take. As far as I can tell, the only advantage XDirectFB has is hardware acceleration - but we won't get that unless I write an accelerated driver. I don't think that's as hard as it sounds. The advantage that Xfbdev has is that it is officially part of Xorg and consequently, it is more up-to-date. It is also more likely to work with Gentoo's modular X setup. I've tried asking around on the subject but haven't had any useful answers yet. I'm trying XDirectFB now anyway.

Mabe you need to integrate this in portage under another thing
Mips= Linux/GNU/lgibc/mips (if my memory is good)
so why not:
usr/portage/profiles/consoles/playstation2/mips
or:
/usr/portage/profiles/playstation2//mips

instead of having something like the xbox:
/usr/portage/profiles/default-linux/x86/xbox

so this thing won't be suported by the mips guy but by another team
mabe you need to find people to support that
i think that the first thing would be the integration in portage
then mabe a stage3 and an install cd and the install docs

mabe you will need to learn how gentoo project works that could help you a lot
Mabe the xbox also need to be integrated into the main portage tree

Last edited by GNUtoo on Sun May 21, 2006 9:25 pm; edited 1 time in total

Using µclibc over glibc is important for two reasons. Firstly, the PS2 only has 32MB RAM - glibc would eat that for breakfast. Secondly, glibc hasn't been updated for the PS2 in a very long time. There were a LOT of patches applied. It's possible that a recent glibc version would work without patches but I doubt it. µclibc, on the other hand, works pretty much out of the box.

I don't think I really need a dedicated team, I've been working entirely on my own so far. Obviously I can only do so much since my knowledge is fairly limited but any help, even if it's just a one-off patch for something, would be appreciated.

stage3 was my original intention. stage2 might be a possibility. stage1 is pointless because a PS2 is a PS2, no questions asked. A bootable install CD is out of the question, simply because you cannot boot from any disc using the RTE other than the official PS2 Linux DVDs. Some kind of netbooting tarball would be feasible though.

I am extremely familiar with Gentoo, I've been using it solidly for three years. Seems longer.

Okay here's the deal with XDirectFB. It currently only builds against the old-style monolithic X build trees - so either xorg 6.8 or 6.9. It currently won't build against xorg 7.0. This means that when you build it with Portage, it tries to build practically the whole of xorg just to build one pesky server. I wasn't sure if the resulting server would work alongside xorg 7.0 components but I decided to try anyway. I didn't get to find out though because the build failed due to a missing C++ compiler. Since it would be a lot more sensible to get XDirectFB working with xorg 7.0 and since it offers no immediate benefit to us, I've decided to put it aside for now.

I then looked at Xfbdev. It's another simplistic X server that is part of the TinyX collection of servers, also known as kdrive. This builds in much the same way as XDirectFB but as far as I know, it only builds against XFree86. That's a big no no.

It was then that I realised there was still one more option left. I had been confusing Xfbdev with the fbdev driver for the xorg server. The xorg server is not exactly minimalistic but it'll do for now. XDirectFB and Xfbdev are designed to be minimalistic and will run with very little else installed but the fact is that unless you're running very simple apps, you still tend to need a whole plethora of X libraries. I know this from trying to use Xvesa (one of the other TinyX servers) on a Pentium 133 once. It's not as big a problem as it used to be thanks to modular X though since Portage will generally only install the libraries you actually need.

Sooo... I'm 52 packages away from having xorg server emerged. Most of the packages are stubbornly refusing to cross-compile due to path issues (trying to link against /usr/lib/libX11.so instead of /mnt/gentoo-ps2/usr/lib/libX11.so for example) so I'm having to build it on the PS2 itself. I'm using distcc but it's still slow. Anyway, next time I post here, it might be from some browser on the PS2. Haven't decided which one yet!

So at first, I had it using 640x240, which was just unbearable. After some tweaking of the config file, I got it to use 640x480 with interlacing. It's impossible to read anything, especially on my 14" TV but I'll try some bigger fonts later and I'll also try enabling the anti-flicker option in the framebuffer driver. Those resolutions are for PAL, the respective resolutions on NTSC would be 640x224 and 640x448.

Have you tried a Sync-on-green monitor hooked up to the "VGA" output? (true VGA has separate sync, not SoG... hence I call it "VGA")

I've been watching this from a distance, but you seem to have made great progress on this so far. Whether a PS2 running modern Linux will be all that useful or not remains to be seen... 32MB RDRAM isn't a lot to be playing with, even with loads of HDD space for swap.

What CHOST are you using? And how are you working around the PS2's bastardised CPU?_________________Stuart Longland (a.k.a Redhatter, VK4MSL)
I haven't lost my mind - it's backed up on a tape somewhere...

I don't have the monitor adapter and I doubt it would work with my monitor anyway.

I was wondering when you or Kumba would say something! At the moment, I'm netbooting and using swap over NFS so it's even slower than it might be but it's not been too bad. I've installed Gentoo on an Amiga 1200 before so I've put up with worse. Then again, my Amiga has 128MB RAM! As you say, it remains to be seen whether it holds up well under any real usage. The thing is though, I never intended this to be for anything serious. I have two motivations. Firstly, I want a machine my girlfriend can chat on MSN with and play simple games on. Secondly, I just enjoy the challenge.

The CHOST I'm using is mipsEEel-scei-linux-uclibc. I don't know MIPS assembly or anything like that. Apart from updating the framebuffer driver, all I've really done is brought the best of what's already available for the PS2 into the context of a modern Gentoo system. That's linux 2.4.17, binutils 2.14 and gcc 3.0.4 (maybe 3.2.2 with some help). The rest works more or less out of the box. Cross-compiling using Portage has failed more often than not but that's not a PS2 problem.

Not very useful, I'm afraid. Black Rhino is the ancient Debian-based distribution most of the PS2 Linux community are already using. That version of Gentoo PS2 is also ancient and was never updated beyond the original release.