i read over the 1k bootloader docs, it's cool but it won't work on the atmega8 without some modifications and work. i ended up doing a simple change to the built-in bootloader. here's what i did in case it helps anyone else:
make backups of ATmegaBOOT.c and ATmegaBOOT.hex in apps/arduino-001x/hardware/bootloaders/atmega8/
change startup delay by a factor of 2 or 3: in ATmegaBOOT.c change line 52 to#define MAX_TIME_COUNT (F_CPU>>3)
that gives about a 2.5 second delay after reset before program starts. use F_CPU>>2 for a 5 second delay, and F_CPU>>4 for a 1.25 second (approx) delay.
open Makefile in the same folder and change the DIRAVR path (line 13) to your avr compiler path. if you have CrossPack installed useDIRAVR = /usr/local/CrossPack-AVR
if you don't, you could try the one included with Arduino IDEDIRAVR = ../../tools/avr
but when i tried it i got some errors, maybe somebody else can figure that out, i'll paste it at the end of this.
in Terminal, cd to that directory (hint - drag the enclosing folder to the Terminal window to avoid typing the path), and type make
connect your ISP and Arduino or other board with Atmega8 and select Tools/Board/Arduino NG or older w/ Atmega8, then Tools/Burn Bootloader.
You can erase all the files generated by the compile except for the .c, .hex, and makefile, of course. the Makefile has a clean command but it doesn't seem to work for me.
If you want to remind yourself the bootloader has been altered, you can change the name in arduino-001x/hardware/boards.txt, e.g.atmega8.name=Arduino NG or older w/ ATmega8 - short delay
i'm not sure how to make duplicate entries as atmega8.name variable is overwritten.
note that a delay of <=2.5 seconds can be very hard to work with if you have to press the reset button manually when programming. i recommend the NG auto-reset capacitor hack described here http://www.arduino.cc/en/Hacking/NGAutoReset
, but note there is a mistake on that page and the cap should go on the TOP two pads, not the bottom.
NOTE: maybe someone can clarify this so people don't need to have CrossPack installed - error when trying included compiler DIRAVR = ../../tools/avr:
/Applications/arduino-0016/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/bin/ld: address 0x2060 of ATmegaBOOT.elf section .text is not within region text
make: *** [ATmegaBOOT.elf] Error 1