made print log

This commit is contained in:
2026-01-15 16:22:25 -05:00
parent 7d8055a703
commit b48f926053
2 changed files with 5 additions and 5 deletions

View File

@@ -2,6 +2,7 @@ local kernel=...
local fs=require("sys.fs") local fs=require("sys.fs")
syscall.TTY_bind("tty0") syscall.TTY_bind("tty0")
for i,v in ipairs(kernel.)
local files = fs.list("/bin/startup") local files = fs.list("/bin/startup")
if not files then error("Failed to list /bin/startup") end if not files then error("Failed to list /bin/startup") end
for i,v in ipairs(files) do for i,v in ipairs(files) do
@@ -12,7 +13,7 @@ for i,v in ipairs(files) do
if not startupFunc then if not startupFunc then
kernel.log("Error loading startup script '" .. filepath .. "': " .. err, "ERROR") kernel.log("Error loading startup script '" .. filepath .. "': " .. err, "ERROR")
else else
kernel.hpv.spawn(function() syscall.HPV_spawn(function()
local status, err = pcall(startupFunc) local status, err = pcall(startupFunc)
if not status then if not status then
kernel.log("Error executing startup script '" .. filepath .. "': " .. err, "ERROR") kernel.log("Error executing startup script '" .. filepath .. "': " .. err, "ERROR")

View File

@@ -1,20 +1,19 @@
--:Minify:-- --:Minify:--
local kernel=... local kernel=...
function print(...) function print(...)
coroutine.yield()
local args={...} local args={...}
local output="" local output=""
for i=1,#args do for i=1,#args do
output=output..tostring(args[i]).."\t" output=output..tostring(args[i]).."\t"
end end
output=output:sub(1,-2) output=output:sub(1,-2)
kernel.tty.print(output) syscall.TTY_print(output)
end end
function printf(fmt, ...) function printf(fmt, ...)
coroutine.yield() coroutine.yield()
local output=string.format(fmt,...) local output=string.format(fmt,...)
kernel.tty.print(output) syscall.TTY_print(output)
end end
function printInline(...) function printInline(...)
@@ -25,5 +24,5 @@ function printInline(...)
output=output..tostring(args[i]).."\t" output=output..tostring(args[i]).."\t"
end end
output=output:sub(1,-2) output=output:sub(1,-2)
kernel.tty.printInline(output) syscall.TTY_printInline(output)
end end