3 ms·
It should be possible to provide programs as "data" that is interpreted by the program "running" on Notch's CPU, thus allowing a fine-grained, whitelisted permi
by javert 15y ago
It should be possible to provide programs as "data" that is interpreted by the program "running" on Notch's CPU, thus allowing a fine-grained, whitelisted permissions even without MMU. No?
- jiggy2011 15y agoYou would have to abstract the CPU in some way and then write the permissions management in software as part of the interpreter. Bear in mind that this is already only a 16bit CPU with a restricted address space.
- javert 15y agoYou would have to abstract the CPU in some way and then write the permissions management in software as part of the interpreter. Yes, that's what I said. :) Bear in mind that this is already only a 16bit CPU with a restricted address space. I suspect the interpreter could be made to fit, with limited space left for the untrusted (to-be-interpreted) code. As has been pointed out elsewhere, though, if there is a backing store (i.e., simulated hard drive), it's probably possible to have effectively unlimited "RAM" in the game in practice, unless Notch implements a slowdown for accessing the backing store.
- jiggy2011 15y agoTrue, but your CPU is limited too so having to lex & parse sourcefiles and walk syntax trees to run programs could be a bottleneck there, if you remember old computers there was a significant performance gap between native and interpreted code. In practice that might not matter for many applications if they do not have to use intensive algorithms etc. I would still imagine that compilers would be used more than interpreters though which would mean that some security would need to be present at the "hardware" or "firmware" level. Another interesting thing to think about regards backing stores: I assume that the programs will be able to take input from the world around them, i.e other ships , objects in space etc. So what's to stop you from using (perhaps) a tractor beam to re-organise the position of asteroids in space and then "read" that data back using ship instrumentation? Potentially the entire universe becomes one big DB!
- javert 15y agoWow, now that is a very cool idea! I'm really looking forward to the game.
- ricree 15y agoDepends on how it's structured, doesn't it? It's entirely possible that programs and data will share the same memory with no sandboxing between programs. In that case, then without some sort of MMU a virus could just inject code into an otherwise benign program. Even with finer program access controls, it would still be hard to protect as long as untrusted code was allowed to alter trusted.
- javert 15y agoYou don't understand what I'm proposing. If you want to put it in terms of sandboxing, what I am proposing is a sandbox.