added a boot menu to sebios.lua

This commit is contained in:
Izaya 2017-08-02 00:15:48 +10:00
parent d873cc1288
commit cd1036eeef
1 changed files with 13 additions and 2 deletions

View File

@ -72,13 +72,24 @@ do
wl("Memory: "..tostring(computer.totalMemory()/1024).."K")
wl("")
for k,v in ipairs(bootdevs) do
wl(tostring(k).." "..v)
wl(tostring(k-1).." "..v.." "..component.type(v).." "..component.invoke(v,"getLabel"))
end
while computer.uptime() < 5 do
t,_,c = computer.pullSignal(0.5)
if t == "key_down" and c > 47 and c < 58 then
computer.setBootAddress(bootdevs[c-47])
wl("Boot device set to "..bootdevs[c-47])
end
end
end
end
while computer.uptime() < 2 do
computer.pullSignal(0.5)
t,_,c = computer.pullSignal(0.5)
if t == "key_down" and c > 47 and c < 58 then
computer.setBootAddress(bootdevs[c-47])
wl("Boot device set to "..bootdevs[c-47])
end
end
local init, reason