What needs to be done to make TGE happen ?

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

Moderators: cheriff, Herben

Post Reply
Guest

What needs to be done to make TGE happen ?

Post by Guest »

Ok, I am considering being the sacrificial lamb to take up the TGE. But I am interested to know the current state of TGE and what needs to be done to get it usable.

Why my interest ?

1. My interest in PS2 dev is actually more at OS architecture level and its relationship to embedded systems development. TGE operates roughly at that level, so it coincides with my own interest.

2. I believe being able to run PS2Linux without purchasing a Linux kit will add more to the dev community. Most people can acquire the needed hardware on their own, and many likely already have it. All they need is the software component - the TGE RTE and Linux.

Sony has gone as far as it wants with PS2Linux, with not much interest in continued production. Although the hardware needed by the kit is now plentiful (with the exception of the VGA adaptor but that can be worked around), there seems to not be enough interested in a "disc" only release. Thus, anyone with a recent interest in PS2Linux where the kit is no longer available, or still available with a high price, is out of luck.

So with that in mind, I need advice on what the TGE needs to implement. Lets roll.
mrbrown
Site Admin
Posts: 1537
Joined: Sat Jan 17, 2004 11:24 am

Post by mrbrown »

In short:

- Every SBIOS call starting with #32 in tge_sbios.h (sceSifDmaStat() also needs to be completed).
- Bootloader that gets rid of the EE kernel and loads the SBIOS and target ELF into place and executes the ELF.
- Completion of dmarelay.irx.

The SBIOS calls should be straightforward, with a lot of them already supported in ps2sdk (they would need to be "ported" over). Of course, not all of them are required to get PS2 Linux to boot, the most important ones are the SIF, IOP heap, misc., and CDVD calls. Out of those, SetGsCrt() will be the most difficult.

Anyone with any skill in reversing modules should have no problem completing dmarelay.irx.

The bootloader is the biggest challenge. It has to "shutdown" the EE kernel, load the ELF (from wherever the bootloader supports loading), prepare boot parameters for the kernel, load the SBIOS into RAM, and execute the ELF. You can see my original ambitions for the bootloader in TGE's README. You could probably get away with just the memory card, since that's all Sony's RTE bootloader supports.

I think that's about all I can tell you without stepping over the line. If you have a copy of the BBN, I'd recommend you start there and not with the PS2 Linux Kit. I'd venture to say that if you got BBN features working in TGE, you'd have real Kit owners switching over to it!
"He was warned..."
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Lik-Sang has a monitor cable available here:
http://www.lik-sang.com/info.php?catego ... ts_id=2363&

It's not just usable with PS2 Linux, it's BETTER because it doesn't require sync on green monitors. I have one myself and it works well. It also allows a few games to run in high-res instead of lo-res, but that's not why I got it.

There's also a thread in the hardware section on making your own cable for people who prefer to do-it-yourself. :)
http://forums.ps2dev.org/viewtopic.php?t=278
cheriff
Regular
Posts: 258
Joined: Wed Jun 23, 2004 5:35 pm
Location: Sydney.au

Post by cheriff »

Apologies for off-topic-ness, but
Lik-Sang wrote:Compatible with JAP of the Playstation 2 only
...
For PlayStation 2™ / Japanese NTSC
Does that mean the included software (apparantly to boot games in hi-res mode) is jap only, or the cable it's self??
I'm not real interested in the gaming side, but i'd rather purchase this this than a SOG monitor when my linux kit arrives in a week or so (YAY!!!)
Or is there something of a similar quality to work on .au PAL models??
- ta, cheriff
Damn, I need a decent signature!
Guest

Post by Guest »

If this is the "blaze" device, that would be correct, you need the boot cd for your ps2 region to realize the full benefits of playing games in higher resolutions than they will normally play in. I do not think it is otherwise necessary if all you want is a VGA cable to use for things that can take advantage of it on their own.

I did try my handing at writing a hook into the SetGsCrt() bios system call to try to force normal NTSC games to play in 480P but with limited success. The problem I had was getting the GS registers correctly programmed, but otherwise the concept was promising.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

The one I linked was for the Japanese PS2 because they seem to have run out of the USA version. I was mostly concentrating on the cable for the purpose of the thread here - getting a PS2 monitor cable for Linux use.
zaphod
Posts: 53
Joined: Wed Jul 21, 2004 5:55 pm

Post by zaphod »

yes, for your purposes the caable will work fine. it's the same cable either way, the only difference is the boot CD.
someone
Idiot
Posts: 71
Joined: Tue Sep 13, 2005 9:03 pm

