Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sandbox (f, env)
- local f, err = load(f, nil, "t", env);
- if (err == nil and f ~= nil) then
- return function()
- f ();
- end;
- else
- return function () end;
- end
- end
- return sandbox;
- -- Some more OS CODE here
- -- Segfaults only sometimes
- function os:boot (env)
- local environment = {
- print=print,
- _QUOTA=10000,
- os = self
- };
- self._coroutine = coroutine.create(sandbox(biosCode, environment));
- coroutine.resume(self._coroutine);
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement