PS2 exceptions

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

Moderators: cheriff, Herben

Post Reply
cosmito
Posts: 307
Joined: Sun Mar 04, 2007 4:26 am
Location: Portugal
Contact:

PS2 exceptions

Post 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?
User avatar
Lukasz
Posts: 248
Joined: Mon Jan 19, 2004 8:37 pm
Location: Denmark
Contact:

Re: PS2 exceptions

Post 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 :-)
cosmito
Posts: 307
Joined: Sun Mar 04, 2007 4:26 am
Location: Portugal
Contact:

Post by cosmito »

OK thanks
Post Reply