The iPhone 3GS is now supported in PwnageTool 3.1.3, assuming the phone was pwned at 3.0 or 3.0.1 - PwnageTool does not support the 3GS out of the box. If your iPhone 3GS has 3.1 preinstalled and is not Pwned then there is no tested jailbreak solution at the moment.
You will need ipsw files before you start
iPhone2,1_3.1_7C144_Restore.ipsw
Download New PwnageTool from Torrent:
PwnageTool 3.13 Torrent