How to prepare development environment for iMote2 (TinyOs or Linux both are ok)?

I was working with wireless sensor network models particularly a novel routing algorithm and now want to implement and analyze the models physically.
I have four Intel XScale processor driven iMote2 modules and their hardware accessories(sensor board, debug board and battery board). I need to prepare the application development environment for these iMote2 modules (flashing iMote2 with TinyOS or Linux) and develop an application to run in iMote2.
Any advise or suggestions regarding preparing the environment and application would be very much appreciated.