You can check the Arduino source code at,
https://github.com/arduino/Arduino/tree/master/build/shared/examples/10.StarterKit