TGE Status

Post by someone »

Just curious, what is the status of TGE?
I would also like to help out, but unfortunately this sort of thing is beyond my skills.
Mega Man
Posts: 260
Joined: Sat Jun 18, 2005 3:14 am
Contact:

Post by Mega Man »

The status is:

- The bootloader is working. Linux can be started and is working.
- SBIOS is not finished, but can be used with linux.
- dmarelay is not finished.
- Working hardware: graphic.

I have the original ps2linux DVDs, but I don't have a working hard disc. My first DVD is scratched and have read errors.

When you want to help you can do:
1. Send me a memory dump of the hardware registers when RTE/linux is running (e.g. 0xBF801570 and 0xBF801680).
2. Find any hardware description of the iop registers which are not part of playstation 1.
3. You can help when you have a serial cable connected to the iop or ee, because I am loosing all debug information, when I deactivate ps2link (which is required to load dmarelay.irx).
4. Verify if the sbios by is taken by RTE from file "pbpx_955.09" offset 0x351b0 and loaded unpatched to address 0x80001000 (also about the end address I am not sure).
someone
Idiot
Posts: 71
Joined: Tue Sep 13, 2005 9:03 pm

Post by someone »

1. Send me a memory dump of the hardware registers when RTE/linux is running (e.g. 0xBF801570 and 0xBF801680).
2. Find any hardware description of the iop registers which are not part of playstation 1.
3. You can help when you have a serial cable connected to the iop or ee, because I am loosing all debug information, when I deactivate ps2link (which is required to load dmarelay.irx).
4. Verify if the sbios by is taken by RTE from file "pbpx_955.09" offset 0x351b0 and loaded unpatched to address 0x80001000 (also about the end address I am not sure).
Unfortunately, even these are beyond me.
Would pcsx2's register dump be acceptable as this is the only way I would figure out how to do even one of these? Otherwise if you give instructions on how to do these, I could try them out (if they are just a matter of command-line tools).

Maybe I can help better by sending a harddrive. Is the harddrive the problem, or the scratched disc?
Mega Man
Posts: 260
Joined: Sat Jun 18, 2005 3:14 am
Contact:

Post by Mega Man »

Please run the following commands on ps2 linux as root user:

Code: Select all

dd if=/dev/mem of=memory.bin bs=4096 count=8192
gzip memory.bin

devmem
gzip hwregisters.bin
and send me the result. This will generate a complete memory dump and compress it. I need at least the first 64 kByte of memory.bin. For devmem you need to compile http://people.freenet.de/ps2dev/devmem.tgz (extract and run "make" in devmem directory).

My first approach was to develop RTE under pscx2 using the debugger included, but I've never got pscx2 running. I can't start anything in it.

I don't know which hard disc is compatible with ps2linux. My hard disc is working with ps2sdk. When I once finished with TGE, then every hard disc will work, that is compatible with ps2sdk.

I currently try to link initrd.gz and kernel together and then mount my host using nfs, but the complete size is 7.3 MB. I need to make very much space on my memory card.
Mega Man
Posts: 260
Joined: Sat Jun 18, 2005 3:14 am
Contact:

Post by Mega Man »

I detected that RTE is not capable of loading kernels with a size of 7.2 Mbyte. Initrd.gz need to be smaller.
cosmito
Posts: 307
Joined: Sun Mar 04, 2007 4:26 am
Location: Portugal
Contact:

Post by cosmito »

J.F. wrote:Lik-Sang has a monitor cable available here:
http://www.lik-sang.com/info.php?catego ... ts_id=2363&

It's not just usable with PS2 Linux, it's BETTER because it doesn't require sync on green monitors.
Could you please tell us the model of the cable, since Lik-Sang is out of business? Other shop may have it. Thx
ragnarok2040
Posts: 202
Joined: Wed Aug 09, 2006 1:00 am

Post by ragnarok2040 »

Mega Man, I'm able to run the RTE under PCSX2, using my bios dumped using bios dumper v2.0, but when it tries to ungzip the compressed kernel, a cputlbmiss exception occurs. I copied the kernel manually to the pcsx2 memory card file using mymc after converting the .np0 save to .max using ps2 save builder tools. Other than that, I can see the debug output while it's running all the way up till the exception but I'm not sure if it's of any use since it doesn't boot the kernel, but it does use the bios romdir images on the rte disc. I saved a log of what happens when selecting the Install option and the "Boot->Initrd" option. If you want, I can upload the logs.
Last edited by ragnarok2040 on Wed Sep 19, 2007 4:48 pm, edited 1 time in total.
someone
Idiot
Posts: 71
Joined: Tue Sep 13, 2005 9:03 pm

