Loading an ELF file above 0x80000000

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

Moderators: cheriff, Herben

bee7
Posts: 20
Joined: Sun Nov 16, 2008 5:42 am
Location: Jakarta

Re: PSTwo network and sound

Post by bee7 »

deba5er wrote:I'm just as much a newbie as yourself when it comes to kernel compiling. The newer smap download location is referenced on http://playstation2-linux.com/forum/mes ... g_id=48853

Remember that you already have patches applied to the PSTwo kernel, AND that Mega Man may have already applied these smap patches. My interest is in what would happen if the smap module was recompiled to force ps2_pccard_present = 0x0100. This would allow the module to attempt to use the driver, which would then display possibly more meaningful errors. Maybe Mega Man can offer further hints?
hmm, i give up, i cannot build cross compiler.
i followed this tutorial to make it up:
http://playstation2-linux.com/download/ ... 1.0.1.html
but i cant find binutils-cross-libpatch, so i followed next, i dont know its right or not, i ended up error in make command.
"/bin/sh: autoheader: command not found"
dont know what it means..

anyone know how i can have cross compiler for less complicated procedure? i need it to recompile kernel. peace.. :)
whig
Posts: 34
Joined: Sun Jan 04, 2009 5:52 am

Post by whig »

ps2stuff cross compiles my kernels.

http://ps2stuff.playstation2-linux.com/
bee7
Posts: 20
Joined: Sun Nov 16, 2008 5:42 am
Location: Jakarta

Post by bee7 »

whig wrote:ps2stuff cross compiles my kernels.

http://ps2stuff.playstation2-linux.com/
thanx for your help, i manage to get mipsEEel-linux-gcc version 2.95 patched, now i continue compile kernel, but i see error when trying "make modules", showing:
...
as unrecognized option '-G'
In file included from rd.c:59:
/root/linux-2.4.17-ps2/include/linux/module.h:299: output pipe has been closed
make[2]: *** [rd.o] Error 1

hmm, am i using the wrong gcc??
whig
Posts: 34
Joined: Sun Jan 04, 2009 5:52 am

Post by whig »

At a guess... the "as" program isn't the "ee-as" it should be looking for. Either your $PATH doesn't include where ee-as is, or perhaps /usr/local/ps doesn't contain/point to the ps2stuff tree.
bee7
Posts: 20
Joined: Sun Nov 16, 2008 5:42 am
Location: Jakarta

Post by bee7 »

whig wrote:At a guess... the "as" program isn't the "ee-as" it should be looking for. Either your $PATH doesn't include where ee-as is, or perhaps /usr/local/ps doesn't contain/point to the ps2stuff tree.
Image

Image

is there anything missing?

thanx

-- edit
it's working now! thanx u very much! i forgot to extract "binutil" files..
bee7
Posts: 20
Joined: Sun Nov 16, 2008 5:42 am
Location: Jakarta

Post by bee7 »

i successfully do "make modules", but when i tried "make bzImage" as instructed in readme file, all i get is:

make: *** No rule to make target 'bzImage'. Stop.

i'm compiling kernel source 2.4.17 from sourceforge:
http://sourceforge.net/project/showfile ... _id=223793

i cant find the result kernel image in arch/mips/boot folder.
whig
Posts: 34
Joined: Sun Jan 04, 2009 5:52 am

Post by whig »

make zImage :)

vmlinux.gz in top dir.
bee7
Posts: 20
Joined: Sun Nov 16, 2008 5:42 am
Location: Jakarta

Post by bee7 »

whig wrote:make zImage :)

vmlinux.gz in top dir.
hahaaa, thanx again! the readme file told me to do make bzImage, so lost... :)
now i'll experiment with my own compiled kernel and post here if it works..
DAYAK
Posts: 9
Joined: Mon Mar 02, 2009 2:21 am

SCPH-90004 / PAL / Installing on USB problem

Post by DAYAK »

I have SCPH-90004 Slim ps2. I had succesfully setup FreeMCBoot and over ESR I can play backup games or I can run any ELF I want.

