Compare commits

...

3 Commits

3 changed files with 15 additions and 5 deletions

View File

@ -18,7 +18,7 @@ local function findNextDisplay() -- finds the next available screen, or nil if t
return nil
end
for file in ipairs(fs.list("/boot/cfg/disp/")) do -- allows files in /boot/cfg/disp with filenames as GPU addresses to bind to specific screens
for file in ipairs(fs.list("/boot/cfg/disp/") or {}) do -- allows files in /boot/cfg/disp with filenames as GPU addresses to bind to specific screens
if component.proxy(file) then
local f = io.open("/boot/cfg/disp/"..file)
if f then
@ -36,7 +36,6 @@ for a,_ in component.list("gpu") do -- allocate a screen to every unused GPU
end
for gpu,screen in pairs(tG) do
dprint(gpu,screen)
local r,w = vtemu(gpu,screen)
iofs.register("tty"..tostring(ttyn),function() return r,w,function() w("\27[2J\27[H") end end)
local f = io.open("/iofs/tty"..tostring(ttyn),"rw")

11
service/fsmanager.lua Normal file
View File

@ -0,0 +1,11 @@
while true do
local tE = {coroutine.yield()}
if tE[1] == "component_added" and tE[3] == "filesystem" then
local w, doesExist = pcall(fs.exists,"/"..tE[2]:sub(1,3))
if not w or not doesExist then
fs.mounts[tE[2]:sub(1,3)] = component.proxy(tE[2])
end
elseif tE[1] == "component_removed" and tE[3] == "filesystem" then
fs.mounts[tE[2]:sub(1,3)] = nil
end
end

View File

@ -175,15 +175,15 @@ function start()
end
else
dprint("Not cached", cfg.port,packetID,packetType,dest,sender,vPort,data)
if v.address ~= repeatingFrom or (v.type ~= "tunnel" and v.isWireless()) then
for k,v in pairs(modems) do
for k,v in pairs(modems) do
if v.address ~= repeatingFrom or (v.type ~= "tunnel" and v.isWireless()) then
if v.type == "modem" then
v.broadcast(cfg.port,packetID,packetType,dest,sender,vPort,data)
elseif v.type == "tunnel" then
v.send(packetID,packetType,dest,sender,vPort,data)
end
end
end
end
end
end