GCC 3.4.6

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
User avatar
Chewi
Posts: 104
Joined: Sun Nov 26, 2006 12:49 pm
Location: Perth, Scotland
Contact:

GCC 3.4.6

Post by Chewi »

Hi guys. I've taken on the ambitious aim of bringing the Linux on PS2 situation up to speed. I realise that most of you are much more interested in Linuxless development on the PS2 but I also realise that a small part of that is down to the fact that the existing Linux software is so old - and that's what I'm trying to fix.

I'm a long time user of Gentoo Linux and that's the distro I'm using for this. It compiles all its packages from source, which makes it ideal. Earlier this year, I successfully built a base system using gcc 3.0.4 and uClibc 0.9.27. It included xorg 7.0 running on the ps2gsfb driver. There's life in the old black box yet. ;)

My more recent experiments have produced a working patch against Linux/MIPS 2.4.19 and an almost working patch against Linux/MIPS 2.4.20. I've got 2.4.33.3 to build and start but it kernel panics fairly quickly at the moment. ;) Previously the latest version available was an extremely heavily patched version of 2.4.17. We now have binutils 2.16.1 thanks to a fellow Gentoo user. I've also managed to get GCC 3.2.2 working on Linux - or at least it seems to be working okay so far. Previously 3.0.4 was the latest version available to Linux.

The reason I'm here is because I'd like to try and bring GCC further up to date. I'm not too bothered about GCC 4 since I understand that uClibc isn't quite ready for that but GCC 3.4.6 would be very nice. In particular, I need --sysroot support, otherwise I'll be forced to build everything on the PS2 itself, which isn't ideal as you know. I read that the MIPS backend had been rewritten in 3.3 but I figured I'd have a go myself anyway. I tackled the three hardest files first, mips.md, mips.h but then gave up shortly after starting mips.c.

The fact is I'm out of my depth here. I must confess that I'm not really much of a kernel hacker or a toolchain hacker and I don't know MIPS assembly or anything like that. My progress so far has primarily been focused around comparing the different patches and making changes based on intuition and quite a lot of luck. I never thought I'd even make it this far. But that's why I'm doing this, to learn about this stuff while doing something useful in the process. It's a pretty steep learning curve though and that's why I need your help.

Here's the patch I've come up with so far and the rest of the gcc 3.2.2 patch that I either haven't tried to merge yet or was unable to merge in the case of mips.md, mips.h and mips.c. It's those files I really need help with. I can probably figure the rest out myself.

http://gps2.aura-online.co.uk/patches/g ... -far.patch
http://gps2.aura-online.co.uk/patches/g ... vers.patch

So who's out there anyway? I know that MrHTFord and/or mrbrown had originally intended to reach 3.4 but I don't think they're around anymore? I saw a post that said blackdroid had looked at GCC 4. Help from anybody would be much appreciated. Cheers. :)
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

I've got a PS2 Linux disc. I used it for a while. It's just really out of date. I'd love to see something like Xubuntu on the PS2. :)
Henk
Posts: 14
Joined: Fri Dec 29, 2006 10:19 am

Post by Henk »

I got a Slim PS2 for my son for last x-mas, and just now started reading a little bit about the whole linux on ps2 project.

What I found out is that there is no linux kit for the slim ps2, since it doesn't have the expansion bay for the harddisk.

I was wondering though if a diskless installation is possible? I have a crystal 2 chip built in, so I am wondering if there is a loader in .elf format to boot up a kernel and initrd. If there is then I could setup my linux box to provide the root fs via nfs, or if the kernel supports usb i could boot into a filesystem on a memory stick or external harddisk.

So basically what I'm asking is, does anyone have a .elf loader to boot the linux kernel? If so I'd be very interested, as I don't see the original DVD's being sold anywhere.
User avatar
Chewi
Posts: 104
Joined: Sun Nov 26, 2006 12:49 pm
Location: Perth, Scotland
Contact:

Post by Chewi »