Post by someone »

Mega Man wrote: I don't know which hard disc is compatible with ps2linux. My hard disc is working with ps2sdk. When I once finished with TGE, then every hard disc will work, that is compatible with ps2sdk.
That sounds strange -- I used a 4GB western digital hard drive with no problem -- if I recall correctly, ps2 linux resides on an ext2 partition normally, so other than the drive physically fitting in the bay, there is no special requirement for the hard drive. Does ps2sdk have libraries to read ext2 partitions? My understanding is that it only handles APA partitions. Is this right?
Mega Man
Posts: 260
Joined: Sat Jun 18, 2005 3:14 am
Contact:

Post by Mega Man »

ps2sdk doesn't have a library to read ext2 partitions, but I can use APA partitions.
I was never sure, which hard discs will work, because my hard disc was not working and I didn't find any information about it. I thought that I need at least 40GB, but you write that you use only 4GB.
So today I tried different harddiscs, here are my results:

Not labeled hard disc 16 GB - not working
IBM DTTA-371440 14.4GB - not working
IBM DJNA-351520 15.2 GB - working!

OK, I found a working hard disc and I could dump the memory information.
Mega Man
Posts: 260
Joined: Sat Jun 18, 2005 3:14 am
Contact:

Post by Mega Man »

ragnarok2040, if your log includes memory accesses to hardware registers, then I need it (especially when you also have the values that are written to the registers).
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Mega Man wrote:ps2sdk doesn't have a library to read ext2 partitions, but I can use APA partitions.
I was never sure, which hard discs will work, because my hard disc was not working and I didn't find any information about it. I thought that I need at least 40GB, but you write that you use only 4GB.
So today I tried different harddiscs, here are my results:

Not labeled hard disc 16 GB - not working
IBM DTTA-371440 14.4GB - not working
IBM DJNA-351520 15.2 GB - working!

OK, I found a working hard disc and I could dump the memory information.
It's not so much the size as the specification supported. PS2 Linux requires a drive that supports the "modern" EIDE specs - generally 20G and up all support the "new" spec. Smaller than that and you take your chances with most drives not supporting the new spec.

There's a PS2 Harddrive Compatibility Chart:
http://ps2drives.x-pec.com/?p=list&PHPS ... f4b6bfecd8
ragnarok2040
Posts: 202
Joined: Wed Aug 09, 2006 1:00 am

Post by ragnarok2040 »

This is right before the screen is setup to be shown, it hasn't gone into kernel mode yet.

Code: Select all

