Loading an ELF file above 0x80000000

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

Moderators: cheriff, Herben

Post Reply
baggacfreak
Posts: 23
Joined: Sun Mar 02, 2008 8:28 pm

Post by baggacfreak »

I did not managed to get my usb keyboard to work in the kernelloader menu but afterwards everything worked out fine. I edited the kernel parameter on my pc just store the config in kernelloader and copy the txt file to your usb stick (I used ulancher)

@megaman
is it posible to get a gui? do I have to connect to the internet and download the newest moduls from the blackrhino disto servers?

What about APA support? I read on the ps2linux hp that you have to have special modules load first? (ps2dev9.irx and ps2atad.irx as meantioned in the libhdd_ref.pdf on http://playstation2-linux.com/projects/apa/)
Memor32 Boot Elf from MCC with Mod Chip no soldering! http://memorgs.gulli.to/
deba5er
Posts: 166
Joined: Mon Feb 04, 2008 2:01 pm

APA works for me

Post by deba5er »

REMEMBER to backup your APA partitions with Winhiip or the like first! Play with partitioning at your own risk!

I installed BlackRhino from scratch using Mega Man's instructions, the kernel and initrd.gz from his download site, on a drive which already was formatted APA with many partitions (in fact, mostly full 80GB drive). The only difference from the instructions was that I copied the "ps2fdisk" program version 0.9-3 to mc0:/BWLINUX directory using ULaunchelf first. Instead of using "fdisk" to partition per Mega Man's instructions, mount the memory card and run ps2fdisk instead. The ps2fdisk program will recognize the existing partitions and work fine. You can continue with the rest of the instructions with no further change. Here is the link to ps2fdisk - http://playstation2-linux.com/projects/apa/

Since I have my original PS2 Linux configured the way I like, I also mounted a second large partition and created a tar.gz of everything in my Linux partition as a backup. I then used kernelloader boot to build another partition and install my original (non-BlackRhino) Linux. I use the same swap partition for both. This was used to be able to move the original Linux to another hard drive and to backup all my hard configuration work to get it running quickly in a small memory model for web browsing, music (not under kernelloader for music), and xmame. I then can boot to either original PS2 Linux or the BlackRhino version all from Mega Man's kernelloader, which is great if you have the disk space and need to test both distributions.
baggacfreak
Posts: 23
Joined: Sun Mar 02, 2008 8:28 pm

Re: APA works for me

Post by baggacfreak »

deba5er wrote:REMEMBER to backup your APA partitions with Winhiip or the like first! Play with partitioning at your own risk!

I installed BlackRhino from scratch using Mega Man's instructions, the kernel and initrd.gz from his download site, on a drive which already was formatted APA with many partitions (in fact, mostly full 80GB drive). The only difference from the instructions was that I copied the "ps2fdisk" program version 0.9-3 to mc0:/BWLINUX directory using ULaunchelf first. Instead of using "fdisk" to partition per Mega Man's instructions, mount the memory card and run ps2fdisk instead. The ps2fdisk program will recognize the existing partitions and work fine. You can continue with the rest of the instructions with no further change. Here is the link to ps2fdisk - http://playstation2-linux.com/projects/apa/

Since I have my original PS2 Linux configured the way I like, I also mounted a second large partition and created a tar.gz of everything in my Linux partition as a backup. I then used kernelloader boot to build another partition and install my original (non-BlackRhino) Linux. I use the same swap partition for both. This was used to be able to move the original Linux to another hard drive and to backup all my hard configuration work to get it running quickly in a small memory model for web browsing, music (not under kernelloader for music), and xmame. I then can boot to either original PS2 Linux or the BlackRhino version all from Mega Man's kernelloader, which is great if you have the disk space and need to test both distributions.
Ok. I think the only thing that changes is that you don't have to delete all partitions and use the apa fdisk tool. As I am using a new hdd instead of my old one no data loss will harm me anyway. Is there a gui for blackrhino on their deb server? I will try to set up network if dhcp is not working and update my system first. If update and gui work fine I will give the apa installation a try. What apps like samba are great to be used on the ps2? Can I remotecontroll my windows/linux pc via vnc?
Memor32 Boot Elf from MCC with Mod Chip no soldering! http://memorgs.gulli.to/
deba5er
Posts: 166
Joined: Mon Feb 04, 2008 2:01 pm

Re: APA works for me

Post by deba5er »

baggacfreak wrote:Ok. I think the only thing that changes is that you don't have to delete all partitions and use the apa fdisk tool. As I am using a new hdd instead of my old one no data loss will harm me anyway. Is there a gui for blackrhino on their deb server? I will try to set up network if dhcp is not working and update my system first. If update and gui work fine I will give the apa installation a try. What apps like samba are great to be used on the ps2? Can I remotecontroll my windows/linux pc via vnc?
I recommend formatting as APA first with HDLoader or another APA formatting tool (ULaunchelf's HDD Manager also can format), then loading BlackRhino using ps2fdisk in place of fdisk if you intend to use the hdd for both APA purposes and BlackRhino. It doesn't take much more time, and you can verify that both co-exist fine before you invest much time with either partition type.

Xfree X-Windows system comes with the standard "dselect" installation. I like to use the wmaker as my window manager, but you have several choices. You can look on the BlackRhino how-to guide for your initial network configuration - http://blackrhino.xrhino.com/main.php?page=howto
You can look on http://playstation2-linux.com/softwarem ... e=354#ttop
for other projects, tools, etc.

I recommend using the dillo web browser instead of Firefox because it uses much less memory, although I also load and use Firefox when dillo doesn't work on a particular webpage. I smbmount my Windows XP shared drive to my PS2. If you don't like the available pre-compiled apps, you can compile your own. I'm not a programmer but I got a hackish xmame v106 compile to work for some games, so don't be afraid to try.
baggacfreak
Posts: 23
Joined: Sun Mar 02, 2008 8:28 pm

Post by baggacfreak »

Hi,

yesterday I finally got my network set up and dselect all the updates I could get (90MB turn into about 300MB), but sdr or startx are not recognized as commands in linux?!? Is there a different methode to start X on blackrhino linux? Hopefully I can find out this evening. Afterwards I will pack the whole linux and try the apa fdisk way. Is there a working icq client for ps2linux out like gaim?!?

CU!

Just forgot why do I get a error concerning lib* when I try to start vi after the megaman howto installation without the update?
Memor32 Boot Elf from MCC with Mod Chip no soldering! http://memorgs.gulli.to/
deba5er
Posts: 166
Joined: Mon Feb 04, 2008 2:01 pm

Post by deba5er »

baggacfreak wrote:Hi,

yesterday I finally got my network set up and dselect all the updates I could get (90MB turn into about 300MB), but sdr or startx are not recognized as commands in linux?!? Is there a different methode to start X on blackrhino linux? Hopefully I can find out this evening. Afterwards I will pack the whole linux and try the apa fdisk way. Is there a working icq client for ps2linux out like gaim?!?

CU!

Just forgot why do I get a error concerning lib* when I try to start vi after the megaman howto installation without the update?
ls -l /usr/X11R6/bin/startx
If startx is there then you have to add /usr/X11R6/bin to the PATH variable. I use a script to run startx from the prompt $ like so:

". win"
where win is a script
". startx -- -screen 0 NTSC,inter"

If you are PAL, ". startx -- -screen 0 PAL,inter"

I use the "." alot in PS2-Linux because I don't like to nest shells at 1MB a pop in a very limited PS2 RAM (32MB, but less in reality).

Getting X-Windows working in BlackRhino was frustrating for me too. I had to modify /etc/X11/XGSConfig per instructions on playstation2-linux.com (you should search for solutions there, most of this has been answered in the forums there). You have to mknod a "mice" driver, setup for scroll-mouse if you have one, then refer to this device in /etc/X11/XGSConfig.

gaim 0.59.9 (old) precompiled for PS2-Linux is available here:
http://playstation2-linux.com/softwarem ... e=354#ttop

I don't remember encountering your "vi" error upon first starting, but then again, I didn't write down everything I did. I'm familiar enough with Linux in general that if I did encounter it, I would have fudged through it with the cat command or somesuch. I'm starting to regret not writing down a step-by-step during my scratch install in my haste to test kernelloader with APA. If more people encounter big hurdles in getting started with basic PS2-Linux, it might be worthwhile to create a new post on http://psx-scene.com/forums/ps2-general-discussion/
I frequent the place quite often, and I'd hate to see Mega Man's post hijacked (Mega Man - let me know if this is too off topic and I will move this stuff to psx-scene).
baggacfreak
Posts: 23
Joined: Sun Mar 02, 2008 8:28 pm

Post by baggacfreak »

I just updated the main system things as I found out, but now I have another problem. I finally selected all packages and downloaded 1009 packages. Perl and 5 other could not be downloaded via the server. That is way I am now stuck. I can not install the downloaded packages because I get an error. What do I have to type in to install all downloaded packages without the missing ones? apt-get --fix-missing was meantioned as a hint, but I got errors typing this in command prompt?!?

Anyway tomorrow I will give the apa ps2fdisk way a try. Tested if ps2fdisk would work, but after cp ps2fdisk and gzip -d it it turned out that I am not able to run the file?!? What did I do wrong? I got the *.gz from playstation2-linux.com as mentioned above!
Memor32 Boot Elf from MCC with Mod Chip no soldering! http://memorgs.gulli.to/
deba5er
Posts: 166
Joined: Mon Feb 04, 2008 2:01 pm

Post by deba5er »

baggacfreak wrote:Anyway tomorrow I will give the apa ps2fdisk way a try. Tested if ps2fdisk would work, but after cp ps2fdisk and gzip -d it it turned out that I am not able to run the file?!? What did I do wrong? I got the *.gz from playstation2-linux.com as mentioned above!
I don't know how to help you with dselect (your Perl pkg issue) as I'm not that good with package maintenance under BlackRhino (dselect command). However, I did re-download the ps2fdisk_0.9-3.gz from the link, ran "gzip -d ps2fdisk_0.9-3.gz", then ./ps2fdisk_0.9-3 and it worked fine on my system. Are you running it from the initrd.gz or from the installation on the hard drive? What error(s) did you get?
baggacfreak
Posts: 23
Joined: Sun Mar 02, 2008 8:28 pm

Post by baggacfreak »

Hi,

yesterday I give it another try and cp the file to /sbin finnally everything worked fine. Updated about 900 packages and startx could be found. Except for the config file which is missing everything looks fine. Today I will copy the xgsconfig file to the system and try to set up xwindow. It takes a lot of time but I will hopefully get everything set up soon and afterwards will make a small howto. Another question I've got is whether the gamepade is supported as a mouse input device within the xwindow system?!? Some years ago I had a try on linux on the sega dreamcast and there I could use the pad and a keyboard to run the system.

CU!
Memor32 Boot Elf from MCC with Mod Chip no soldering! http://memorgs.gulli.to/
kaiomatico
Posts: 8
Joined: Sat Mar 22, 2008 9:26 pm
Contact:

Post by kaiomatico »

any 1 got a idea why my usb keyboard won't let me type in anything into the prompt? I tried nearly every kernel and initrd (the apa , the blackrhino and the 1 provided on mega man's website) ... but it is still not working...

is it maybe because i also load up the BOOT.ELF from my usb stick and the kernel and initrd.gz,too ,so that he cannot run so many usb devices?

thx
Mega Man
Posts: 260
Joined: Sat Jun 18, 2005 3:14 am
Contact:

Post by Mega Man »

kaiomatico wrote:any 1 got a idea why my usb keyboard won't let me type in anything into the prompt?
I thought you meant that you can't type within Kernelloader. Kernelloader doesn't support all keyboards, but Linux should support all keyboards. Did you tried to connect the keyboard at a different time (before Linux starts or after Linux is completely loaded)? Does it work within Kernelloader?
baggacfreak
Posts: 23
Joined: Sun Mar 02, 2008 8:28 pm

Post by baggacfreak »

I had problems within kernelloader 1.7, too. Changed the config file on my pc to boot from hda2. Did you try to plug your keyboard on different ports?!? Got no problem with my microsoft usb keyboard so far.

@megaman. Perhaps it is a good idea to let us select different config files within the kernelloader. Including ps2fdisk with apa support would be cool to!

Is it possible to use a ps2 -> usb adpater?
Image
Memor32 Boot Elf from MCC with Mod Chip no soldering! http://memorgs.gulli.to/
cosmito
Posts: 307
Joined: Sun Mar 04, 2007 4:26 am
Location: Portugal
Contact:

Post by cosmito »

baggacfreak wrote:Is it possible to use a ps2 -> usb adpater?
Yes I already tried one (not this model).
baggacfreak
Posts: 23
Joined: Sun Mar 02, 2008 8:28 pm

xwindow usbmouse problem and gamepad as mouse device?

Post by baggacfreak »

So finally I saw a xwindow yesterday! But my mouse was not recognized lol I found out that in XGSConfig the mouse links to /dev/usbmouse but I could only find mouse in /dev/ so I made a symbolic link and that at least helped to start xwindow. So I will have to find a way to set up my mouse or better solution would be to get the gamepad to be the mouse device. Are there any howtos on this topic available?
Memor32 Boot Elf from MCC with Mod Chip no soldering! http://memorgs.gulli.to/
deba5er
Posts: 166
Joined: Mon Feb 04, 2008 2:01 pm

Re: xwindow usbmouse problem and gamepad as mouse device?

Post by deba5er »

baggacfreak wrote:So finally I saw a xwindow yesterday! But my mouse was not recognized lol I found out that in XGSConfig the mouse links to /dev/usbmouse but I could only find mouse in /dev/ so I made a symbolic link and that at least helped to start xwindow. So I will have to find a way to set up my mouse or better solution would be to get the gamepad to be the mouse device. Are there any howtos on this topic available?
From previous post: I had to modify /etc/X11/XGSConfig per instructions on playstation2-linux.com (you should search for solutions there, most of this has been answered in the forums there). You have to mknod a "mice" driver, setup for scroll-mouse if you have one, then refer to this device in /etc/X11/XGSConfig. Here is an incredibly useful link which shows you how to do the mouse setup, X-Windows config, and ps2fdisk:
http://playstation2-linux.com/download/ ... 1-xr7.html
aeon
Posts: 3
Joined: Wed Mar 12, 2008 10:54 pm

News?

Post by aeon »

Megaman, is there any news about USB and CD/DVD with PS2Slim?
Can I help with something?

I have a PS2Slim 79001 moded.
Last edited by aeon on Sat Apr 12, 2008 12:17 am, edited 1 time in total.
Mega Man
Posts: 260
Joined: Sat Jun 18, 2005 3:14 am
Contact:

Re: News?

Post by Mega Man »

aeon wrote:Megaman, is there any news about USB and CD/DVD with PS2Slim?
Can I help with somenthing?

I have a PS2Slim 79001 moded.
Currently I have less time to work on it.

USB:
Problem: Interrupts are not reported to the EE. I think that the interrupt registers have changed.
Possible workaround: Use RPC command instead of an interrupt. A RPC command leads to an interrupt which is working. This is incompatible to RTE, but it should work. Linux kernel need to be changed also.

CDVD:
Linux: CDVD driver should work with slim PSTwo.
Problem: It is not possible to read Video DVDs. I can't read a Video DVD, even when I use the SMSCDVD module. There is same trick. I used the following IOP program for testing. When I read something, success is reported by nothing is read. We need to find the person who added DVD support in SMSCDVD.

Code: Select all

#include <tamtypes.h>
#include <thbase.h>
#include <thsemap.h>
#include <sifrpc.h>
#include <ioman.h>

#include <stdint.h>

#include "irx_imports.h"

#define TRUE	1
#define FALSE	0

static cd_read_mode_t s_CDReadMode;
static unsigned char buffer&#91;4096&#93;;
static u32 traycount;

int _start&#40;int argc, char *argv&#91;&#93;&#41;
&#123;
	int rv;
	int ret;
	int sector;
	int i;

	s_CDReadMode.trycount = 0;
	s_CDReadMode.spindlctrl = CdSpinStm;
	s_CDReadMode.datapattern = CdSecS2048;
	//s_CDReadMode.datapattern = CdSecS2328; // CDDA + CdReadCdda
	//s_CDReadMode.datapattern = CdSecS2340;
	s_CDReadMode.pad = 0;

	for &#40;i = 0; i < sizeof&#40;buffer&#41;; i++&#41; &#123;
		buffer&#91;i&#93; = 0x88;
	&#125;

#if 0
	ret = LoadStartModule&#40;"rom0&#58;XCDVDMAN", 0, NULL, &rv&#41;;
	printf&#40;"ret %d rv %d\n", ret, rv&#41;;
#endif

	/* Init */
	CdInit&#40;0&#41;;
#if 0
	CdTrayReq&#40;0, &traycount&#41;;
	DelayThread&#40;3000000&#41;;
	CdTrayReq&#40;1, &traycount&#41;;
#endif
	printf&#40;"ready %d\n", CdDiskReady&#40;0&#41;&#41;;
	printf&#40;"Disc type %d\n", CdGetDiskType&#40;&#41;&#41;;
	//CdMmode&#40;CdMmodeCd&#41;;
	//CdMmode&#40;CdMmodeDvd&#41;;
	sector = 16;
	if &#40;CdRead&#40;sector, 1, buffer, &s_CDReadMode&#41; != TRUE&#41; &#123;
	//if &#40;CdReadCdda&#40;sector, 1, buffer, &s_CDReadMode&#41; != TRUE&#41; &#123;
	//if &#40;sceCdReadDVDV&#40;sector, 1, buffer, &s_CDReadMode&#41; != TRUE&#41; &#123;
		printf&#40;"Reading of sector %d failed\n", sector&#41;;
	&#125; else &#123;
		printf&#40;"Reading of sector %d ok\n", sector&#41;;
		if &#40;CdSync&#40;0&#41; == 0&#41; &#123;
				for &#40;i = 0; i < 64; i++&#41; &#123;
					printf&#40;"%02x ", buffer&#91;i&#93;&#41;;
					if &#40;&#40;i & 0x0f&#41; == 15&#41; &#123;
						printf&#40;"\n"&#41;;
					&#125;
				&#125;
		&#125; else &#123;
			printf&#40;"Failed reading sector %d\n", sector&#41;;
		&#125;
	&#125;						/* end else */
	CdStop&#40;&#41;;
	CdSync&#40;0&#41;;
	CdInit&#40;5&#41;;

	return 0;
&#125;
cosmito
Posts: 307
Joined: Sun Mar 04, 2007 4:26 am
Location: Portugal
Contact:

Post by cosmito »

Mega Man wrote:We need to find the person who added DVD support in SMSCDVD.
Have you tried to ask Eugene Plotnikov, the SMS author? He's EEUG on these forums.
devilinside128
Posts: 18
Joined: Sat Mar 29, 2008 11:56 pm

Post by devilinside128 »

Hello, as I install linux on my ps2 v 12. Using as hard disk in a usb memory, run with Kernelloade 1.7.
EEUG
Posts: 136
Joined: Fri May 13, 2005 4:49 am
Location: The Netherlands

Post by EEUG »

...this is actually the answer to MegaMan's private question about DVD Video disks. First of all load EROMDRV module from rom1 to activate something that enables DVD video disks to be read (there's another method to do that but I will not disclose it as it is currently used in my "Plan "B"" loader which I hope will be released some day). Then load CDVD driver from SMS (its source is in SVN and it is up-to-date) and establish RPC connection to it (EE's RPC code for it is inside SMS_CDVD.c file which is also up-to-date). Then you can determine type of the disk inserted using 'cdGetDiscType' RPC call from ps2sdk's 'libcdvd'. If the type is CDVD_TYPE_DVDVIDEO (0xFE) then perform 'CDVD_SetDVDV ( 1 )' call (see SMS source code for details). This call activates UDF filesystem driver. Then you can use standard I/O services like 'fioXXX' or 'fileXioXXX' to access your data. Device name is 'cdfs' (like in the original libcdvd_1.15). Good luck...
Mega Man
Posts: 260
Joined: Sat Jun 18, 2005 3:14 am
Contact:

Post by Mega Man »

I setup a project page at sourceforge:

http://sourceforge.net/projects/kernelloader/

The files are automatically mirrored. So there will be no download problems in future.

I got video DVDs working with kernelloader, but I will need some time for the next release. Here is the code for everybody who is interested in:

Code: Select all

int LoadStartModuleExt&#40;const char *name, int arglen, const char *args, int *result&#41;;
#define I_LoadStartModuleExt DECLARE_IMPORT&#40;11, LoadStartModuleExt&#41;

LoadStartModule&#40;"rom0&#58;ADDDRV", 0, NULL, &rv&#41;;
LoadStartModuleExt&#40;"rom1&#58;EROMDRV", 0, NULL, &rv&#41;;

sceCdReadDVDV&#40;sector, 1, buffer, &s_CDReadMode&#41;;
Mega Man
Posts: 260
Joined: Sat Jun 18, 2005 3:14 am
Contact:

Post by Mega Man »

I've uploaded Kernelloader 1.8.

- Kernelloader can now read CDs, DVDs and burned video DVDs.
- Compressed ELF files are supported (gzip).
- ELF files are checked for completeness before start.
- Configuration file is automatically loaded from DVD (cdfs:config.txt), if no configuration was found on MC0.

Linux can't read burned video DVDs. Video DVD support is activated, but Linux driver doesn't use it.

https://sourceforge.net/project/showfil ... _id=223793

Can someone capture a video which I can put on Linux example DVD? I don't have a good video capture card. I was thinking of the Kernelloader start sequence and the Linux boot or an Linux installation example video. My idea was to put this video on the PS2 Linux DVD, which I will deliver later.
gagaeloel
Posts: 1
Joined: Tue Apr 22, 2008 12:02 am
Contact:

Post by gagaeloel »

Hi!
Congratulations on the kernel loader.
I can not even try because i don't ps2 where I am now, but is a major breakthrough.

I have my blackrhino installed with graphic environment (wmaker), I have uploaded here:
Http://dodownload.filefront.com/1003893 ... a1ce6ec5eb

I think that can facilitate things fairly, as the normal installation takes a long time (download with dselect, then configure ... :S)

I think the only thing that changes in your tutorial is:

14 tar -xvpf / usb/ps2linux/brgagaeloel.tar

Perdon if I explain evil, I am using the Spanish translator google ... Lol
Greetings! And thank you for your kernelloader!
ragnarok2040
Posts: 202
Joined: Wed Aug 09, 2006 1:00 am

Post by ragnarok2040 »

Posting this from my ps2, :D, I saw that you wanted to know which models of the ps2 on which kernelloader worked, and I can add that a v6 PS2 with bios version 30001 R works fine with kernelloader.
kaiomatico
Posts: 8
Joined: Sat Mar 22, 2008 9:26 pm
Contact:

Post by kaiomatico »

My USB keyboard is working now with the kernel!!!! thanx mega man! it was because my current keyboard needed too much energy...so i tried one without light from my iMac and it worked just fine :) thxxx
Mega Man
Posts: 260
Joined: Sat Jun 18, 2005 3:14 am
Contact:

