Operating system for OpenComputers
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
651B

  1. local ts = {}
  2. for a,_ in component.list("screen") do
  3. ts[#ts+1] = a
  4. end
  5. local ttyn = 0
  6. for a,_ in component.list("gpu") do
  7. local r,w = vtemu(a,table.remove(ts,1))
  8. -- fd[#fd+1] = {["read"]=r,["write"]=w,["close"]=function() w("\27[2J\27[H") end,["t"]="t"}
  9. iofs.register("tty"..tostring(ttyn),function() return r,w,function() w("\27[2J\27[H") end end)
  10. local f = io.open("/iofs/tty"..tostring(ttyn),"rw")
  11. fd[f.fd].t = "t"
  12. ttyn = ttyn + 1
  13. end
  14. do
  15. iofs.register("syslog",function() return function() return "" end, function(msg) syslog(msg,nil,tTasks[cPid].n) end, function() return true end end)
  16. end
  17. if #fd < 1 then
  18. io.open("/iofs/syslog","rw")
  19. end