Disclaimer: Things might have changed dramatically in regards to PS3. Just personal experience here.
Developing for the PS3 is (IMHO) a pain in the ass. Firstly, you'd need to put down some money and get yourself Sony's dev kit (I've heard that sony is affiliated with some uni's through which you could potentially get this for free...). This involves going through their approval process and also getting yourself an official PSN dev license (about $1k or so I believe). Once this is done and you got the SDK/documentation in your hands, start developing. A thorough understanding of openGL as well as C++ is an absolute must. Sony also provides a free game engine called PhyreEngine, you might want to do some research on that. Anyhow, forget this whole thing if you haven't developed any games previously, you'll fail.
Xbox is much easier as you can use XNA (code in C# or .net).
I used to hack around on a PS3 back when you could install linux on one... Good times.