I am trying to write a bootloader for the mega128. I want to equally separate the application section of the flash into two parts. I have programmed the necessary fuses to produce a bootloader section of 2048 bytes. The idea is to let the bootloader decide based on version number stored in eeprom which section has the latest code, and run it when the part comes out of reset. This way, i'll always have a backup in flash.
I have sucessfully written some test code which starts executing at 0x7c00. The IVSEL is clear so that the interrupt vector table starts at address 0x0002. The problem is, my interrupts don't work after the code jumps into the application section from boot section.
Is there a way to rewire the interrupt vector start address so that it starts at an address other than 0x0002 or, in my case, 0xF802? If someone could point me in the right direction, i'd greatly appreciate it.