debug nic_drv

Norman Feske norman.feske at ...1...
Sat Apr 20 12:39:25 CEST 2013


Hi Keqin,

I suspect that you are mixing up the UART interfaces. The run script
relies on two UARTs to be present. UART 0 is used for printing Genode's
LOG messages and the kernel messages. The GDB monitor requires a
separate channel of communication to the remote GDB. The run script uses
UART 1 via the 'uart_drv' for that. UART 1 is then translated by qemu to
a TCP connection.

When executing the script on real hardware, you need two UARTs as well.
I suspect that you have connected only a single one. Connecting GDB to
the UART 0 of the Genode system makes no sense because this one is
unrelated to the GDB monitor.

> 	<start name="uart_drv">
> 		<resource name="RAM" quantum="2M"/>
> 		<provides> <service name="Terminal"/> </provides>
> #is that service name "Terminal" should be "/dev/ttyS0" ?

The service name denotes the type of the session. The UART driver
provides sessions of type "Terminal" and "Uart". (the "Uart" type is a
specialized kind of "Terminal", not important here) In the Genode world
"/dev/ttyS0" has no meaning.

> 		<config>
> 			<policy label="gdb_monitor" uart="1"/>
> 		</config>
> 	</start>

This configuration tells the UART driver to hand out the second UART
(UART 1) to the gdb_monitor client. The numbering starts at 0. UART 0 is
typically used by the kernel and Genode's core.

> Is that correct?

Does the run script works as intended on Qemu?

> Maybe the serial was occupied by the system output?

I guess, you are putting your finger exactly on the issue.

Do you have a way to connect a second UART to your PC? If you consider
using a PCI card with additional comports, you will need to make sure
that the UART driver uses the I/O ports of the card. (by modifying the
function 'io_port_base' in 'os/src/drivers/uart/i8250/main.cc'. You may
determine the right values by booting Linux once and executing 'lspci'.

I admit, that sounds a bit awkward and complicated. Normally, you could
use the TCP terminal ('gems/src/server/tcp_terminal') as an alternative
to an UART interface when using GDB monitor. So there would be no need
for multiple UART interfaces. (the TCP terminal provides the "Terminal"
interface but works over TCP) Unfortunately, that's not possible when
debugging the NIC driver because TCP terminal requires a NIC driver to work.

Cheers
Norman

-- 
Dr.-Ing. Norman Feske
Genode Labs

http://www.genode-labs.com · http://genode.org

Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth




More information about the users mailing list