Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- bootdevice has been passed to this boot loader from Spirit Loader
- local bd = bootdevice
- bd.gpu.setForeground(0xFFFF00)
- bd:clear()
- bd:print('Simple boot loader!')
- bd:print('')
- bd.gpu.setForeground(0x00FF00)
- bd:print('List of available components:')
- bd.gpu.setForeground(0x00FFFF)
- for address in bd.ls() do
- local devtype = bd.type(address)
- bd:print(string.format('%s: %s', devtype, address))
- end
- bd.gpu.setForeground(0xFFFF00)
- bd:print''
- bd:print'Press r to restart / s to shutdown'
- -- reboot if r is pressed, shutdown if s is pressed
- while true do
- e = table.pack(bd:pullsig())
- if e[1] == 'key_up' then
- if string.char(e[3]) == 'r' then
- bd.comp.shutdown(true)
- elseif string.char(e[3]) == 's' then
- bd.comp.shutdown(false)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement