PS2linux_notes
 

Hello all,
first of all I am not a gamer. My bud Chris (video game pusher) loaned me his PS2. then latter he gave me an old PS2 SCPH-30001 R with orange dust caked on the vents and fan. For the next six months mostly weekends my girl friend and I played with my PS2. What fun. Many games later.

I heard about this Linux kit… Makes the PS2 into a computer! You can hack out your own games and demos.
It sounds very cool. Although, almost mystical and too good to be true.

One guy at a game store said: “Why would you want a Linux Kit? You won’t be able to edit large documents with it the PS2 only has a 4Meg video buffer.”
Hey Buba, ignore the naysayer, live a little. I had to have one.

Chris has a friend, Ira (the cable guy) and he was going to sell me his barely used Linux kit with his slightly used PS2 for $200.
It seems he is a real smart guy. He does tech support for the local cable company, networking, time division multiplexing. Heavy tech stuff. Yet, he could not figure out this whole Linux kit thing.
Some hackers at the coffee shop helped him with the blind install. Because he did not have a sync on green monitor (SOG). Then after his kit sat in the closet six months he decided to sell it.

He lost the VGA adaptor and claimed there was no software manual. Plus, disk two was scratched, it kept making “unable to read disk” messages, oh well.
which on the TV looked a lot like “able uo ead isk” with a heavy italic slant.
yeah, I had to have one of these. But not this one. could this have been a sign?

I bought a new Linux kit $100 USD. little did I know it was one of the last.
And a new PS2 SCPH-50001 with a network adaptor $150.
Plus two new memory cards $40.
Had to have a backup card and can’t use the game one.

Scored on a $20 used Dell UltraScan 800HS, 15inch monitor. When I saw the Trinitron printed on the front I knew it was just a repackaged Sony. I had a SOG. No blind installs for me. And no going blind trying to read the text on a NTSC TV. You understand had already done a test drive with Ira’s kit.

Major surgery on a brand spanking new PS2, carefully removed the network adaptor with modem and stored it in the original box with a desicator. The little bag your not supposed to eat.

Quickly installed PS2 Linux. let me see, what did it say in the twenty-four page software manual. swap 128, / 2048. first mistake, Oops forgot to make /dev/hda1 the root device. Yes,  I blindly stumbled through the install. I was so exicited to have a “linux kit”.
What is this: “Grow to fill HDD?” Sure! Why not, what have I got to loose. Second mistake.

With in a couple of days I was a more than a little put off. Come on, what do you mean the mouse doesn’t work? Hello is says Sony on it. It has to be good.

Kind of tired after scrounging through old forum messages. Some of them two years old. And many are very negative, it almost seems as if these people enjoy slamming the new guy. every wonder about the name? (forUm. who is Um?)

Well, not in any hurry to join a “community” where they eat their young.
Oh yes, not to forget the PS2 Linux kit owners mantra: “google till you drop.” It felt like a dumpster dive. Sifting through other peoples old stuff.
Back in the box it went, and joined the new PS2 in the bottom of the closet.
Only now did I began to see and feel what Ira already knew.

some months latter I began reading the forum messages again. determined to whoop this beast. Would not let the pessimistic, Gloomy Gus naysayers detour me from my destiny. “kit owner maximus”.

with new found enthusiam, and a used Dell UltraScan Flat Screen 17inch monitor $70. followed the “PlayStation 2 Mouse Wheel Mini-HOWTO”, thanks
applied the mouse fix. and got back to work. Hmm, supposed to be fun, ain’t it?

Soon this occurred to me: I will need this xRhino kernel, it does all kinds of cool stuff. It sounds like the next best thing since sliced bread. My third mistake. What the hey, who’s counting. Wonder why it is named xRhino?
X don’t work.

really not to tough. get the kernel. copy it to the memory card. and update the boot menu configuration file. Simple, Eh. KaPow!



The never ending story - Begins

I want to install the xRhino kernel
get xrhino kernel
wget \
> http://playstation2-Linux.com/files/blackrhino/\
> kernel-binaries-2.2.21-pre1-xr7.tar.gz
…………………………….
…………………………….
…………………………..

tar zxvf kernel-binaries-2.2.21-pre1-xr7.tar.gz
cd kernel-binaries-2.2.21-pre1-xr7

make the kernel small
gzip –c –9 vmlinux > xrvmlinux.gz

mount memory card
mount /mnt/mc00

copy the kernel to the memory card
cp xrvmlinux.gz /mnt/mc00/xrvmlinux.gz

edit boot menu configuration file to add a line
vi /mnt/mc00/p2lboot.cnf
“xrhino” xrvmlinux.gz “” 203 /dev/hda1 “” xrhino kernel

