1
0
mirror of https://github.com/Adorable-Catgirl/Zorya-NEO.git synced 2024-11-14 22:38:07 +11:00
Zorya-NEO/mods/loader_ulos.lua
i develop things b1f64f97a1
add ULOS loader
2021-09-03 16:22:40 -04:00

36 lines
908 B
Lua

-- ULOS loader --
local zy = krequire("zorya")
local utils = krequire("utils")
local thd = krequire("thd")
local vdev = krequire("util_vcomponent")
local function proxytable(t)
return setmetatable({}, {__index=function(self, i)
if (type(t[i]) == "table") then
self[i] = proxytable(t[i])
return rawget(self, i)
else
return t[i]
end
end})
end
local ulos_count = 0
return function(addr)
local fs = component.proxy(addr)
thd.add("ulos$"..ulos_count, function()
local env = utils.make_env()
function env.computer.getBootAddress()
return addr
end
function env.computer.setBootAddress()end
local old_dl = utils.debug_log
load(utils.readfile(fs.address, fs.open("/boot/cynosure.lua")), "=/boot/cynosure.lua", "t", env)()
computer.pushSignal("ulos_dead")
end)
while true do
if computer.pullSignal() == "ulos_dead" then
utils.debug_log("Got signal.")
break
end
end
end