r0004

Most of space.dmi copied over from r4407