reg: 1021f9c 0 0 0 0
at: 0_0_ffffffff_80020000
v0: 0_0_0_1
v1: ffffffff_ffffffff_0_0
a0: 0_0_0_1125200
a1: 0_0_0_1125300
a2: 0_0_0_580
a3: 0_0_ffffffff_fffff000
t0: ffffffff_ffffffff_0_0
t1: 80808080_80808080_ffffffff_a0021f90
t2: 0_0_0_40
t3: 0_0_ffffffff_a0021f40
t4: 0_0_0_211b6c40
t5: 0_0_ffffffff_a0000000
t6: 0_0_0_4
t7: 0_0_0_1f
s0: 0_0_0_10000
s1: 0_0_0_1
s2: 0_0_0_1032600
s3: 0_0_0_1
s4: 0_0_ffffffff_ffffffff
s5: 0_0_0_1083c84
s6: 0_0_0_1
s7: 0_0_0_1f7fc90
t8: 0_0_ffffffff_800212c0
t9: 0_0_0_19800
k0: 0_0_0_70030c13
k1: 0_0_0_0
gp: 0_0_0_108baf0
sp: 0_0_0_1f7fbf0
fp: 0_0_0_0
ra: 0_0_0_1022050
f0: 0 2e00
f1: 0 0
f2: 0 0
f3: 0 0
f4: 0 0
f5: 0 0
f6: 0 0
f7: 0 0
f8: 0 0
f9: 0 0
f10: 0 0
f11: 0 0
f12: 0 0
f13: 0 0
f14: 0 0
f15: 0 0
f16: 0 0
f17: 0 0
f18: 0 0
f19: 0 0
f20: 0 0
f21: 0 0
f22: 0 0
f23: 0 0
f24: 0 0
f25: 0 0
f26: 0 0
f27: 0 0
f28: 0 0
f29: 0 0
f30: 0 0
f31: 0 0
vf1: 0 0 0 0, vi: 0
vf2: 0 0 0 0, vi: 0
vf3: 0 0 0 0, vi: 0
vf4: 0 0 0 0, vi: 0
vf5: 0 0 0 0, vi: 0
vf6: 0 0 0 0, vi: 0
vf7: 0 0 0 0, vi: 0
vf8: 0 0 0 0, vi: 0
vf9: 0 0 0 0, vi: 0
vf10: 0 0 0 0, vi: 0
vf11: 0 0 0 0, vi: 0
vf12: 0 0 0 0, vi: 0
vf13: 0 0 0 0, vi: 0
vf14: 0 0 0 0, vi: 0
vf15: 0 0 0 0, vi: 0
vf16: 0 0 0 0, vi: 0
vf17: 0 0 0 0, vi: f
vf18: 0 0 0 0, vi: 0
vf19: 0 0 0 0, vi: 0
vf20: 0 0 0 0, vi: 0
vf21: 0 0 0 0, vi: 0
vf22: 0 0 0 0, vi: 0
vf23: 0 0 0 0, vi: 0
vf24: 0 0 0 0, vi: 0
vf25: 0 0 0 0, vi: 0
vf26: 0 0 0 0, vi: 0
vf27: 0 0 0 0, vi: 0
vf28: 0 0 0 0, vi: 0
vf29: 0 0 0 0, vi: 0
vf30: 0 0 0 0, vi: 0
vf31: 0 0 0 0, vi: 0
vfACC: 0 0 0 0
LO: 0_0_0_0, HI: 0_0_0_0
Cycle: e139b42 e139d42, Count: e0e2c16
psxreg: ae94
psx0: 0 0
psx2: 0 0
psx4: 0 0
psx6: 0 0
psx8: 0 0
psx10: 0 0
psx12: 0 0
psx14: 0 0
psx16: 0 0
psx18: 0 0
psx20: 0 0
psx22: 0 0
psx24: 0 0
psx26: ae94 43080d
psx28: 191f0 1fefe0
psx30: 1fefe0 bc6c
psx32: 0 0
cycle: 1c27368 1c27368 fffffff8 1c27368; counters 1c27298 8e37
counter0: 71c8 1 1c27298
counter1: 71c8 1 1c27298
counter2: 71c8 1 1c27298
counter3: 1c27298 1 1c27298
counter4: 1c27298 1 1c27298
counter5: 48b372 1 1c27298
cyc11: 0 0; vu0: 0, vu1: 0
counters: e137e5a 1ce7; psx: 1c27298 8e37
eetimer0: count: 0 mode: 0 target: ffff 0; 2 9; 0 2f1f22a 0 2f1f22a
eetimer1: count: 0 mode: 0 target: ffff 0; 2 a; 0 2f1f236 0 2f1f236
eetimer2: count: cc84 mode: c80 target: ffff 0; 2 b; 0 2f1f244 0 e139b42
eetimer3: count: 26ec mode: 83 target: ffff 0; 4937 c; 0 2f1e254 0 e138b08
VIF0_STAT = 0, VIF1_STAT = 40
ipu 0 0 0 0; bp: 0 0 0 0
gif: 0 0 0
dma0 c0 m20 q0 t0 s0
dma1 c0 m50 q0 t0 s0
dma2 c0 m0 q0 t0 s0
dma3 c0 m0 q0 t0 s0
dma4 c1 m0 q0 t0 s0
dma5 c10000184 m1125300 q0 t0 s0
dma6 c84 m21f90 q0 t21420 s0
dma7 c0 m0 q0 t0 s0
dma8 c0 m0 q0 t0 s0
dma9 c0 m0 q0 t0 s0
dmac 1 a00040 0 0
intc c 1002
sif: 0 10000 30000 40 0
hardware registers dumped EE:1021f9c, IOP:ae94
This is when the main menu of the RTE is displayed, pretty sure after it's entered kernel mode.

Code: Select all

