1
0
mirror of https://github.com/kepler155c/opus synced 2024-12-26 16:40:27 +00:00
opus/startup

45 lines
1004 B
Plaintext
Raw Normal View History

2016-12-11 19:24:52 +00:00
local bootOptions = {
{ prompt = 'Default Shell', file = '/sys/boot/default.boot' },
2017-06-09 21:41:03 +00:00
{ prompt = 'Opus' , file = '/sys/boot/multishell.boot' },
-- { prompt = 'TLCO' , file = '/sys/boot/tlco.boot' },
2016-12-11 19:24:52 +00:00
}
local bootOption = 2
local function startupMenu()
while true do
term.clear()
term.setCursorPos(1, 1)
print('Select startup mode')
print()
for k,option in pairs(bootOptions) do
print(k .. ' : ' .. option.prompt)
end
print('')
term.write('> ')
local ch = tonumber(read())
if ch and bootOptions[ch] then
return ch
end
end
term.clear()
term.setCursorPos(1, 1)
end
term.clear()
term.setCursorPos(1, 1)
print('Starting OS')
print()
print('Press any key for menu')
2017-09-04 21:41:46 +00:00
local timerId = os.startTimer(1.5)
2016-12-11 19:24:52 +00:00
while true do
local e, id = os.pullEvent()
if e == 'timer' and id == timerId then
break
end
if e == 'char' then
bootOption = startupMenu()
break
end
end
os.run(getfenv(1), bootOptions[bootOption].file)