user71272: I realized that on the atmega boards the bootloader is programmed into the chip.
I'm curious, when compiling a sketch how does the compiler/assembler differ from compiling a standard C program for a chip without a bootloader?
Is there still a main? Does the linker put the startup code in a different area? Obviously with the bootloader you're no longer compiling a program which places code at the reset address.

user7508: On the Uno and similar AVR-based boards, the compiler and assembler are
not aware of the bootloader. The compiled program starts at address
zero. There you have the interrupt vector table, starting with the reset
vector. That vector is a jump to the C runtime startup code, which does
some low-level initialization, then calls main() from the Arduino core
library, which calls setup() and loop() from your sketch.
The bootloader lives at the end of the flash. The AVR chip has a few
bytes of non-volatile configuration memory called “fuses”. These bytes
are configured by the Arduino board maker to dedicate the last
512 bytes of flash to the bootloader, and to start executing the
code at the start of the bootloader on power up and on reset events. It
is then the bootloader's responsibility to jump to address zero in order
to start the user's program.

71272: <p>I realized that on the atmega boards the bootloader is programmed into the chip.</p>
<p>I'm curious, when compiling a sketch how does the compiler/assembler differ from compiling a standard C program for a chip without a bootloader?</p>
<p>Is there still a main? Does the linker put the startup code in a different area? Obviously with the bootloader you're no longer compiling a program which places code at the reset address.</p>
 7508: <p>On the Uno and similar AVR-based boards, the compiler and assembler are
not aware of the bootloader. The compiled program starts at address
zero. There you have the interrupt vector table, starting with the reset
vector. That vector is a jump to the C runtime startup code, which does
some low-level initialization, then calls <code>main()</code> from the Arduino core
library, which calls <code>setup()</code> and <code>loop()</code> from your sketch.</p>
<p>The bootloader lives at the end of the flash. The AVR chip has a few
bytes of non-volatile configuration memory called “fuses”. These bytes
are configured by the Arduino board maker to dedicate the last
512 bytes of flash to the bootloader, and to start executing the
code at the start of the bootloader on power up and on reset events. It
is then the bootloader's responsibility to jump to address zero in order
to start the user's program.</p>