reg: 81fc0 0 0 0 0
at: 0_0_0_0
v0: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 0 0, vi: 0
vf23: 0 0 0 0, vi: 0
vf24: 0 0 0 0, vi: 0
vf25: 0 0 0 0, vi: 0
vf26: 0 0 0 0, vi: 0
vf27: 0 0 0 0, vi: 0
vf28: 0 0 0 0, vi: 0
vf29: 0 0 0 0, vi: 0
vf30: 0 0 0 0, vi: 0
vf31: 0 0 0 0, vi: 0
vfACC: 0 0 0 0
LO: 0_0_0_0, HI: 0_0_0_0
Cycle: 1e0e4597 1e0e4797, Count: 1e08d66d
psxreg: ae94
psx0: 0 0
psx2: 0 0
psx4: 0 0
psx6: 0 0
psx8: 0 0
psx10: 0 0
psx12: 0 0
psx14: 0 0
psx16: 0 0
psx18: 0 0
psx20: 0 0
psx22: 0 0
psx24: 0 0
psx26: ae94 43080d
psx28: 191f0 1fefe0
psx30: 1fefe0 bc6c
psx32: 0 0
cycle: 3c1c8b3 3c1c8b3 fffffff7 3c1c8b3; counters 3c1b055 51f5
counter0: ae0a 1 3c1b055
counter1: ae0a 1 3c1b055
counter2: ae0a 1 3c1b055
counter3: 3c1b055 1 3c1b055
counter4: 3c1b055 1 3c1b055
counter5: 247f12f 1 3c1b055
cyc11: 0 0; vu0: 0, vu1: 0
counters: 1e0e369f ef6; psx: 3c1b055 51f5
eetimer0: count: 0 mode: 0 target: ffff 0; 2 9; 0 2f1f22a 0 2f1f22a
eetimer1: count: 0 mode: 0 target: ffff 0; 2 a; 0 2f1f236 0 2f1f236
eetimer2: count: 2078 mode: c80 target: ffff 0; 2 b; 0 2f1f244 0 1e0e4596
eetimer3: count: 5ecb mode: 83 target: ffff 0; 4937 c; 0 2f1e254 0 1e0e22f1
VIF0_STAT = 0, VIF1_STAT = 40
ipu 0 0 0 0; bp: 0 0 0 0
gif: 0 0 0
dma0 c0 m0 q0 t0 s0
dma1 c0 m0 q0 t0 s0
dma2 c1 m1130610 q0 t0 s0
dma3 c0 m0 q0 t0 s0
dma4 c0 m0 q0 t0 s0
dma5 c10000184 m11b6c80 q0 t0 s0
dma6 c84 m22110 q0 t21450 s0
dma7 c0 m0 q0 t0 s0
dma8 c0 m0 q0 t0 s0
dma9 c0 m0 q0 t0 s0
dmac 1 a00044 0 0
intc 8 1006
sif: 0 10000 30000 40 0
hardware registers dumped EE:81fc0, IOP:ae94
I'm not sure if this is any help, since these are just snapshots of what the registers are holding at those times.

This is the dump at BF801570 that I think you wanted. It looks like an unimplemented op is executed after the return to jal though :/.
BF801570 0FBBFF77: jal 0xBEEFFDDC
BF801574 000C0400: sll zero, t4, 0x10
BF801578 00000001: ?????

I can step through the execution one instruction at a time. I can also dump the list of instructions that are executed after it enters kernel mode or whenever you want.
Mega Man
Posts: 260
Joined: Sat Jun 18, 2005 3:14 am
Contact:

Post by Mega Man »

ragnarok2040, can you please give me the following information:

Where is the function at 0x01000988 called.
This function jumps to 0x0100a9c0, which copy code to address 0x80000018 and call it (at 0x0100ab48).
I need a register dump at address 0x80000054. I want to know which function is called at this point by "jr t0". Is this the jump to the linux kernel entry or an unknown init function of SBIOS?
Mega Man
Posts: 260
Joined: Sat Jun 18, 2005 3:14 am
Contact:

Post by Mega Man »

Hello,

I want to inform you that I updated my kernelloader. You can get it here:
http://freenet-homepage.de/ps2dev/kernelloader0.5.tgz

New main features:
- Graphic support (gsKit) in loader, shows current load state.
- Added some SBIOS calls (this is not yet enough to get SIFRPC working, only IOP reset is working)
- My example kernel emulate parts of an original PS2 kernel. The ps2 tutorial can be started and is preconfigured. My idea was to use this for testing SIF RPC.
- SBIOS from RTE can be extracted and used for testing (linux is not working with this configuration, but my example kernel is working)
- If someone wants to help me reverse engineering, I added the map files for ps2dis.exe.
Mega Man
Posts: 260
Joined: Sat Jun 18, 2005 3:14 am
Contact:

Post by Mega Man »

I've updated kernelloader. The new version is available at:

http://mitglied.lycos.de/ps2dev/linux.html

Changes in emulated ps2 kernel:
- SIF RPC is working with TGE and RTE sbios.
- All IOP hardware should work. I've tested it with the pad and the mc example from ps2dev.

SIF RPC is not yet working with linux.
Post Reply