reboot
select new item “xRhino”
cool it works.

I am going to rebuild the xrhino kernel
cd /usr/src

examine the Linux link
ls –l Linux

it points to 2.2.1_PS2, ok
rm Linux

get the xrhino kernel sources
wget \
http://playstation2-Linux.com/files/blackrhino/\
kernel-source-2.2.21-pre1-xr7.tar.gz

unpack the tarball
tar zxvf kernel-source-2.2.21-pre1-xr7.tar.gz

make a new symbolic Linux link
ln –s /usr/src/kernel-source-2.2.21-pre1-xr7.tar.gz linux
cd linux

mrproper
cp config-xRhino .config
make menuconfig
make dep clean
make vmlinux
make modules
make modules_install
mount /mnt/mc00
gzip –c –9 vmlinux > xrvmlinux.gz
cp xrvmlinux.gz /mnt/mc00/xrvmlinux.gz

vi /mnt/mc00/p2lboot.cnf
“xrhino” xrvmlinux.gz “” 203 /dev/hda1 “” xrhino kernel
umount /mnt/mc00
reboot

now for full access to the memory card and the smap-fix
cd /usr/src/linux

get the no-bwlinux-check patch
wget http://www.0xd6.org/no-bwlinux-check-2.2.21-pre1-xr7.diff
patch –p1 < no-bwlinux-check-2.2.21-pre1-xr7.diff

get the smap-fix patch
wget http://www.0xd6.org/smap-fix-2.2.21.diff
patch –p1 < smap-fix-2.2.21.diff

make dep clean
make vmlinux
make modules && make modules_install

gzip –c –9 vmlinux > xrmcsmlinux.gz
mount /mnt/mc00
cp xrmcsmlinux.gz /mnt/mc00/xrmcsmlinux.gz
vi /mnt/mc00/p2lboot.cnf
“my xrhino” xrmcsmlinux.gz “” 203 /dev/hda1 “” my xrhino kernel
umount /mnt/mc00
reboot select “My xRhino”
login and ftp some big files like system-backup.tar.gz to my pc



 now I have to get this BlackRhino installed. So the new xRhino kernel will be comfortable in its new home.

Looking at BlackRhino HOW-TO: This may be harder than I thought, the first line is: “Install Sony Playstion 2 Linux on /dev/hda1.” Remember the first mistake?
Closely followed by “create a new partition” And the second mistake?

Hmm… Hmm… what to do? Backup, Backup, Backup. why? just reinstall PS2 Linux, be careful about where is the swap. And that grow to fill HDD thing.
No. have downloaded some utilites, installed software and make done some system configuration changes. smap-fix, sps2mod, sps2dev, image2dsm, dillo, dillo-ssl, firefox, xfree86, blackbox, notes, howtos, html guides, ftp, telnet, samba, initfs.gz, xrvmlinux.gz, blackrhino_baseimage, kernel-binaries, kernel-source.
 Don’t want to go back through my notes to restore the system. ha! What notes.

what did I do after editing /etc/X11/XGSConfig .. VideoMode “VESA”
startx
ah yes I recall windowmaker and the pathetic kde, to be kind it was not fast.
maybe VESA or VGA is the default?
mouse wheel
coding for PS2, getting started
sps2


Today got BlackRhino installed...
started with xrvmlinux.gz, xrinitfs.gz from pixie_2004 thanks. this may not have the best path, but it was kinda fun. after hacking the initrd to include dhcp support and adding simple script to wget the blackrhino_baseimage I followed the BlackRhino how-to. what I did.

boot xrhino kernel 2.2.21-pre1-xr7
nicekitty login: root
Password: whatever
[root@nicekitty /root]#

create the script.
echo
/usr/bin/wget \
http://playstation2-linux.com/files/blackrhino/blackrhino_baseimage-1.0.tar.gz\
 >fun.stuff
chmod +x fun.stuff

Grab the files from web.eject.co.za these have moved http://playstation2-linux.com/projects/apa
wget http://web.eject.co.za/ginggs/ps2/xrinitfs.gz
wget http://web.eject.co.za/ginggs/ps2/xrvmlinux.gz

uncompress xrinitfs.gz
gunzip xrinitfs.gz > xrinitfs
Create a mount point for the xrinitfs
mkdir initrd
mount xrinitfs initrd –o loop
add wget
cp /usr/bin/wget initrd/usr/bin/wget
add the script.
cp /root/fun.stuff initrd/fun.stuff
add some other stuff for dhcp real simple four steps.

