debug nic_drv

Keqin Sun keqin at ...189...
Mon Apr 22 04:18:06 CEST 2013


Hi Norman,
     Thanks for your reply, and it is really helpful. I was totally lost in that
issue and you pulled me out. I will give it a try following your guide.

Regards
Keqin


On ÐÇÆÚÁù, ËÄÔÂ 20, 2013 6:39 pm, Norman Feske wrote:
-----------------------------------------------------------------------------------
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.comhttp://genode.org

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

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Genode-main mailing list
Genode-main at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/genode-main

-----------------------------------------------------------------------------------





More information about the users mailing list