title: Writing a Windows NT subsystem
body: <p>I'd like to try writing my own minimal NT subsystem on Windows 7 for purely educational purposes -- something like a bare-bones equivalent of the posix.exe in Microsoft's Subsystem for Unix-based Applications.</p>
  
  <p>But I can't seem to find any public documentation on this topic.  What API does a subsystem need to implement?  How does it get registered with Windows?  How does the subsystem image need to be built (what flags need to be set in the PE header, etc.)?</p>
  
  <p>I'd most like to find a book or web site with an overview of the entire subject, or even the source code for a "hello world" NT subsystem that someone else has written.  But anything at all would be appreciated if you can point me in the right direction here...</p>