First of all, I must confess to a little lie I told in my first post. I was a bit too optimistic about GCC 3.2.2 working in Linux. I soon found that it was still very broken. Some simple static programs work but anything shared still fails and it seems to have trouble with the assembly when building certain things such as Busybox.

I haven't tried with a slimline before but people ask me about it a lot. I'm quite confident that it would work since I have actually used a system mounted over NFS more than I have used a hard drive. The only drawback is that it is very slow due to some unknown problem with the ethernet driver. Having said that, my early tests with kernel 2.4.19 (I have almost completed a patch against it) have shown that the ethernet peformance has dramatically improved. :) Don't ask me how!

Unfortunately, there is no ELF loader. The closest we ever got to having one was mrbrown's attempt but he didn't get very far into it before development stopped. You can still buy the original DVD in some parts of the world with just the monitor adapter from linuxplay.com. This is where I got mine from. Otherwise, you'll just have to make use of your modchip.
Henk
Posts: 14
Joined: Fri Dec 29, 2006 10:19 am

Post by Henk »

Do you know of some sort of howto to get whatever kernel to boot on the PS2 without needing to buy the original DVD's?

I'd even settle with slow speed for now, I would just like to see the kernel actually booting on my PS2. I just have no idea where/how to get started without having the DVD's, and I haven't found much info about linux on the ps2 at all so far.

As said I have a Crystal 2.0 and it has the ability to launch .elf programs. Can I just copy the kernel on my Memory Card and run it with the CC Boot Manager (like I'd do with any other .elf program)? Or do I need to burn a specialized Disk (CD/DVD) that the PS2 would boot as if it was a game disc. Sorry to ask this stupid questions, but I can't get the DVD's right now and I'd really like to try this out somehow.
User avatar
Chewi
Posts: 104
Joined: Sun Nov 26, 2006 12:49 pm
Location: Perth, Scotland
Contact:

Post by Chewi »

I assumed Crystal 2 was some modchip that allowed you to boot burnt DVDs by simply inserting them. If that's not the case then you really need Swap Magic and a slide tool. You can't run the kernel directly, it needs to be started through the RTE and that can't be run from the memory card, believe me, I've tried.
User avatar
evilo
Posts: 230
Joined: Thu Apr 22, 2004 8:40 pm
Contact:

Post by evilo »

Very good initiative, I just hope that someone will be able to pick it up, and finish your work :)

blackdroid, mrBrown ? please come back a little on the ps2 side :)

regards,
evilo
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

What would be best would be to write new drivers for linux that used ps2dev sdk instead of RTE. A lot more work, but definitely better.
User avatar
Chewi
Posts: 104
Joined: Sun Nov 26, 2006 12:49 pm
Location: Perth, Scotland
Contact:

Post by Chewi »

That's what mrbrown was doing before he disappeared. I have a wiki on all this. Here's the page about that...

http://gps2.aura-online.co.uk/trac/gent ... Experiment
Henk
Posts: 14
Joined: Fri Dec 29, 2006 10:19 am

Post by Henk »

Does anyone know where to get that DVD for under 100€?

I won't need the Harddisk, Keyboard, Mouse and Monitor Cable anyways.
User avatar
Chewi
Posts: 104
Joined: Sun Nov 26, 2006 12:49 pm
Location: Perth, Scotland
Contact:

Post by Chewi »

It's pretty rare. Where do you live?
Henk
Posts: 14
Joined: Fri Dec 29, 2006 10:19 am

Post by Henk »

Paris / France :)

I tried http://www.e-logistic.co.uk/index.php?store=linuxplay but it just gives an error message :(
User avatar
Chewi
Posts: 104
Joined: Sun Nov 26, 2006 12:49 pm
Location: Perth, Scotland
Contact:

Post by Chewi »

You're lucky since there aren't many places you can still buy it from. That site seems to work for me but it's a bit slow and unresponsive. Maybe just try again later. It worked for me a few months ago. If you can't get the site to work, try giving them a call or something.
jockyw2001
Posts: 339
Joined: Thu Sep 29, 2005 4:19 pm

