title: Reverse engineering the "Target Display Mode" on an iMac
body: <p>I have a computer lab with a couple of old-ish iMacs (around 2011). Most people now just want to use them as displays for their laptops, and with Target Display Mode in MacOS, this (mostly) works fine. </p>
  
  <p>However, I'd also like to support this under Linux, which is installed on all the iMacs in parallel to MacOS. I'm fairly experienced with the Linux kernel (I already wrote kernel drivers), but I have basically no idea about MacOS - therefore, I'm looking for pointers regarding how to figure out how TDM is actually triggered (i.e. what happens <em>after</em> Cmd-F2 is pressed). </p>
  
  <p>I'm guessing this mostly involves writing some Intel GPU registers, but I have no idea which bit of MacOS is actually responsible for that. Any hints?</p>