shadow: add common subsystem code