OC-Tsuki/extras/crescent/bootvelxloader.lua

16 lines
384 B
Lua

local fs = component.proxy(computer.getBootAddress())
local f = fs.open("boot.velx")
fs.seek(f, "set", 14)
local psize = string.unpack("<I3", fs.read(f, 3))
fs.seek(f, "set", 27)
local rdat = psize
local dat = ""
local buf = ""
repeat
buf = fs.read(f, rdat)
if (buf) then
dat = dat .. buf
end
rdat = psize - #dat
until rdat == 0 or not buf or buf == ""
load(dat, "=boot.velx")()