I am going to so you ,how to burn the appropriate bootloader , using Arduino uno ,for using it to your rep rap. Things we are going to need, is the following circuit, an arduino uno and our atmega of course.
So, we did it on a breadboard
Crystal a am using is 20Mhz.
Next, we have to place Gen7 folder ,to arduino folder /hardware/gen7. Ok, now restart arduino idle and we will see 6 more boards starting with Gen7. . Next ,we have to convert arduino as ISP. We connect arduino and we upload from examples <>. . We have to make the circuit at the first photo,,we it’s done and when we already have upload <> go to tools tab ,change our board,for example mine is Gen7 with Atmega1284p and 20Mhz ,our serial port, and at programmer section we are choosing <>.
We then change burn bootloader. If, everything is ok an about 30 sec. bootloader will be in our atmega chip. Similar way go for atmega644p.
There many ways to birn bootloader. Another easy way is to supply a USBASP. It is a convenient device for programming many atmega chips. We can use many programs, like avrdude, ponyprog, extreme burner and even avrdude syntax.