diff options
Diffstat (limited to 'src/sysapp')
-rw-r--r-- | src/sysapp/login/main.lua | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/sysapp/login/main.lua b/src/sysapp/login/main.lua index 67ce3fe..3aa0695 100644 --- a/src/sysapp/login/main.lua +++ b/src/sysapp/login/main.lua @@ -145,6 +145,31 @@ local grid = tk.grid({border_size = 1}, { wm:add({title = "Filesystems", x = 300, y = 20}, tk.box({vresize = true, hresize = true, vscroll = true, hscroll = true}, grid)) +function open_terminal(title, binfile) + local term_widget = tk.gipwidget({width = 480, height = 360}) + wm:add({title = title, x = 300, y = 200}, term_widget) + local tty_a, tty_b = sys.make_channel(false) + + local term_bin_pid = sys.new_proc() + sys.bind_fs(term_bin_pid, "sys", "sys") + sys.bind_fs(term_bin_pid, "config", "config") + sys.bind_fd(term_bin_pid, sysdef.STD_FD_GIP, term_widget.ch_cli) + sys.bind_fd(term_bin_pid, sysdef.STD_FD_TTYSRV, tty_a) + sys.dbg_print("Start terminal.bin, pid: " .. tonumber(term_bin_pid)) + sys.proc_exec(term_bin_pid, "sys:/bin/terminal.bin") + + local shell_bin_pid = sys.new_proc() + sys.bind_fs(shell_bin_pid, "root", "root") + sys.bind_fs(shell_bin_pid, "sys", "sys") + sys.bind_fs(shell_bin_pid, "config", "config") + sys.bind_fd(shell_bin_pid, sysdef.STD_FD_TTY_STDIO, tty_b) + sys.dbg_print("Start " .. binfile .. ", pid: " .. tonumber(shell_bin_pid)) + sys.proc_exec(shell_bin_pid, binfile) +end + +open_terminal("Shell", "sys:/bin/shell.bin") +open_terminal("Lua prompt", "sys:/bin/lx.bin") + mainloop.run() os.exit() |