Update src/disks/1h/boot/HBoot.sys
This commit is contained in:
@@ -7,8 +7,10 @@ local timeout = computer.time()+5000
|
||||
|
||||
term.print("HBoot V1.0.0 //\n")
|
||||
local w, h = term.getSize()
|
||||
|
||||
local kernel = load(getfile("/boot/Hyprkrnl.sys").readAllText())
|
||||
local recovery = load(getfile("/boot/util/shell").readAllText())
|
||||
|
||||
local dbg = {}
|
||||
local entries = {
|
||||
{"HyperionOS", function() kernel(args) end},
|
||||
@@ -22,20 +24,21 @@ dbg = {
|
||||
{"Boot in recovery", function() recovery(args) end}
|
||||
}
|
||||
|
||||
local function render(table, select)
|
||||
local function render(tbl, selected)
|
||||
term.clear()
|
||||
term.print("HBoot V1.0.0 //\n")
|
||||
for i,v in pairs(table) do
|
||||
if select=i then
|
||||
term.print("- "..v[1])
|
||||
for i, v in ipairs(tbl) do
|
||||
if selected == i then
|
||||
term.print("- " .. v[1] .. "\n")
|
||||
else
|
||||
term.print(" "..v[1])
|
||||
term.print(" " .. v[1] .. "\n")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
render(entries, 1)
|
||||
local exit = false
|
||||
|
||||
while not exit do
|
||||
local ret = {computer.getMachineEvent()}
|
||||
if ret[1] == "keyPressed" then
|
||||
@@ -50,10 +53,11 @@ end
|
||||
|
||||
local cerent = entries
|
||||
local cersel = 1
|
||||
|
||||
if not exit then
|
||||
while true do
|
||||
local ret = {computer.getMachineEvent()}
|
||||
if ret[1]="keyTyped" then
|
||||
if ret[1] == "keyTyped" then
|
||||
if ret[3] == "\n" then
|
||||
if type(cerent[cersel][2]) == "function" then
|
||||
cerent[cersel][2]()
|
||||
@@ -70,6 +74,7 @@ if not exit then
|
||||
cersel = cersel + 1
|
||||
end
|
||||
end
|
||||
render(cerent, cersel)
|
||||
end
|
||||
end
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user