refactor(bios): 移除冗余的启动步骤打印信息

清理bios.lua中不必要的启动步骤打印语句,保持代码简洁。这些打印信息主要用于调试,现已不再需要。
This commit is contained in:
2025-09-01 10:00:10 +08:00
parent 3e5824c230
commit 72e0f704f4

View File

@@ -15,13 +15,11 @@ if fs.exists("/.start_rc.lua") and not (...) then
_sd() _sd()
while true do coroutine.yield() end while true do coroutine.yield() end
end end
print("[OK] Boot step 1")
local function pull(tab, key) local function pull(tab, key)
local func = tab[key] local func = tab[key]
tab[key] = nil tab[key] = nil
return func return func
end end
print("[OK] Boot step 2")
-- this is overwritten further down but `load` needs it -- this is overwritten further down but `load` needs it
local expect = function(_, _, _, _) end local expect = function(_, _, _, _) end
@@ -52,7 +50,6 @@ local rc = {
-- and a few more -- and a few more
rc.pushEvent = rc.queueEvent rc.pushEvent = rc.queueEvent
print("[OK] Boot step 3")
function rc.shutdown() function rc.shutdown()
shutdown() shutdown()
while true do coroutine.yield() end while true do coroutine.yield() end
@@ -62,7 +59,6 @@ function rc.reboot()
reboot() reboot()
while true do coroutine.yield() end while true do coroutine.yield() end
end end
print("[OK] Boot step 4")
local timer_filter = {} local timer_filter = {}
function rc.pullEventRaw(filter) function rc.pullEventRaw(filter)
expect(1, filter, "string", "nil") expect(1, filter, "string", "nil")
@@ -92,7 +88,6 @@ function rc.pullEvent(filter)
return table.unpack(sig, 1, sig.n) return table.unpack(sig, 1, sig.n)
end end
print("[OK] Boot step 5")
function rc.sleep(time, no_term) function rc.sleep(time, no_term)
local id = rc.startTimer(time) local id = rc.startTimer(time)
local thread = require("rc.thread").id() local thread = require("rc.thread").id()
@@ -102,12 +97,10 @@ function rc.sleep(time, no_term)
local _, tid = (no_term and rc.pullEventRaw or rc.pullEvent)("timer") local _, tid = (no_term and rc.pullEventRaw or rc.pullEvent)("timer")
until tid == id until tid == id
end end
print("[OK] Boot step 6")
function rc.version() function rc.version()
return string.format("LeonOS %d.%d.%d", return string.format("LeonOS %d.%d.%d",
rc._VERSION.major, rc._VERSION.minor, rc._VERSION.patch) rc._VERSION.major, rc._VERSION.minor, rc._VERSION.patch)
end end
print("[OK] Boot step 7")
-- Lua 5.1? meh -- Lua 5.1? meh
if _VERSION == "Lua 5.1" then if _VERSION == "Lua 5.1" then
local old_load = load local old_load = load
@@ -155,7 +148,6 @@ if _VERSION == "Lua 5.1" then
end, func) end, func)
end end
end end
print("[OK] Boot step 8")
local startup = _RC_ROM_DIR .. "/startup" local startup = _RC_ROM_DIR .. "/startup"
local files = fs.list(startup) local files = fs.list(startup)
table.sort(files) table.sort(files)
@@ -180,9 +172,9 @@ for i=1, #files, 1 do
local file = startup .. "/" .. files[i] local file = startup .. "/" .. files[i]
assert(loadfile(file))(rc) assert(loadfile(file))(rc)
end end
print("[OK] Boot step 9")
expect = require("cc.expect").expect expect = require("cc.expect").expect
local thread = require("rc.thread") local thread = require("rc.thread")
print("[OK] Computer load&check system done. Starting operating system...")
thread.start() thread.start()
print("[OK] Computer load&check system done. Starting operating system...")