Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. function sandbox (f, env)
  2. local f, err = load(f, nil, "t", env);
  3. if (err == nil and f ~= nil) then
  4. return function()
  5. f ();
  6. end;
  7. else
  8. return function () end;
  9. end
  10. end
  11.  
  12. return sandbox;
  13.  
  14. -- Some more OS CODE here
  15.  
  16. -- Segfaults only sometimes
  17. function os:boot (env)
  18. local environment = {
  19. print=print,
  20. _QUOTA=10000,
  21. os = self
  22. };
  23. self._coroutine = coroutine.create(sandbox(biosCode, environment));
  24. coroutine.resume(self._coroutine);
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement