This tutorial is about getting SPS2 working on memorycards with no harddisk available. Before you can use it, you need a working no-hdd memorycard. If you do not have one yet, you should go through the tutorial at
http://playstation2-linux.com/download/nohdd/ps2nohdd.htmlYou also need to have a working sps2_mod.o available. (If you have installed the sps2-kernel-module on your harddisk, you can find it in /lib/modules/2.2.1/misc/ ) If you do not have one, install the sps2 kernel module from
http://playstation2-linux.com/projects/sps2/
If you have done the cloop-tutorial, you should put all mentioned files into the romimage and not into the initrd. Otherwise simply put all mentioned files into your initrd.
Create the directory "modules" on your initrd or your romimage.
Then copy sps2_mod.o from /lib/modules/2.2.1/misc into the directory.
For a little script-action we need the following executables:
Last but not least you have to make sure that the kernel on the memorycard has /proc support. (If do not know what /proc is, or are unsure whether your kernel has /proc support, it most probably has.)
SPS2 needs some of the ps2 special files for working properly. Since device-files do not consume space, we will simply copy over all of them.
Execute "cp -R /dev/ps2* ./" in the "dev"-directory of your initrd. (the "-R" must be uppercase)
Unfortunately you are not done with simply loading the sps2 kernel module. You have to extract the major number of the module from /proc/devices after you have inserted it and create a device-special-file with this number.
Usually sps2_load does all this, but this time we cannot use it, because we neither have bash nor awk available. (and including them would be a waste of space).
So we will have to create our own "awk" to extract the number.
Create the file "getsps2major.c" somewhere in your home-directory and put the following code into it.
#include <stdio.h> int main() { FILE * devices = fopen("/proc/devices", "r"); char line[100]; while (fgets(line, 100, devices) != 0) { strcpy(line, &line[strspn(line, " ")]); if ( (strrchr(line, ' ')!=0) ) { if (strcmp(strrchr(line, ' ')," sauce_char\n")==0) { line[strspn(line, "0123456789")] = 0; printf("%s", line); } } } fclose(devices); return 0; } //end of fileCompile the prog with "gcc getsps2major.c -o getsps2major" and copy "getsps2major" over to the "bin"-directory of your initrd or romimage.
Now we will do what sps2_load usually does: some script-action.
Create or edit the file "startscript" on your initrd or romimage and put the following into it:
#!/bin/sh #mount proc to get access to /proc/devices mount -t proc none /proc #load the sps2-kernel module insmod ./modules/sps2_mod.o #create the sps2 special-file mknod /dev/sps2 c `getsps2major` 0 #--end of file--#Don't forget to make the startscript executable with "chmod 755 startscript".
That's all. Have fun.
(You do not need any libraries for sps2, because it is statically linked into your programs.)
Mr.M
Copyright (C) 2004 Michael Mahr (Michael.Mahr@fh-joanneum.at)