Post by Mega Man »

I changed the IRQ interface from SMFLAG to SIF command 0x20. This change is only for slim PSTwo. Use on other consoles is not recommended. Can someone test if USB is working on the slim PSTwo.

Every interrupt is printed with printk in kernel. You can see this with Linux command "dmesg".

Testversion of kernelloader only for slim PSTwo:
http://rapidshare.com/files/112377238/kloader.elf.html

Testversion of Linux kernel only for slim PSTwo.
http://rapidshare.com/files/112377834/vmlinux.gz.html

When this is not working. Please try also to disable hard disc and network.
ps2link modules should be disabled and the following module should be selected:
host:TGE/intrelay-direct.irx
citronalco
Posts: 15
Joined: Sat Apr 19, 2008 7:47 pm

Post by citronalco »

Did a quick test on my V15, and: It works!
I can boot, initrd starts, usb keyboard is working! Great work Mega Man!!!!

I used kernel loader's default config, but had to disable ADDRV to avoid the kernel loader to hang when "Loading Modules". It even works with network and hd support turned on. But there's an error when starting kernel loader saying ervomdrvloader.irx is missing.

Tried to do an "ifconfig eth0" which complained about the missing eth0 device. Also /dev/sda (which should be the USB memstick?) is not in /dev.

Again: Great work!

