finished vfs for a while

This commit is contained in:
2026-02-12 11:43:41 -05:00
parent 1c4f48bd65
commit 33cd291c21
31 changed files with 1083 additions and 1097 deletions

View File

@@ -1,42 +1,41 @@
--:Minify:--
local kernel=...
-- :Minify:--
local kernel = ...
local io = {}
kernel.io=io
io.eventq={}
kernel.io = io
io.eventq = {}
function io.pushEvent(queue, ...)
queue=tostring(queue)
if not io.eventq[queue] then
io.eventq[queue]={}
end
io.eventq[queue][#io.eventq[queue]+1]={...}
queue = tostring(queue)
if not io.eventq[queue] then io.eventq[queue] = {} end
io.eventq[queue][#io.eventq[queue] + 1] = {...}
end
function io.bind(queue)
queue=tostring(queue)
kernel.currentTask.eventq=queue
queue = tostring(queue)
kernel.currentTask.eventq = queue
end
function io.pullEvent()
if io.eventq[kernel.currentTask.eventq] then
if #io.eventq[kernel.currentTask.eventq]==1 then
if #io.eventq[kernel.currentTask.eventq] == 1 then
local event = table.remove(io.eventq[kernel.currentTask.eventq] or {}, 1)
io.eventq[kernel.currentTask.eventq]=nil
io.eventq[kernel.currentTask.eventq] = nil
return table.unpack(event)
end
local event = table.remove(io.eventq[kernel.currentTask.eventq] or {}, 1)
local event =
table.remove(io.eventq[kernel.currentTask.eventq] or {}, 1)
if not event then return end
return table.unpack(event)
end
end
function io.getBoundQueue()
return kernel.currentTask.eventq
end
function io.getBoundQueue() return kernel.currentTask.eventq end
kernel.syscalls["IO_pushEvent"]=io.pushEvent
kernel.syscalls["IO_pullEvent"]=io.pullEvent
kernel.syscalls["IO_bind"]=io.bind
kernel.syscalls["IO_getBoundQueue"]=io.getBoundQueue
kernel.syscalls["IO_pushEvent"] = io.pushEvent
kernel.syscalls["IO_pullEvent"] = io.pullEvent
kernel.syscalls["IO_bind"] = io.bind
kernel.syscalls["IO_getBoundQueue"] = io.getBoundQueue
kernel.log("IO pipeline initialized")
kernel.log("IO pipeline initialized")