These questions are MegaMan and the other users in this forum:

1) I have a common problem with the homebrew codes as well as the KernelLoader (I have tried with 1.9, 1.8, 1.7 and 1.6 and the special psTwo version you put on this forum before). The below does not work on my PS2. As I said for every homebrew code I have the same problem:

Code: Select all

	if (*((char *) 0x1FC80000 - 0xAE) != 'E') {
		mode = MODE_NTSC;
		refreshesPerSecond = 60;
	} else {
		mode = MODE_PAL;
		refreshesPerSecond = 50;
	}
It always opens with NTSC.

Q: Is there a way that I can get rid of this problem without recompiling

-----------------------------------------------------------------------

2) I have used one of my 60 GB harddisk as set as below with my Ubuntu desktop computer:

SDA1 : 2 GB FAT16 -> Setup files (kloader.elf, initrd.gz, vmlinux etc.)
SDA2 : 50 GB EXT2 -> Linux (I untar the Linux distribution here*)
SDA3 : REST is SWAP

* Also edit the /etc/fstab as the sda2 is ext and sda3 is the swap

Q= Is this setup reasonalbe?


-----------------------------------------------------------------------

3) From now on there are two ideas
3a) I have boot it with special slim version of KLOADER.ELF + VMLINUX and tried to boot directly from newroot=/dev/sda2 ro

3b) I have tried to boot the same way but this time I used initrd.usb.gz and ramdisk.

3a failled very bad. I think that is normal but 3b is failing too. First of all I do not see the USB partitions. I have tried to mount with
mkdir MYPart1
mount -r -t vfat /dev/sda1 /MyPart1 or the other way
mount -r -t vfat /dev/scsi/...bus0/luc0/part1

in both I failed. The error is "block is not such thing" (Sorry I remembered as like this).

Q=Is this just a problem about new slim PS2 USB as it has been disguessed before or am I doing something terriblly wrong?


-----------------------------------------------------------------------

4) I decided to do my own initrd.gz. So I downloaded psboot-1 from ps2dev:

First of all modprobe in this distribution looks like compiled with 2.4.17 but the kernel inside is 2.2.2x so everytime I try to use modprobe I get a msg that /lib/modules/2.4.17_mvl.../some library is missing.


Q=Why o I get such error? If it is just a mixed and if it is not my fault, can any body post a working initrd src code for latest kernel?


more to come but maybe if I can figure out these I will eliminate the rest of the problems...

-----------------------------------------------------------------------

5) And a last tiny question. In the KLOADER.ELF which is for psTwo Slim, why do I always see the interrupt msgs. I click on the keyboard and it says IRQ 24 : recieved. And it does for everything. So it is very difficult to understand what you are writing.

Q= Where/How can I turn it off?
bee7
Posts: 20
Joined: Sun Nov 16, 2008 5:42 am
Location: Jakarta

Re: SCPH-90004 / PAL / Installing on USB problem

Post by bee7 »

DAYAK wrote: 4) I decided to do my own initrd.gz. So I downloaded psboot-1 from ps2dev:

First of all modprobe in this distribution looks like compiled with 2.4.17 but the kernel inside is 2.2.2x so everytime I try to use modprobe I get a msg that /lib/modules/2.4.17_mvl.../some library is missing.


Q=Why o I get such error? If it is just a mixed and if it is not my fault, can any body post a working initrd src code for latest kernel?


more to come but maybe if I can figure out these I will eliminate the rest of the problems...
why dont you just try my initrd?? i modify it,adding some 2.4 modules.

http://rapidshare.com/files/202680951/initrd.clean.gz
DAYAK
Posts: 9
Joined: Mon Mar 02, 2009 2:21 am

usb/tts/0 or ttyUSB0 ???

Post by DAYAK »

Hi,

Thanks for the reply. I have tried it. Ican load usb-storage module without problem now.

I pluged out and pluged in the harddisk again.

Here is what happens:

Code: Select all

