transition tot kernel

This commit is contained in:
kepler155c@gmail.com
2018-01-11 20:53:32 -05:00
parent d224f5df25
commit fc8d44b60d
19 changed files with 425 additions and 366 deletions

View File

@@ -3,26 +3,41 @@ _G.requireInjector()
local Terminal = require('terminal')
local Util = require('util')
local kernel = _G.kernel
local keyboard = _G.device.keyboard
local multishell = _ENV.multishell
local os = _G.os
local term = _G.term
multishell.setTitle(multishell.getCurrent(), 'Debug')
_ENV._APP_TITLE = 'Debug'
term.redirect(Terminal.scrollable(term.current(), 50))
local tabId = multishell.getCurrent()
local terminal = term.current()
local previousId
_G.debug = function(pattern, ...)
local oldTerm = term.current()
term.redirect(terminal)
term.redirect(kernel.terminal)
Util.print(pattern, ...)
term.redirect(oldTerm)
end
kernel.hook('mouse_scroll', function(_, eventData)
local dir, y = eventData[1], eventData[3]
if y > 1 then
local currentTab = kernel.routines[1]
if currentTab.terminal.scrollUp then
if dir == -1 then
currentTab.terminal.scrollUp()
else
currentTab.terminal.scrollDown()
end
end
end
end)
print('Debug started')
print('Press ^d to activate debug window')