transition to kernel

This commit is contained in:
kepler155c@gmail.com
2018-01-20 07:18:13 -05:00
parent d85e9b96b2
commit 1c1eb9b782
28 changed files with 398 additions and 228 deletions

View File

@@ -0,0 +1,24 @@
local kernel = _G.kernel
local os = _G.os
_G.network = { }
local function startNetwork()
kernel.run({
title = 'Net daemon',
path = 'sys/apps/netdaemon.lua',
hidden = true,
})
end
kernel.hook('device_attach', function(_, eventData)
if eventData[1] == 'wireless_modem' then
startNetwork()
end
end)
if _G.device.wireless_modem then
startNetwork()
os.sleep(0) -- give the network a cycle to start
end