diff --git a/src/disks/1h/boot/HBoot.sys b/src/disks/1h/boot/HBoot.sys new file mode 100644 index 0000000..05e14ea --- /dev/null +++ b/src/disks/1h/boot/HBoot.sys @@ -0,0 +1,55 @@ +local args={...} +local term=args[4] +local getfile=args[5] +local computer=args[7] +local timeout = 5 +local time = 0 + +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 entries = { + ["HyperionOS"]=function() kernel(args) end, + ["HyperionOS (Debug options)"]={ + ["Boot HyperionOS in debug mode"]=function() kernel(args, true) end, + ["Boot as shell"]=function() kernel(args, true, true) end, + ["Boot in recovery"]=function() recovery(args) end + } +} + +local function render(table, select) + term.clear() + term.print("HBoot V1.0.0 //\n") + local idx=0 + for i,_ in pairs(table) do + idx=idx+1 + if select=idx then + term.print("- "..i) + else + term.print(" "..i) + end + end +end + +render(entries, 1) +local exit=false +while not exit do + local ret={computer.getMachineEvent()} + if ret[1]=="keyPressed" then + timeout=math.huge + break + end +end + +if exit then + while true do + local ret={computer.getMachineEvent()} + if ret[1]="keyPressed" then + elseif ret[1]="keyTyped" then + if ret[3]=="\n" then + + end +else + kernel(args) +end \ No newline at end of file diff --git a/src/disks/1h/boot/Hyprkrnl.sys b/src/disks/1h/boot/Hyprkrnl.sys index 4b0dc1c..23d10e8 100644 --- a/src/disks/1h/boot/Hyprkrnl.sys +++ b/src/disks/1h/boot/Hyprkrnl.sys @@ -14,7 +14,8 @@ local list=bootLoader[6] local computer=bootLoader[7] local startup=true local osleep=sleep -_G._SYSDEBUG=bootData.debug +_G._SYSDEBUG=args[8] +bootData.debug=args[8] local drivers={} local eventCache={} diff --git a/src/disks/1h/boot/util/shell b/src/disks/1h/boot/util/shell new file mode 100644 index 0000000..e69de29