LuPPC/src/lua/core/boot.lua

35 lines
883 B
Lua
Raw Normal View History

2016-01-05 04:20:40 +11:00
local boot = {}
function boot.boot()
2016-01-07 07:32:53 +11:00
local gpu = modules.component.api.proxy(modules.component.api.list("gpu", true)())
local w, h = gpu.getResolution()
print("r= " .. tostring(w) .. " " .. tostring(h))
gpu.fill(0, 0, w, h, " ")
gpu.set(10, 5, "HHHHHHHHHHHHH")
gpu.set(11, 11, "VVVVVVVVVVVVVVVVV", true)
print("LuPI L2 INIT")
print("FIXME: boot stub")
native.sleep(1000000)
local code = modules.component.api.invoke(modules.component.api.list("eeprom", true)(), "get")
if not code then
print("No bootcode")
error("No bootcode")
end
---PASS SANDBOX!!!!!!
2016-01-07 08:13:21 +11:00
local f, reason = load(code, "=BIOS", nil, modules.sandbox)
2016-01-07 07:32:53 +11:00
if not f then
print(reason)
else
2016-01-07 08:13:21 +11:00
local e, reason = pcall(f)
if not e then
print("ERROR")
print(reason)
--TODO: Make fancy bsod here
end
2016-01-07 07:32:53 +11:00
print("System quit, Panic")
end
2016-01-05 04:20:40 +11:00
end
return boot