usb.c USB new device connect to bus 1/2 assigned device number 6
usb_control/bulk_message : timeout
usbserial.c FIDI SIO converter detected
usbserial.c FIDI SIO converter now attached too ttyUSB0 (or usb/tts/0 for devfs)
I have seen this before but I was thinking the problem was that I could not load the usb_storage module.

But even I loaded now, I get the same thing.


What is ttyUSB0? Are the double backslashes are missing in C code printf ??

And where is that usb/tts/0 ????

I thought if everything wen well I was going to mount my drives as simple as mount -f vfat /dev/sdaX /mnt ...

Life is never that simple isnt it? :)

EDIT: I have tried to create a node with

Code: Select all

 mknod /dev/ttyUSB0/ c 188 0
and then moun it with

Code: Select all

mkdir myusb
mount -r -t vfat /dev/ttyUSB0/ /myusb
it crashed...
whig
Posts: 34
Joined: Sun Jan 04, 2009 5:52 am

Post by whig »

1) On my slim ps2 I see '\000' for that byte... I have to recompile to get PAL.

3) my usb hdd no-go either; I make do with usb pen drives (and they're flakey at that.)
cosmito
Posts: 307
Joined: Sun Mar 04, 2007 4:26 am
Location: Portugal
Contact:

Re: SCPH-90004 / PAL / Installing on USB problem

Post by cosmito »

DAYAK wrote:I have SCPH-90004 Slim ps2. I had succesfully setup FreeMCBoot and over ESR I can play backup games or I can run any ELF I want.

These questions are MegaMan and the other users in this forum:

1) I have a common problem with the homebrew codes as well as the KernelLoader (I have tried with 1.9, 1.8, 1.7 and 1.6 and the special psTwo version you put on this forum before). The below does not work on my PS2. As I said for every homebrew code I have the same problem:

Code: Select all

	if (*((char *) 0x1FC80000 - 0xAE) != 'E') {
		mode = MODE_NTSC;
		refreshesPerSecond = 60;
	} else {
		mode = MODE_PAL;
		refreshesPerSecond = 50;
	}
It always opens with NTSC.

Q: Is there a way that I can get rid of this problem without recompiling
The following code is based from from latest gsKit and should work :

Code: Select all

	int detect_signal()
	{
		char romname[14];
		GetRomName((char *)romname);
		if (romname[4] == 'E') {
			return 1;
		}
		else {
			return 0;
		}
	}
It gives 1 for PAL and 0 for NTSC.

A: It might be possible to fix it at binary level by hex editing, but I need some experimenting first. In theory it should be doable.
rgrimes
Posts: 5
Joined: Wed Mar 04, 2009 12:55 am

Post by rgrimes »

cosmito wrote:Cool. And someone there with good will and enough free time to write a tutorial for the installation on PS2 slim models?
I have it working on a scph-77001 ntsc PS2 slim and a 1GB flash drive split into 3 parts, 32mb Fat for getting setup, 800mb ex2fs for the linux distro, 170mb swap.

Some cheating was done as I also have a fat ps2 scph-30001r, but I think all the bits can be put togeather so that someone with a way to run ulaunchelf should be able to get blackrhino running on there PS2 slim.

At present networking is not working, but thats cause the kernelloader is telling the linux kernel that there is no network or hard drive. (ps2_bootinfo->pccard_type=0, which says no IDE and no Ethernet, it needs to say 0x0100). This is probably cause by a failure of dev9init in the kernelloader code before it calls the kernel.

I am more than willing to help update/write tutorials on how to get this hoing on a ps2 slim, but was kinda holding back tell I got the network part going, but the more I dig into that the more it becomes something Mega Man would probably be a lot better at fixing. I can say for certain that linux on slim is saying that there is no network hardware cause the bootloader has told it that there is none.
mazxim
Posts: 23
Joined: Thu Jan 24, 2008 12:29 am
Contact:

Post by mazxim »

