mirror of
https://github.com/genodelabs/genode.git
synced 2025-03-10 22:44:30 +00:00
cli_monitor: Add foc-specific kdebug command
This commit is contained in:
parent
022e762a40
commit
dfe4fd177d
@ -22,7 +22,7 @@ exec tar cfv bin/vim.tar -h -C bin/vim .
|
|||||||
create_boot_directory
|
create_boot_directory
|
||||||
|
|
||||||
append config {
|
append config {
|
||||||
<config verbose="yes">
|
<config>
|
||||||
<parent-provides>
|
<parent-provides>
|
||||||
<service name="ROM"/>
|
<service name="ROM"/>
|
||||||
<service name="LOG"/>
|
<service name="LOG"/>
|
||||||
@ -44,15 +44,29 @@ append config {
|
|||||||
<provides><service name="Timer"/></provides>
|
<provides><service name="Timer"/></provides>
|
||||||
<route> <any-service> <parent/> </any-service> </route>
|
<route> <any-service> <parent/> </any-service> </route>
|
||||||
</start>
|
</start>
|
||||||
<start name="uart_drv">
|
<start name="uart_drv">}
|
||||||
|
|
||||||
|
# use kernel debugger as UART on Fiasco.OC
|
||||||
|
append_if [have_spec foc] config {
|
||||||
|
<binary name="kdb_uart_drv"/>}
|
||||||
|
|
||||||
|
append config {
|
||||||
<resource name="RAM" quantum="1M"/>
|
<resource name="RAM" quantum="1M"/>
|
||||||
<provides>
|
<provides>
|
||||||
<service name="Uart"/>
|
<service name="Uart"/>
|
||||||
<service name="Terminal"/>
|
<service name="Terminal"/>
|
||||||
</provides>
|
</provides>
|
||||||
<config>
|
<config> }
|
||||||
<policy label="terminal_mux" uart="1" detect_size="yes"/>
|
|
||||||
<policy label="noux" uart="1" detect_size="yes"/>
|
# on Fiasco.OC the kdb_uart_drv is always UART 0
|
||||||
|
append_if [have_spec foc] config {
|
||||||
|
<policy label="terminal_mux" uart="0" detect_size="yes"/> }
|
||||||
|
|
||||||
|
# on all other kernels, direct terminal_mux to UART 1 (Qemu stdio, see below)
|
||||||
|
append_if [expr ![have_spec foc]] config {
|
||||||
|
<policy label="terminal_mux" uart="1" detect_size="yes"/> }
|
||||||
|
|
||||||
|
append config {
|
||||||
</config>
|
</config>
|
||||||
<route> <any-service> <parent/> </any-service> </route>
|
<route> <any-service> <parent/> </any-service> </route>
|
||||||
</start>
|
</start>
|
||||||
@ -134,11 +148,22 @@ set boot_modules {
|
|||||||
vim.tar
|
vim.tar
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lappend_if [have_spec foc] boot_modules kdb_uart_drv
|
||||||
|
|
||||||
|
set fiasco_serial_esc_arg ""
|
||||||
|
|
||||||
build_boot_image $boot_modules
|
build_boot_image $boot_modules
|
||||||
|
|
||||||
append qemu_args " -m 256 "
|
append qemu_args " -m 256 "
|
||||||
#append qemu_args " -nographic -serial mon:stdio -serial file:/tmp/foo"
|
append qemu_args " -nographic "
|
||||||
append qemu_args " -nographic -serial file:kdb.log -serial mon:stdio"
|
|
||||||
|
#
|
||||||
|
# On Fiasco.OC, we use only one UART via the kernel debugger.
|
||||||
|
# On all other kernels, we write the core debug output to the kdb.log file,
|
||||||
|
# and use qemu's stdio as the UART used by terminal_mux.
|
||||||
|
#
|
||||||
|
append_if [expr ![have_spec foc]] qemu_args " -serial file:kdb.log "
|
||||||
|
append qemu_args " -serial mon:stdio"
|
||||||
|
|
||||||
run_genode_until forever
|
run_genode_until forever
|
||||||
|
|
||||||
|
4
os/lib/mk/cli_monitor.mk
Normal file
4
os/lib/mk/cli_monitor.mk
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
SRC_CC = no_extension.cc
|
||||||
|
INC_DIR += $(REP_DIR)/src/app/cli_monitor
|
||||||
|
|
||||||
|
vpath no_extension.cc $(REP_DIR)/src/app/cli_monitor
|
4
os/lib/mk/foc/cli_monitor.mk
Normal file
4
os/lib/mk/foc/cli_monitor.mk
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
SRC_CC = extension.cc
|
||||||
|
INC_DIR += $(REP_DIR)/src/app/cli_monitor
|
||||||
|
|
||||||
|
vpath extension.cc $(REP_DIR)/src/app/cli_monitor/foc
|
25
os/src/app/cli_monitor/extension.h
Normal file
25
os/src/app/cli_monitor/extension.h
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* \brief Interface for platform-specific CLI-monitor commands
|
||||||
|
* \author Norman Feske
|
||||||
|
* \date 2013-03-21
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2013 Genode Labs GmbH
|
||||||
|
*
|
||||||
|
* This file is part of the Genode OS framework, which is distributed
|
||||||
|
* under the terms of the GNU General Public License version 2.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _EXTENSION_H_
|
||||||
|
#define _EXTENSION_H_
|
||||||
|
|
||||||
|
/* local includes */
|
||||||
|
#include <line_editor.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize and register platform-specific commands
|
||||||
|
*/
|
||||||
|
void init_extension(Command_registry &);
|
||||||
|
|
||||||
|
#endif /* _EXTENSION_H_ */
|
53
os/src/app/cli_monitor/foc/extension.cc
Normal file
53
os/src/app/cli_monitor/foc/extension.cc
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
/*
|
||||||
|
* \brief Fiasco.OC-specific CLI-monitor extensions
|
||||||
|
* \author Norman Feske
|
||||||
|
* \date 2013-03-18
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2013 Genode Labs GmbH
|
||||||
|
*
|
||||||
|
* This file is part of the Genode OS framework, which is distributed
|
||||||
|
* under the terms of the GNU General Public License version 2.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* local includes */
|
||||||
|
#include <extension.h>
|
||||||
|
#include <terminal_util.h>
|
||||||
|
|
||||||
|
/* Fiasco includes */
|
||||||
|
namespace Fiasco {
|
||||||
|
#include <l4/sys/kdebug.h>
|
||||||
|
#include <l4/sys/ipc.h>
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
struct Kdebug_command : Command
|
||||||
|
{
|
||||||
|
Kdebug_command() : Command("kdebug", "enter kernel debugger (via serial console)") { }
|
||||||
|
|
||||||
|
void execute(Command_line &, Terminal::Session &terminal)
|
||||||
|
{
|
||||||
|
tprintf(terminal, " Entering kernel debugger...\n");
|
||||||
|
tprintf(terminal, " Press [g] to continue execution.\n");
|
||||||
|
|
||||||
|
using namespace Fiasco;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Wait a bit to give the terminal a chance to print the usage
|
||||||
|
* information before the kernel debugger takes over.
|
||||||
|
*/
|
||||||
|
l4_ipc_sleep(l4_timeout(L4_IPC_TIMEOUT_NEVER, l4_timeout_rel(244, 11)));
|
||||||
|
|
||||||
|
enter_kdebug("");
|
||||||
|
|
||||||
|
tprintf(terminal, "\n");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
void init_extension(Command_registry &commands)
|
||||||
|
{
|
||||||
|
static Kdebug_command kdebug_command;
|
||||||
|
commands.insert(&kdebug_command);
|
||||||
|
}
|
@ -25,6 +25,7 @@
|
|||||||
#include <line_editor.h>
|
#include <line_editor.h>
|
||||||
#include <command_line.h>
|
#include <command_line.h>
|
||||||
#include <terminal_util.h>
|
#include <terminal_util.h>
|
||||||
|
#include <extension.h>
|
||||||
|
|
||||||
using Terminal::tprintf;
|
using Terminal::tprintf;
|
||||||
using Genode::Xml_node;
|
using Genode::Xml_node;
|
||||||
@ -534,6 +535,10 @@ int main(int argc, char **argv)
|
|||||||
static Command_registry commands;
|
static Command_registry commands;
|
||||||
static Child_registry children;
|
static Child_registry children;
|
||||||
|
|
||||||
|
/* initialize platform-specific commands */
|
||||||
|
init_extension(commands);
|
||||||
|
|
||||||
|
/* initialize generic commands */
|
||||||
commands.insert(new Help_command);
|
commands.insert(new Help_command);
|
||||||
Kill_command kill_command(children);
|
Kill_command kill_command(children);
|
||||||
commands.insert(&kill_command);
|
commands.insert(&kill_command);
|
||||||
|
17
os/src/app/cli_monitor/no_extension.cc
Normal file
17
os/src/app/cli_monitor/no_extension.cc
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
/*
|
||||||
|
* \brief Dummy implementation of CLI extension interface
|
||||||
|
* \author Norman Feske
|
||||||
|
* \date 2013-03-21
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2013 Genode Labs GmbH
|
||||||
|
*
|
||||||
|
* This file is part of the Genode OS framework, which is distributed
|
||||||
|
* under the terms of the GNU General Public License version 2.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <extension.h>
|
||||||
|
|
||||||
|
void init_extension(Command_registry &) { }
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
TARGET = cli_monitor
|
TARGET = cli_monitor
|
||||||
SRC_CC = main.cc
|
SRC_CC = main.cc
|
||||||
LIBS = base
|
LIBS = base cli_monitor
|
||||||
INC_DIR += $(PRG_DIR)
|
INC_DIR += $(PRG_DIR)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user