You may be very interested in the STEPS project from Alan Kay’s Viewpoints Research Institute. STEPS was an attempt to build an entire desktop operating system environment with only 20,000 lines of code. In order to accomplish this, the design makes extensive use of DSLs defined using OMeta. There are examples of TCP and the 2D graphics framework being implemented in an impressively small amount of code.
http://www.vpri.org/pdf/tr2012001_steps.pdf