The Particle firmware is located in ~/github/firmware
.
application.h
is located in user/inc
A lot of the stuff is in wiring
and system
as well.
I think @BDub and @mdma could help refer you to what you are looking for.
I have answered this question here