Anything else I should try?
belek666
Posts: 19
Joined: Mon Apr 14, 2008 12:54 am

Post by belek666 »

I have a problem with kernelloader. I try instal Linux on my fat ps2 using pendrive but kernelloader don't recognaise mass and freeze. Can someone change usb driver in kernelloader on latest? My pendrive is working in ulaunchelf 4.12.
Mega Man
Posts: 260
Joined: Sat Jun 18, 2005 3:14 am
Contact:

Post by Mega Man »

citronalco wrote: Did a quick test on my V15, and: It works!
I can boot, initrd starts, usb keyboard is working! Great work Mega Man!!!!
Now I know that my assumption was correct, that the IOP can't signal interrupts to EE using SMFLAGS.
citronalco wrote: I used kernel loader's default config, but had to disable ADDRV to avoid the kernel loader to hang when "Loading Modules".
This module is required to get access to rom1 (for video DVD support). So it is not really required.
citronalco wrote: It even works with network and hd support turned on. But there's an error when starting kernel loader saying ervomdrvloader.irx is missing.
This module loads rom1:EROMDRV which enables video DVD support. You have disabled it by not loading rom0:ADDDRV.
citronalco wrote: Tried to do an "ifconfig eth0" which complained about the missing eth0 device.
My assumption here was that the PHY chip is different. But I am not sure, because as far as I know the network is working using homebrew applications (based on ps2dev). There are network driver patches available on the official website for PS2 Linux. It is possible that this will work.
citronalco wrote: Also /dev/sda (which should be the USB memstick?) is not in /dev.
I don't include devfs, so you need to generate devices manually by:

cd /dev
mknod sda b 8 0
mknod sda1 b 8 1
citronalco wrote: Again: Great work!

Anything else I should try?
Can you make two ROM dumps of your PS2, because I need a list which files are in ROM0 and in ROM1. (ROM0 is at 0xbfc00000, ROM1 is at 0xbe000000, change in pukko.c required for ROM1, ps2bios_unpacker.exe also required). I want only to know which files can be loaded. It is very strange that there are problems with ADDDRV.

If someone want to try with an own kernel, here is the required patch (including initrd fix):

Code: Select all

--- linux-2.4.17_ps2.orig/arch/mips/kernel/irq.c	2002-03-04 11&#58;31&#58;35.000000000 +0100
+++ linux-2.4.17_ps2/arch/mips/kernel/irq.c	2008-05-06 22&#58;45&#58;32.000000000 +0200
@@ -363,6 +363,23 @@ out&#58;
 	return 1;
 &#125;
 
+void handleSimulatedIRQ&#40;int irq&#41;
+&#123;
+	struct irqaction * action;
+
+	if &#40;irq < NR_IRQS&#41; &#123;
+		irq_desc_t *desc = irq_desc + irq;
+
+		action = desc->action;
+
+		while &#40;action&#41; &#123;
+			action->handler&#40;irq, action->dev_id, NULL&#41;;
+			action = action->next;
+		&#125;
+	&#125;
+&#125;
+
+
 /**
  *	request_irq - allocate an interrupt line
  *	@irq&#58; Interrupt line to allocate
--- linux-2.4.17_ps2.orig/arch/mips/Makefile	2002-11-20 13&#58;14&#58;52.000000000 +0100
+++ linux-2.4.17_ps2/arch/mips/Makefile	2008-05-03 23&#58;10&#58;10.000000000 +0200
@@ -114,9 +114,11 @@ endif
 # arch/mips/ramdisk
 #
 ifdef CONFIG_BLK_DEV_INITRD 
+ifdef CONFIG_EMBEDDED_RAMDISK
 CORE_FILES      += arch/mips/ramdisk/ramdisk.o
 SUBDIRS		+= arch/mips/ramdisk
 endif
+endif
 
 
 GCCFLAGS	+= -pipe
--- linux-2.4.17_ps2.orig/arch/mips/ps2/sbcall.c	2002-04-12 12&#58;20&#58;16.000000000 +0200
+++ linux-2.4.17_ps2/arch/mips/ps2/sbcall.c	2008-05-06 22&#58;48&#58;52.000000000 +0200
@@ -42,6 +42,19 @@ EXPORT_SYMBOL&#40;ps2sif_getotherdata&#41;;
 EXPORT_SYMBOL&#40;ps2sif_removerpc&#41;;
 EXPORT_SYMBOL&#40;ps2sif_removerpcqueue&#41;;
 
+typedef struct t_SifCmdHeader
+&#123;
+	u32 size;
+	void *dest;
+	int cid;
+	u32 unknown;
+&#125; SifCmdHeader_t;
+
+typedef struct &#123;
+	struct t_SifCmdHeader    sifcmd;
+	char text&#91;80&#93;;
+&#125; iop_text_data_t;
+
 /*
  *  SIF DMA functions
  */