cp /sbin/ifconfig initrd/sbin/ifconfig
cp /sbin/dhcpd initrd/sbin/dhcpd
cp /lib/modules/2.2.21-pre1-xr7/misc/smap.o \
   initrd/lib/modules/2.2.21-pre1-xr7/misc/smap.o
vi /etc/rc.d/rc.1 #add this line
dhcpcd

save the file.
unmount loop filesystem. compress the image. copy to memory card

umount initrd
gzip –c –9 xrinitfs > xrinitfs.gz
mount /mnt/mc00
cp xrinitfs.gz /mnt/mc00/xrinitfs.gz
cp xrvmlinux.gz /mnt/mc00/xrvmlinux.gz

or with the no-bwlinux patch
cp xrinitfs.gz /mnt/mc00/BWLINUX/xrinitfs.gz
cp xrvmlinux.gz /mnt/mc00/BWLINUX/xrvmlinux.gz

added the powerfail/stopscript, from mahr_nohdd_generic, thanks
not required just4fun.

I followed the "BlackRhino install how-to" and found that it was assumed that an
individual upgrader would be using the stock linux kit kernel 2.2.1 How did I  know this? On the first boot of the new BlackRhino there was no
/lib/modules/2.2.21-pre1-xr7 in the blackrhino_baseimage? some errors.

its ok, I can get them from playstation2-linux.com. wonder if that’s why their not included in the blackrhino_baseimage?

reboot the xrvmlinux with initrd
/bin/mount –t ext2 /dev/hda1 /mnt/hd
cd !$
/usr/bin/wget \
http://playstation2-linux.com/files/blackrhino/kernel-binaries-2.2.21-pre1-xr7.tar.gz
tar zxvf kernel-binaries-2.2.21-pre1-xr7.tar.gz
cd kernel-binaries-2.2.21-pre1-xr7/lib/modules
cp –R 2.2.21-pre1-xr7 /lib/modules
reboot to BlackRhino
the reboot went well. But something is wrong lets see I’m running a patched kernel and using the modules from the distribution…

so I copied the modules from the partition where I installed the kit /dev/hda1). Since I had done some patch work and had been running the xRhino kernel with no-bwlinux and smap-fix from mrbrown, thanks.

mkdir /mnt/rhl    # in honor of it’s red hat ancestors.
mount –t ext2 /dev/hda1 /mnt/rhl
rm –rf /lib/modules/2.2.21-pre1-xr7
cp –R /mnt/rhl/lib/modules/2.2.21-pre1-xr7 /lib/modules

It worked well. Lets just say it booted and got an ip address from the dhcp server. very nicely same address each time. there are some delays with the stock ps2linux 2.2.1 kernel and the interaction with my win2000/pro dhcp server will give me a range of address’ 34, 23, 115, 119, whatever. always different from one boot to the next.

login: root <enter>
passwd: <enter>

looks good set the root passwd
passwd ..

I want to hook up with my pc is so I edit the /etc/hosts file add a line
192.168.0.1 delpc

Then I decide to get some of the good stuff that I backed up to the 120GB drive on my dell pc. Like sps2mod and sps2dev So here I sit looking at the new BlackRhino prompt, I type:

blackrhino:~# ftp delpc

I get the following:
ftp: error while loading shared libraries: libreadline.so.4.1:
 cannot load shared object file: No such file or directory

maybe I am running on an unchecked file system and some links are broken. Check dmesg, yes must run e2fsck.
reboot to the orig 2.2.1 kernel (/dev/hda1)
run e2fsck /dev/hda3
reboot to BlackRhino (/dev/hda3)
all is well. Make a symbolic link, so ftp can find libreadline.so.4.1
cd /lib
ln –s libreadline.so.4.2 libreadline.so.4.1

cd /usr/src
now ftp works.
ftp delpc
login
password
ftp>bin
ftp>hash
ftp>mget sps*
###
I see this ### for about a second.
And now I have the good stuff on my new ps2 BlackRhino linux box.
Time to unpack (following coding for the playstation 2, development options)
tar zxvf sps2mod-0.4.0.tgz
cd sps2mod-0.4.0
make depend

wow look at the error message.
/usr/include/linux/module.h:19: warning: no include path in which to find
linx/modversions.h

Ay, Wait a minute there is no /usr/src/linux directory! Ok, I can get one from
playstation2-linux.com
"wget http://playstation2-linux.com/files/blackrhino/kernel-source-2.2.21-pre1-xr7.tar.gz"
tar zxvf

make a link.
 ln –s /usr/src/kernel-source-2.2.21-pre1-xr7 linux
now make depend will be happy.
Make depend
Looks good.
Make
Still good
Make install
--- woops, that is bad.

