Curiosity definitely has an OS (VxWorks). But I asked one of the developers about releasing some code after Curiosity landed and was told that they couldn't. So I doubt an accurate Curiosity emulator will ever be possible unless JPL releases their code 45 years from now like NASA did with Apollo 11's guidance system. (https://code.google.com/p/virtualagc/)