forked from kepler155c/opus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstartup
More file actions
45 lines (42 loc) · 1002 Bytes
/
startup
File metadata and controls
45 lines (42 loc) · 1002 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
local bootOptions = {
{ prompt = 'Default Shell', file = '/sys/boot/default.boot' },
{ prompt = 'Multishell' , file = '/sys/boot/multishell.boot' },
{ prompt = 'TLCO' , file = '/sys/boot/tlco.boot' },
}
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')
local timerId = os.startTimer(.75)
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)