The make is looking for /etc/rc.d/init.d
 no such file. Who would have known the directory structure is different between ps2 linux (red hat approximately 5.2) and blackrhino (debian approx. ??)

Well maybe I can
run the configure script?
Or update the Makefile
Or make some links…

make a directory /etc/rc.d and fill it with links.
cd /etc
mkdir rc.d
cd rc.d
ln –s /etc/init.d  init.d
ln –s /etc/rc0.d  rc0.d



ln –s /etc/rc6.d  rc6.d

now make install will be happy.
cd /usr/src/sps2mod-0.4.0
make install
ok the install worked

start it /usr/sbin/sps2_load

finally getting to the good stuff
unpack sps2dev
tar zxvf sps2dev-0.4.0.tgz
cd sps2dev-0.4.0/samples/vspeed
make
what!
make: g++: Command not found
did I forget to install the compiler?

well yes another trip through dselect search for gcc – installed
search for g++ not installed
looks like I forgot to install it. gosh, I wonder if anyone else has done this and maybe there is a list of recommended packages. Or even the minimums required for ps2 development? Oh yea, its bound to be out there somewhere.

ok g++ is installed
make works
lets run it. the fun
./vspeed

cool, wait how do I stop it? maybe ctrl-c
yea, that works.

even when it seems bad, it’s all good, fun.

gee, I wonder how to get XFree86 working?
well let me see dselect and search for xfree86 and x11 and xdm and wdm
then install all this stuff

how to start it? startx fails no message. I’ll try X. seems there is no /etc/XGSconfig how to make one. look through all docs (readme, FAQ, HOWTO) creating this configuration file seems to depend on some package or part of some package that does not exist in this distribution. XF86Setup, or on red hat systems, xf86config, boo hiss. is something wrong with the hard disk? are files disappearing? no. I’ll just look around in the original ps2linux.. no XF86Setup or xf86config there either, there is a /etc/XGSconfig provided by Sony, thanks.

how about if I copy the /etc/XGSconfig file from the original ps2linux kit installed on /dev/hda1 then just run “X” and just comment out anything that causes errors.
first error: VideoMode “VESA”
well just comment it out and use specific command line.
# VideoMode “VESA”
now use startx -- -screen 0 VESA,800x600x24,60
second error:
FontPath “unix/:-1”
comment it out.
cool I got a window manager. nice background, red swirl above debian. but no mouse. ctrl-alt-backspace kills the window manager

wonder if any of that stuff that I did to get the mouse working with the xrhino kernel will help?
ls –l /dev/mouse
note: to restore blackrhino orig
ln –sf /dev/gpmdata /dev/mouse
have to lookup gpm. and do it right later.

mouse links  create new mouse driver
mkdir /dev/input
mknod /dev/input/mouse0 c 13 32
rm /dev/mouse
ln –s /dev/input/mouse0 /dev/mouse

startx is long now. make small script ./myX
startx -- -screen 0 VESA,800x600x24,60


very cool
running afterstep can switch to blackbox WindowMaker can launch rvxt emulator
backspace and delete are both delete.


found a handy script in the /usr/src/Linux directory named update-kernel. patched it up to meet my needs. don’t know why they were adding the chksum. but it works. had to copy xxd from /usr/local/bin on the redhat partition.
only did this after diging through dselect | select hoping to find it in some package. no joy.

also note that mrbrown patch has some problems when I use ftp to put large files, like system_backup.tgz same symptoms as the original smap driver.
have removed the smap-fix-2.2.21 patch and copied the sony fix smap.c.us.txt to /usr/src/`uname –r`/drivers/ps2/smap.c ran eupdate-kernel after the reboot.
eth0 works like a charm. can now get and put large files

dselect grab alien
maybe I can get dillo-ssl.rpm into a .deb
and install it.
it hangs on hostname lookup.. ok go online
it fails on gdklib??? ok, dselect install gimp (will get gdklib???)
it breaks on package arch mips-sel does not match current arch ee
ok I will just copy dillo dillo-ssl bm_srv12 to /usr/local/bin

got dillo!


now for some bbn
..
..
build
config usb storage

edit
/etc/rc.d/init.d/halt
add a test before line 27 # See how we were called.
# if flash is mount then umount
if [`df | grep –c sda1` = 1 ]; then
  runcmd “Unmounting USB FatFlash drive” umount /dev/sda1
fi

if [`grep –c sda2 /etc/mtab` = 1 ]; then
  runcmd “Unmounting USB Flash drive” umount /dev/sda2
fi
having two partitions on on the lexar jumpdrive 128mb allows me to do the following, cool
usb mass storage works with the bbn kernel on hda4. mount /dev/flash  or mount /dev/fatflash

notes from april 2005