debug nic_drv

Norman Feske norman.feske at ...1...
Mon Apr 22 11:20:29 CEST 2013


Hello Keqin,

> Can I just turn the Genode's LOG messages and the kernel messages
> off, then letthe GDB monitor use the UART0 channel? If I can, how to
> do that?

I assume that you are using Fiasco.OC? If yes, you may find the
so-called kdb_uart_drv (at 'os/src/drivers/uart/kdb') useful. This is a
pseudo-UART driver that uses the Fiasco.OC kernel debugger as backend.
So all in/output will go through the UART interface used by the kernel,
which happens to be UART 0. This way, you can direct the "Terminal"
session used for the GDB protocol to the kernel debugger. Just replace
the 'uart_drv' with the 'kdb_uart_drv' in the run script. For an
example, please have a look at 'run/kdb_uart_drv.run'.

With 'uart_kdb_drv' in place, we still have the problem of the debug
output of the kernel and core's LOG service polluting the UART 0. To
silence core, you may just modify the '_out_char' function in
'base-foc/src/base/console/core_console.h'. This function is the back
end for all console messages produced by core (either directly or
indirectly via the LOG service). By removing the call to
'Fiasco::outchar(c)', you can suppress all those messages.

However, there may still be messages printed by the kernel, for example
warnings that occurring during unmap operations. Those messages will
probably mess up the GDB protocol. But maybe you are lucky and GDB will
deal gracefully with them? Just give it a try.

Good luck!

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