Had the same problem myself.
Before I put the carpet down I nailed all the lose ones which more or less sorted. One of the rooms was very bad so i lifted all the boards down and put new ones down .. nailing them all to the exsisting joices...
Lift the carpet and just put it back down again.. it should be ok
S