I have found that the atmega folder is an old folder (stil used for the duemilanove). The "new" bootloader code is in the optiboot folder.
It is really simple to compile the bootloader (just go to the folder in a command prompt and run omake). I compiled the code "as is" and it is 100% (binary compared) the same as the hex file delivered with arduino (tested with Arduino IDE 1.0.1).
But as soon as I change something in the file it compiles but when burned on a Arduino the L led starts flashing and never stops. I can upload code but it looks like the code never starts
I have tried several code changes, but all with the same result.
If I restore the code in original state, compile and "burn" all is fine.
I must be doing something wrong

. And I guess it is something very basic.
Any help is appreciated
@crossroads
I'm not sure how the fio relates to my problem. I want to upload to a mega (need the extra pins and memory) via wifi ( I need 3000m² coverage).
Best regards
Jantje
The changes I tried in optiboot.c
// Adaboot no-wait mod
ch = MCUSR;
MCUSR = 0;
watchdogConfig(WATCHDOG_OFF); //added this line
//if (!(ch & _BV(EXTRF))) appStart(); removed this line
// Adaboot no-wait mod
ch = MCUSR;
MCUSR = 0;
if (!(ch & _BV(EXTRF)) watchdogConfig(WATCHDOG_OFF); //added this line
//if (!(ch & _BV(EXTRF))) appStart(); //removed this line
// Adaboot no-wait mod
//ch = MCUSR;
//MCUSR = 0; //removed the whole Adaboot no-wait mod
//if (!(ch & _BV(EXTRF))) appStart();