The Horizontal Situation Indicator (HSI) rosette display on a G1000 works in a similar fashion to a conventional HSI operating in slave mode. It is slaved to a 3 axis magnetometer which gives it heading cues. A magnetometer makes use of a flux gate or flux valve consisting of a 3 part iron ring fitted with 3 pickup coils on the arms and a single excitation coil around the core.

The excitation coil is energized with an alternating current. When this AC current reverses direction, it allows the pickup coils to sense the magnetic flux of the earth’s magnetic field. How intense the flux through each of the pickup coils is is determined by how the ring is aligned with the Earth’s magnetic field. See image below.

Therefore, the net electrical inputs from these pickup coils can be interpreted via either an analog or digital computer and related to the direction of the aircraft relative to the Earth’s magnetic field.
Flux gates are typically mounted in the wing of an aircraft near the tip well away from avionics or other electrical systems to minimize risk of magnetic interference and consequently heading errors from magnetic deviation. When installed and calibrated correctly, the magnetometer should indicate a heading either on or very, very close to what is indicated on a free moving magnetic compass. This should be verified during preflight and taxi checks that these two navigation devices operate in harmony.