Building custom bootloader?

And now I've tried to use the watchdog reset gimmick to upload a new sketch and am utterly confused by the results :-). Avrdude appears to start talking to the bootloader OK (I don't get the kind of sync errors I get without the reset), but it gets to the point where it says "Writing" and would normally print # chars for progress, but it makes no progress and eventually says "not responding".

But wait! It gets weirder. At this point, it has apparently erased the old sketch, so now it really is sitting in the bootloader doing the 1-2-3 flashy thing on pin 13. If I try to upload the new sketch again, it works perfectly.

So I have a procedure that works for uploading microcode without physical access to the board, but I have no idea why it works :-).

Anyone know if there are things I need to reset manually that a watchdog reset doesn't reset? Should I be using different lock bits or something to make a watchdog reset "harder" in some way? I'm really mystified.

If anyone is actually curious enough to want to look at my bootloader hacks and the code that uses them, you
can always find the latest version of the source pointed at by:

http://home.comcast.net/~tomhorsley/hardware/arduino/software.html