psim network gdb patch with RTEMS 4.10

Till Straumann strauman at slac.stanford.edu
Tue Nov 16 11:17:40 UTC 2010


Are you sure you are using the correct, patched gdb?

You can check if the ethtap device is present in the simulator
by issuing (gdb command prompt):

linux> powerpc-rtems-gdb
(gdb) target sim
(gdb) sim trace ethtap-device

If the device is known/present/implemented then there should
be no response to this command. If the device is unknown then
an error message is printed. Here the output from an unpatched
gdb:

till at tillpad:~/Desktop/gdb-6.8/build-ppc-rtems$ gdb/gdb
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu 
--target=powerpc-rtems".
(gdb) target sim
Connected to the simulator.
(gdb) sim trace ethtap-device
Unknown trace option: ethtap-device

(gdb)

When using a patched version then the output looks like this:

till at tillpad:~/Desktop/gdb-6.8/build-ppc-rtems-patched$ gdb/gdb
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu 
--target=powerpc-rtems".
(gdb) target sim
Connected to the simulator.
(gdb) sim trace ethtap-device
(gdb)

If you are positive that you are using your patched gdb
then you should have a look at the config.log files and
find out why the ethtap device was not configured in
(you didn't patch after running 'configure', did you?).

My <build-dir>/sim/ppc/config.h contains

#define HAVE_ETHTAP 1

and <build-dir>/sim/ppc/config.log contains (look for hw_ethtap.o):

sim_hw_obj='hw_cpu.o hw_memory.o hw_nvram.o hw_iobus.o hw_htab.o 
hw_disk.o hw_trace.o hw_register.o hw_vm.o hw_init.o hw_core.o hw_pal.o 
hw_com.o hw_eeprom.o hw_opic.o hw_glue.o hw_phb.o hw_ide.o hw_ethtap.o'


HTH
-- Till


On 11/11/2010 03:45 PM, Ugarte, Carlos E. (GSFC-582.0)[NORTHRUP GRUMAN 
ELECTRONI] wrote:
>
> Greetings,
>
> I am working from the RTEMS 4.10 branch.
> I would like to run gdb-PSIM with network support.
> I found the psim/network/README and I found out that the gdb-6.8 has a 
> network patch.
> I built and installed that .
> When I run I get a message "attempt to attach unknown device ethtap" ...
>
> I have dumped the generated device file  it seems to have the right 
> info (i.e. ethtap stuff)
> I am not quite clear on how the device file is generated an used.
>
> Any hints as to how I proceed from here?
>
> Thanks
>
> Carlos Ugarte
> NASA Goddard Spaceflight Center
>
>
> [root at localhost network-demos]#
> [root at localhost network-demos]# 
> */opt/rtems-4.10/rtems/powerpc-rtems4.10/psim/tests/psim-gdb -n 
> /opt/rtems-4.10/rtems/powerpc-rtems4.10/psim/tests/netdemo.exe *
> GNU gdb 6.8
> Copyright (C) 2008 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later 
> <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "--host=x86_64-unknown-linux-gnu 
> --target=powerpc-rtems4.10"...
> /home/cugarte/rtems/rtems-4.10/example_code/network-demos/gdb_tree.root:1: 
> Error in sourced command file:
> *core: attempt to attach unknown device ethtap*
> (gdb) q
>
> [root at localhost network-demos]# *cat psim_tree.root*
> #
> #  Device Tree for PSIM
> #
> #  Automatically Generated -- DO NOT EDIT!!
> #
> /#address-cells 1
> /openprom/init/register/pvr 0xfffe0000
> # This must be >= than linkcmds defined RamSize!
> /openprom/options/oea-memory-size 0x01000000
> ##### EEPROM @ 0x0c000000 for 512K
> /eeprom at 0x0c000000/reg 0x0c000000 0x80000
> /eeprom at 0x0c000000/nr-sectors 8
> /eeprom at 0x0c000000/sector-size 0x10000
> /eeprom at 0x0c000000/byte-write-delay 1000
> /eeprom at 0x0c000000/sector-start-delay 100
> /eeprom at 0x0c000000/erase-delay 1000
> /eeprom at 0x0c000000/manufacture-code 0x01
> /eeprom at 0x0c000000/device-code 0xa4
>
> ##### NVRAM/RTC NVRAM Portion is 0x0c080000 for 512K
> ##### NVRAM/RTC RTC   Portion is 0x0c100000 for 12
> /nvram at 0x0c080000/reg 0x0c080000 524300
> /nvram at 0x0c080000/timezone -3600
>
> ##### OPENPIC @ 0x0c130000 - 0x0c170000 (512K)
> /opic at 0x0c130000/reg              0x0c130000 0 0x0c130000 0x40000
> /opic at 0x0c130000/interrupt-ranges 0 0 0 16
> /opic at 0x0c130000/device_type      open-pic
> # interupt out -> CPU's interrupt pin
> /opic at 0x0c130000 > intr0 int /cpus/cpu at 0
>
> #### ETHTAP @ 0x0c100020 for 0x40
> #
> # NOTE 'ethtap' currently (200902) requires psim to
> #      be patched -- also, it is only supported on
> #      a linux host.
> #      the 'ethtap' device transfers data from/to the
> #      simulated network interface to/from a 'ethertap'
> #      interface on the linux host (consult tun/tap
> #      device documentation).
> #      A very useful tool is 'tunctl' which allows for
> #      configuring user-accessible, persistent 'tap'
> #      devices so that psim may be executed w/o special
> #      (root) privileges.
>
> /ethtap at 0x0c100020/reg           0x0c100020 0x40
> # route interrupt to open-pic
> /ethtap at 0x0c100020 > 0 irq0 /opic at 0x0c130000
> # 'tun' device on host
> /ethtap at 0x0c100020/tun-device    "/dev/net/tun"
> # name of 'tap' device to use
> /ethtap at 0x0c100020/tap-ifname    "tap0"
> # ethernet address of simulated IF
> /ethtap at 0x0c100020/hw-address    "00:00:00:22:11:00"
> # generate CRC and append to received packet before
> # handing over to the simulation. This is mostly for
> # debugging the rtems device driver. If unsure, leave 'false'.
> /ethtap at 0x0c100020/enable-crc    false
>
>
> [root at localhost network-demos]# *ifconfig*
> eth0      Link encap:Ethernet  HWaddr 00:1C:42:58:CA:73
>           inet addr:10.211.55.4  Bcast:10.211.55.255  Mask:255.255.255.0
>           inet6 addr: fec0::fea9:21c:42ff:fe58:ca73/64 Scope:Site
>           inet6 addr: fe80::21c:42ff:fe58:ca73/64 Scope:Link
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:24507 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:22733 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000
>           RX bytes:20050543 (19.1 MiB)  TX bytes:17134091 (16.3 MiB)
>
> lo        Link encap:Local Loopback
>           inet addr:127.0.0.1  Mask:255.0.0.0
>           inet6 addr: ::1/128 Scope:Host
>           UP LOOPBACK RUNNING  MTU:16436  Metric:1
>           RX packets:1661 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:1661 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:0
>           RX bytes:3153945 (3.0 MiB)  TX bytes:3153945 (3.0 MiB)
>
> tap0      Link encap:Ethernet  HWaddr A2:1B:4F:E1:82:23
>           inet addr:192.168.0.2  Bcast:192.168.0.255  Mask:255.255.255.0
>           inet6 addr: fe80::a01b:4fff:fee1:8223/64 Scope:Link
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:0 errors:0 dropped:60 overruns:0 carrier:0
>           collisions:0 txqueuelen:500
>           RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
>
> [root at localhost network-demos]# *env | grep RTEMS*
> RTEMS_MAKEFILE_PATH=/opt/rtems-4.10/rtems/powerpc-rtems4.10/psim
> RTEMS_ROOT=/opt/rtems-4.10/rtems
> RTEMS_VERSION=4.10
> RTEMS_INSTALL=/opt/rtems-4.10
> [root at localhost network-demos]#
>
>
> Thanks
>
> Carlos Ugarte
> NASA Goddard Spaceflight Center
>
>
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20101116/fd521be3/attachment-0001.html>


More information about the users mailing list