@@ -319,6 +332,21 @@ static void sif1_dma_handler&#40;int irq, vo
     spin_unlock&#40;&ps2sif_dma_lock&#41;;
 &#125;
 
+static uint32_t usrCmdHandler&#91;256&#93;;
+
+typedef struct &#123;
+	struct t_SifCmdHeader    sifcmd;
+	u32 data&#91;16&#93;;
+&#125; iop_sifCmdBufferIrq_t;
+
+void handleRPCIRQ&#40;iop_sifCmdBufferIrq_t *sifCmdBufferIrq, void *arg&#41;
+&#123;
+	extern void handleSimulatedIRQ&#40;int irq&#41;;
+
+	//printk&#40;"Received IRQ %d\n", data&#91;0&#93;&#41;;
+
+	handleSimulatedIRQ&#40;sifCmdBufferIrq->data&#91;0&#93;&#41;;
+&#125;
 
 /*
  *  Initialize
@@ -326,8 +354,17 @@ static void sif1_dma_handler&#40;int irq, vo
 
 int __init ps2sif_init&#40;void&#41;
 &#123;
+	struct sb_sifaddcmdhandler_arg addcmdhandlerparam;
+	struct sb_sifsetcmdbuffer_arg setcmdhandlerbufferparam;
     init_waitqueue_head&#40;&ps2sif_dma_waitq&#41;;
 
+    setcmdhandlerbufferparam.db = usrCmdHandler;
+    setcmdhandlerbufferparam.size = sizeof&#40;usrCmdHandler&#41; / 8;
+
+	addcmdhandlerparam.fid = 0x20;
+	addcmdhandlerparam.func = handleRPCIRQ;
+	addcmdhandlerparam.data = NULL;
+
     if &#40;sbios&#40;SB_SIFINIT, 0&#41; < 0&#41;
 	return -1;
     if &#40;sbios&#40;SB_SIFINITCMD, 0&#41; < 0&#41;
@@ -336,6 +373,13 @@ int __init ps2sif_init&#40;void&#41;
 	return -1;
     if &#40;request_irq&#40;IRQ_DMAC_6, sif1_dma_handler, SA_INTERRUPT, "SIF1 DMA", NULL&#41;&#41;
 	return -1;
+	if &#40;sbios&#40;SB_SIFSETCMDBUFFER, &setcmdhandlerbufferparam&#41; < 0&#41; &#123;
+		printk&#40;"Failed to initialize SIF IRQ handler &#40;1&#41;.\n"&#41;;
+	&#125; else &#123;
+		if &#40;sbios&#40;SB_SIFADDCMDHANDLER, &addcmdhandlerparam&#41; < 0&#41; &#123;
+			printk&#40;"Failed to initialize SIF IRQ handler.\n"&#41;;
+		&#125;
+	&#125;
     if &#40;sbios&#40;SB_SIFINITRPC, 0&#41; < 0&#41;
 	return -1;
 
Mega Man
Posts: 260
Joined: Sat Jun 18, 2005 3:14 am
Contact:

Post by Mega Man »

belek666 wrote:I have a problem with kernelloader. I try instal Linux on my fat ps2 using pendrive but kernelloader don't recognaise mass and freeze. Can someone change usb driver in kernelloader on latest? My pendrive is working in ulaunchelf 4.12.
I am not sure which is the best version to include. Could you do some research? I will include it in my next release.
Post Reply