rgrimes wrote:Some cheating was done as I also have a fat ps2 scph-30001r, but I think all the bits can be put togeather so that someone with a way to run ulaunchelf should be able to get blackrhino running on there PS2 slim.
Nothing new, rgrimes. We actually knew that blackrhino can work on PSTwo through only USB. Many others have posted some couple of kernel/initrd that work with the last Mega Man's kernel loader release. As deba5er pointed out some post ago, might be interesting try to ricompile the kernel patching it for the network driver issue (scroll back the thread and you'll see) while I still cannot get the sound working properly despite I didn't try yet to load on mermory card the LIBSD.IRX and AUDIOSRV.IRX files as deba5er stated.
Bye.
DAYAK
Posts: 9
Joined: Mon Mar 02, 2009 2:21 am

Post by DAYAK »

Hi rgrisem,

Can you please give me some information about how did your slim ps2 show that usb sticks partitions?

Did it appear as SCSI or SDA or TTYUSB0 like mine?

And how did you mount them?

If you can give me information a little bit I think that is the only place I stuck...

thx...
DAYAK
Posts: 9
Joined: Mon Mar 02, 2009 2:21 am

Post by DAYAK »

And about to write a howto for pstwo linux. I think a user should need these:

1) Which version of kernel loader?
2) Which kernel?
3) Configuration file for the working modules.
4) Which init image?
5) mounting the drives
6) and workaround for network, audio etc.

If anybody can start such a document I would be happy to put some input if I can...
mazxim
Posts: 23
Joined: Thu Jan 24, 2008 12:29 am
Contact:

Post by mazxim »

Scroll back the thread, I wrote such a step by step prescription that work for me (PSTwo scph-77004)

For the network problems there are some guys here (davideciarm, bee7, whig) that are trying to do something. Bye..
rgrimes
Posts: 5
Joined: Wed Mar 04, 2009 12:55 am

Post by rgrimes »

mazxim wrote:
rgrimes wrote:Some cheating was done as I also have a fat ps2 scph-30001r, but I think all the bits can be put togeather so that someone with a way to run ulaunchelf should be able to get blackrhino running on there PS2 slim.
Nothing new, rgrimes. We actually knew that blackrhino can work on PSTwo through only USB. Many others have posted some couple of kernel/initrd that work with the last Mega Man's kernel loader release. As deba5er pointed out some post ago, might be interesting try to ricompile the kernel patching it for the network driver issue (scroll back the thread and you'll see) while I still cannot get the sound working properly despite I didn't try yet to load on mermory card the LIBSD.IRX and AUDIOSRV.IRX files as deba5er stated.
Bye.
I have seen no one post that they have blackrhino in multiuser mode running on a Flash drive on the PS2/slim. I have seen people on a hard drive. I have also seen all the boots using initrd and pivot root. I am not doing that. I am natively booting to /dev/sda2 which is part 2 ex2fs of a 3 part usb stick.
rgrimes
Posts: 5
Joined: Wed Mar 04, 2009 12:55 am

Post by rgrimes »

mazxim wrote:For the network problems there are some guys here (davideciarm, bee7, whig) that are trying to do something. Bye..
I have seen those threads and started down that path when I found the real reason that the linux driver says 'No Ethernet Hardware' is cause the kernelloader is telling it that. And that is the only way that message ever gets printed. This is not a PHY or linux driver issue at this time, but an issue with kerneloader/loader/loader.c, spicifically this piece of code that calls dev9_init and if that returns success tells the kernel you have harddisk and network hardware:

Code: Select all

                        if (ps2dev9_init() == 0) {
                                const char *pcicType;

                                /* Activate hard disc. */
                                ata_setup();

                                /* Tell Linux to activate HDD and Network. */
                                bootinfo->pccard_type = 0x0100;

I'll repeat my comment again, the failure of the ethernet device on a PS2/slim is in the kernelloader, not the linux kernel.
rgrimes
Posts: 5
Joined: Wed Mar 04, 2009 12:55 am

Post by rgrimes »

DAYAK wrote:Hi rgrisem,
Can you please give me some information about how did your slim ps2 show that usb sticks partitions?
Did it appear as SCSI or SDA or TTYUSB0 like mine?
And how did you mount them?
If you can give me information a little bit I think that is the only place I stuck...
thx...
You wont be able to do it with the kernels on here. I have built my own. My usb partitions show up as /dev/sda1 (dos) /dev/sda2 (ex2fs) and /dev/sd3 (linux swap). BUT that is cause I have all the drivers statically linked into my kernel without a devfs and am not running an initrd image. Now if I had linked in devfs with my kernel they would be different.
From reading your other posts I think you have an issue with your kernelloader config.txt file. Be -sure- that your using host:TGE/intrelay-direct-rpc.irx=1, the other intrelay modules dont work on a PSTwo.
I think your gona be best off using the devfs version of the kernel as iirc the initrd image on here doesn't have any scsi disk nodes in it for access to your usb partitions. If you use devfs your disk should come up as /dev/scsi/host0/bus0/target0/lun0/disc and part1 part2 part3
DAYAK
Posts: 9
Joined: Mon Mar 02, 2009 2:21 am

Post by DAYAK »

hi again mazxim

First, thank you mazxim your idea is nearly working. I really really thought I read every post on this topic but obviously I missed the most important one for me.

Only problem is this;

I have created similar partitions on a 4GB SanDisk cruzer.

500mb FAT16
256 MB SWAP
Rest is 3GB EX2fs

I did what you said and put things into drive.

I am booting it and getting into ramdisk quite well. USB is recognized and I can mount FAT16 drive without any problem.

But when I write

Code: Select all

mount /dev/sda3 /newroot (or with -t ext2)
I get this

Code: Select all

EXT2-fs unsupported inode size 256
So I get back to my Ubuntu but I cannot find a way to change inode size in "Partition Editor".

I search in google to see if I can find some info on inode size ; if it is the -b option at FDISK. Honestly I could not find much.

so I wanted to give it a try to

Code: Select all

fdisk -b 2048 /dev/sdc3
This does change the partition but than Ubuntu does not see it.

What is a inode size? and what is the value for ps2linux? Is it 1024???

rgrisem : Thanks for your replies, I did not ignore it I just wanted to try the methods one-by-one.
whig
Posts: 34
Joined: Sun Jan 04, 2009 5:52 am

Post by whig »

Dayak, try creating the partition - mke2fs - on the ps2 itself. The old 2.4.17 kernel doesn't seem to accept ext2 partitions created by recent software I have installed.
DAYAK
Posts: 9
Joined: Mon Mar 02, 2009 2:21 am

Post by DAYAK »

hi whig,

I have tried these

mke2fs /dev/sda3

mke2fs -i 1024 /dev/sda3

first one does till 2/25 and crash the system second one crashes the system instantly.

maybe I need to find a system with old kernel to do this !

I had some old USB linux, maybe one of them is old enough...

------------------------------------
EDIT: There is a stupid workaround I found. If each step like 1/25 or 2/25 mke2fs (v1.27) crashes the system. If you reboot and start all over again, you go one step further. So I did 25 times + 1 for table to be written = 26 reboots...

and yes now I can see the drive, mount and use :P

there must be an option in mke2fs, either under new Ubuntu to make the filesystem based on version 1.27 or maybe there is a FORCE switch to continue in ps2linux.

devil is hidden in the detail :)
DAYAK
Posts: 9
Joined: Mon Mar 02, 2009 2:21 am

Post by DAYAK »

OK. I made it by using reiserfs for the linux directory.

Everything worked and I pivot the root and login.

it is giving me a msg that "/" is now rw I should do "mount -n -o remount,rw /" but this gives an error that options are wrong.

Anybody knows what is it?
mazxim
Posts: 23
Joined: Thu Jan 24, 2008 12:29 am
Contact:

Post by mazxim »

Hello DAYAK.

I'm not sure about reiserfs but the right command to use ext2 should be:

mkfs.ext2 -I 128 -O none /dev/sda3

I didn't realize before the compatibility issues 'cause I was using a windows partition program that made the job without any problems. Remember that you have to preserve all the original rights on the files that you uncompress on your USB root.