Post by jockyw2001 »

Henk wrote:Paris / France :)

I tried http://www.e-logistic.co.uk/index.php?store=linuxplay but it just gives an error message :(
They've got it for only £20.27
Linux (for PlayStation? 2) allows you to run the versatile Linux operating system on a consumer PlayStation? 2. In addition to the Linux kit, you will require a PlayStation 2, Memory Card (8MB) (for PlayStation 2), a USB keyboard and mouse, a PlayStation 2 network adaptor, an IDE hard drive and a monitor with sync-on-green capabilities.
Welcome to the Linux Play store

Welcome to this online shop for purchasing Linux for PlayStation?2. Orders from this shop can be delivered across Europe, Africa and the Middle East.

Linux for PlayStation 2 is a simple bundle consisting of the Linux installation DVDs, and a monitor cable, intended to be of interest to Linux hobbyists and games/graphics programmers. The HDD, network adaptor, keyboard and mouse components are no longer available.
Henk
Posts: 14
Joined: Fri Dec 29, 2006 10:19 am

Post by Henk »

Sorry, I should have been more precise. After entering delivery information and credit card details, it simply tells me that a general error occured.

I tried to call them but it tells me the number is invalid by a generic computer voice.

I also tried to email them but the mail was returned and said the account does not exist.

I am not sure that company still exist. Maybe they paid their website and advance and that's why its still running.
jockyw2001
Posts: 339
Joined: Thu Sep 29, 2005 4:19 pm

Post by jockyw2001 »

User avatar
Chewi
Posts: 104
Joined: Sun Nov 26, 2006 12:49 pm
Location: Perth, Scotland
Contact:

Post by Chewi »

That's the place he's been trying. It's very strange but maybe they really have shut down. :(
rafael2k
Posts: 18
Joined: Sun Jan 14, 2007 2:41 am

new to ps2 development

Post by rafael2k »

hi all,
A friend bought a ps2 slim, so of course we want to install linux on it ;)
the ps2 has a good modchip, i dunno exacty what, but we already booted the ps2menu from a cd generated by cdgenps2 and it worked ok.

this guide was useful:
http://mysite.wanadoo-members.co.uk/cd2mem

then, i copied a vmlinux and a initrd to the memory card (kernel 2.2.1-...), with the help of the ps2 diskless project.

i copied a p2lboot.cnf to the root directory of the memory card:
"Linux" vmlinux initrd 203 /dev/ram0 "crtmode=ntsc3,60" Drugger-based Linux

but the ps2 linux dvd 1 was unable the show me a option to boot from memory card.
what could be wrong?
I
User avatar
Chewi
Posts: 104
Joined: Sun Nov 26, 2006 12:49 pm
Location: Perth, Scotland
Contact:

Post by Chewi »

I've managed to do it before so it should work. Did you copy p2lboot.cnf in Linux or using some homebrew program? Linux doesn't usually mount the memory card from its real root, it actually mounts a folder called BWLINUX and that's where you need to put the file.
rafael2k
Posts: 18
Joined: Sun Jan 14, 2007 2:41 am

sorry, i started another thread...

Post by rafael2k »

sorry, i do not use foruns too much...

(cut and paste)
http://forums.ps2dev.org/viewtopic.php?p=49883

I'm using Linux to compile the things and the create the config files.
to copy the files to the mc, as I don't have any ps2 running linux, i use the ps2menu to copy the files to the mc.

so the steps are:
- create a folder called 'bwlinux' inside the memory card
- copy p2lboot.cnf and vmlinux (the very minimul) to the bwlinux dir
- the ps2linux dvd 1 should found the linux to be booted from the mc
?

I compiled a 2.4.17 kernel w/ usb_storage built-in:
http://darksnow.radiolivre.org/ps2/
but i do not have a way to test it ;P

bye,
rafael diniz
Post Reply