How does an aircraft derive winds aloft on its own? The G1000 has a feature where it can put up a winds aloft arrow/speed in the PFD.  I've been sort of wondering how exactly this is determined.  My guess is that the aircraft (or the G1000) knows your airspeed via the pitot/static system and heading via the fluxgate/mag compass.  Then, it uses your GPS position to figure out where you should be every X seconds given the airspeed and heading.  Any difference must be attributable to winds aloft.  Does this make sense?
Yes, you are correct. You need three pieces of information:


airspeed
true compass heading (considering magnetic variation)
multiple absolute position fixes (eg. from gps)


The aircraft heading has to be measured by a compass within the aircraft (it can't be derived from the gps track), and the gps position can be used to look up the local magnetic variation. The difference between the speed/heading and the ground track (in straight and level flight, anyway) is attributable to winds aloft.