Bye
mazxim
Posts: 23
Joined: Thu Jan 24, 2008 12:29 am
Contact:

Post by mazxim »

Well, I tried to load libsd.irx and audsrv.irx on memory card to get sound support, change the config.txt and see what happen. Nothing, the system boot up normally but xmms tell me that sound card is not configured. I tried libsd.irx + dmarelay.irx, despite deba5er warned us about the compatibility problems with PSTwo. Nothing, the system go on as above without sound. So what we need to activate sound on PSTwo?

Anyway, linux with USB 1.1 on PSTwo is terrible. It's simply too slow and someway "ugly", in my opinion. Might be better concentrate the efforts on porting some other OS - the best candidate to me is AROS - perhaps less memory hungry and a lot more user friendly but it is just a dream right now. Then try to hack the PSTwo to use such an ide to compact flash interface, avoiding completely usb 1.1 because it's nearly useless in this condition. Time will tell us what could be done :-)
DAYAK
Posts: 9
Joined: Mon Mar 02, 2009 2:21 am

Post by DAYAK »

mazxim wrote:Hello DAYAK.

I'm not sure about reiserfs but the right command to use ext2 should be:

mkfs.ext2 -I 128 -O none /dev/sda3

I didn't realize before the compatibility issues 'cause I was using a windows partition program that made the job without any problems. Remember that you have to preserve all the original rights on the files that you uncompress on your USB root.

Bye
reiserfs is mounting with no problem but that file system is giving me headaches...

I need to find a way to format this USB linux partition as ext2. when I boot I cannot do that as I said it crashes.

If I do on my ubuntu there is a ext type mismatch.

I am stuck with this.

Meanwhile I managed to boot KLOADER in PAL but even if I change the settings I cannot boot linux PAL, it goes back to NTSC. I see the linux boot screen in color for 1 second and than jumps back to NTSC.

I tried at least boot the X with

Code: Select all

X :0 -screen 0 inter -auth ~/.Xauthority -once -terminate -nolisten tcp
and that does not have inter. Isn't it INTER is one to use here for PAL?

there was a file these NTSC and inter information is written maybe there is something missing there...

I am so close, I cannot get there...sad

EDIT
-----------------
deba5er wrote nearly 1 year ago that it is

Code: Select all

X :0 -screen 0 PAL,inter
With which part of my body I read this forum before? (self criticism)
Mega Man
Posts: 260
Joined: Sat Jun 18, 2005 3:14 am
Contact:

Post by Mega Man »

rgrimes wrote: ... I found the real reason that the linux driver says 'No Ethernet Hardware' is cause the kernelloader is telling it that. And that is the only way that message ever gets printed. This is not a PHY or linux driver issue at this time, but an issue with kerneloader/loader/loader.c, spicifically this piece of code that calls dev9_init and if that returns success tells the kernel you have harddisk and network hardware:

Code: Select all

                        if (ps2dev9_init() == 0) {
                                const char *pcicType;

                                /* Activate hard disc. */
                                ata_setup();

                                /* Tell Linux to activate HDD and Network. */
                                bootinfo->pccard_type = 0x0100;

I'll repeat my comment again, the failure of the ethernet device on a PS2/slim is in the kernelloader, not the linux kernel.
The code above is executed on the EE, but it should be executed on the IOP. This caused some problems. In the past I had problems to get the HDD/network adapter working with the fat PS2. As far as I remember it was failing at the same point, when I didn't load the ps2sdk modules.
I think you need first to check which modules are working on the slim PSTwo (e.g. by finding homebrew which is working). Some homebrew programs changed the ps2sdk code. I used the code from the svn repository.
soren121
Posts: 2
Joined: Tue May 26, 2009 4:37 am

Post by soren121 »

I have a quick question. I have a new slim PS2 (SCPH-90000 series) and want to use Linux on it. Is it possible? Also, if it's possible, can I use the currently-sold Action Replay MAX to launch the bootloader? I don't want to spend $25 just to find out it doesn't work. Thanks!
Post Reply