Page 1 of 1

PS2 exceptions

Posted: Sat Mar 29, 2008 2:24 am
by cosmito
The tutorial at http://lukasz.dk/playstation-2-programm ... debugging/ is very helpful (thanks Lukasz!) but I wonder if there is documentation about the meaning of the Cause, BadVAddr and Status things...
Or are they classified as confidential being described only on official Sony SDK documents?

Re: PS2 exceptions

Posted: Sat Mar 29, 2008 4:18 am
by Lukasz
ptek wrote:The tutorial at http://lukasz.dk/playstation-2-programm ... debugging/ is very helpful (thanks Lukasz!) but I wonder if there is documentation about the meaning of the Cause, BadVAddr and Status things...
Or are they classified as confidential being described only on official Sony SDK documents?
These values are MIPS COP0 registers, which are documented in alot of MIPS manuals, but for a more PS2 specific one, check the tx79 manual at my site http://lukasz.dk/playstation-2-programming/file-mirror/

Check section 4, about CPU and COP0 registers, there you will see the description of Status, BadVAddr and Cause. There is also a more detailed description of the different exceptions in section 5 of the manual.

The PS2 has hardware support for virtual memory in the form of TLB. If you get an TLB exception, this is because the PS2 assumes that if you referer to an "illegal" address, then this is a virtual address. But since you havn't registered a TLB (virtual address) handler in the kernel, you just get an error in PS2Link, stating its a Bad Virtual Address (BadVAddr).

If you printf memory access addresses in the function which caused the exception (locate this either by ee-addr2line or EPC) and if you get the same address as BadVAddr, you found your bug :-)

Posted: Sat Mar 29, 2008 11:54 pm
by cosmito
OK thanks