I was answering this question about how a living planet-organism could be possible, and realized I didn't know how such a planet-organism could produce a magnetic field. I postulated that it could somehow use revolving magnets, but this seemed weak and difficult to imagine in reality. So this brings me too my question: how could a living organism generate a magnetic field? For this question, we're assuming earth-like biology, except for the magnetic field thing.
And for bonus points: if the organism was scaled up to planet sized (ignore the other problems with this happening), would that magnetic field be able to hold off solar wind?