I'm trying to remember, but the "virus as AI" idea was kinda used by someone else.
Except in their case it was "massive update to OSs around the world becomes AI". Ack! I can't remember who the author was, but I think they road the "Sky Road"...
Ah ha! Thank you live.com, Ken Macleod.
Now, I could still be worng that he wrote that bit though, and I have no idea which book it was in. The plot featured a talking gun if memory serves though...
[edit: patience, it would seem, is a virtue I don't have. http://www.amazon.co.uk/Star-Fraction-Fall-Revolution-Novel/dp/1857238338/ref=pd_sim_b_2/026-2001317-2442804 ]