Arduino code on Atmega16

I would like to burn Arduino bootloader to atmega16, so I can write Arduino code for it. Where I can download and edit Arduino bootloader? Has anyone tried this? How I can upload sketches to Atmega16 after uploading bootloader?

Thank you very much and sorry for so many questions.

The source code can be found at github.

You're probably looking for the stuff in the files that end with ".c" and ".lst". Optiboot is the newest version that takes up the least space, and it should be compatible with the atmega168.

I've no experience with editing the bootloader, but you should be able to upload sketches normally with the Arduino board. You should not need to burn the bootloader each time you upload a sketch since that is the point.