cli_monitor: Add reboot command for Fiasco.OC
In addition to the new reboot command, this patch tries to reduce the artifacts caused by the interplay of the kernel debugger and terminal_mux.
This commit is contained in:
parent
26710729a3
commit
c56525f264
|
@ -22,26 +22,44 @@ namespace Fiasco {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void clear_host_terminal()
|
||||||
|
{
|
||||||
|
using namespace Fiasco;
|
||||||
|
|
||||||
|
outstring("\e[99S"); /* scroll up */
|
||||||
|
outstring("\e[99T"); /* scroll down */
|
||||||
|
outstring("\e[199A"); /* move cursor up */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
struct Kdebug_command : Command
|
struct Kdebug_command : Command
|
||||||
{
|
{
|
||||||
Kdebug_command() : Command("kdebug", "enter kernel debugger (via serial console)") { }
|
Kdebug_command() : Command("kdebug", "enter kernel debugger (via serial console)") { }
|
||||||
|
|
||||||
void execute(Command_line &, Terminal::Session &terminal)
|
void execute(Command_line &, Terminal::Session &terminal)
|
||||||
{
|
{
|
||||||
tprintf(terminal, " Entering kernel debugger...\n");
|
|
||||||
tprintf(terminal, " Press [g] to continue execution.\n");
|
|
||||||
|
|
||||||
using namespace Fiasco;
|
using namespace Fiasco;
|
||||||
|
|
||||||
/*
|
/* let kernel debugger detect the screen size */
|
||||||
* Wait a bit to give the terminal a chance to print the usage
|
enter_kdebug("*#JS");
|
||||||
* information before the kernel debugger takes over.
|
|
||||||
*/
|
|
||||||
l4_ipc_sleep(l4_timeout(L4_IPC_TIMEOUT_NEVER, l4_timeout_rel(244, 11)));
|
|
||||||
|
|
||||||
enter_kdebug("");
|
clear_host_terminal();
|
||||||
|
enter_kdebug("Entering kernel debugger... Press [?] for help");
|
||||||
|
clear_host_terminal();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
tprintf(terminal, "\n");
|
|
||||||
|
struct Reboot_command : Command
|
||||||
|
{
|
||||||
|
Reboot_command() : Command("reboot", "reboot machine") { }
|
||||||
|
|
||||||
|
void execute(Command_line &, Terminal::Session &terminal)
|
||||||
|
{
|
||||||
|
using namespace Fiasco;
|
||||||
|
|
||||||
|
clear_host_terminal();
|
||||||
|
enter_kdebug("*#^");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -50,4 +68,7 @@ void init_extension(Command_registry &commands)
|
||||||
{
|
{
|
||||||
static Kdebug_command kdebug_command;
|
static Kdebug_command kdebug_command;
|
||||||
commands.insert(&kdebug_command);
|
commands.insert(&kdebug_command);
|
||||||
|
|
||||||
|
static Reboot_command reboot_command;
|
||||||
|
commands.insert(&reboot_command);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user