Compiling with rtems-libbsd

mfg mfg at
Wed Aug 9 11:13:54 UTC 2017

Hello guys,

Thank you Chris for the reply, but I think I'm doing something wrong 
before the step that you describe to me.

I want to do my own program using the new bsp (I can use the compiled 
examples without problems (atleast dhcpcd01)) but when I try to compile 
there are unreference errors like

/home/marco/Desktop/Proyecto/prueba13/test_main.c:249: undefined 
reference to `rtems_bsd_setlogpriority'
/home/marco/Desktop/Proyecto/prueba13/test_main.c:276: undefined 
reference to `rtems_bsd_initialize'
o-optimize/test_main.o: In function `default_network_ifconfig_lo0':
/home/marco/Desktop/Proyecto/prueba13/test_main.c:79: undefined 
reference to `rtems_bsd_command_ifconfig'

I installed and configured the rtems-libbsd again but it's the same.

For example, the funtion ”tems_bsd_setlogpriority” is defined in lane 
250 of bsd.h 
(/arm-rtems4.12/xilinx_zynq_zedboard/lib/include/rtems/bsd/bsd.h) and I 
include that file in my program (#include <rtems/bsd/bsd.h>).

Is the bsp not enough?
I assumed in the last step of waf (waf install),  all files that we 
need are copied:
+ install 
(from build/arm-rtems4.12-xilinx_zynq_zedboard/libbsd.a)
+ install 
(from rtemsbsd/mghttpd/mongoose.h)
+ install 
(from freebsd/sys/bsm/audit.h)

Do I have to copy manually something more from the rtems-libbsd folder 
to bsp?
Maybe the makefile is wrong, do I need link the libbsd.a library? How?

Thanks in advance

Marco Fuentes Garcia

El 2017-08-04 02:24, Chris Johns escribió:
> On 03/08/2017 21:30, mfg wrote:
>> Hello everyone!
>> I have a problem with compiling examples of rtems-libbsd. I just do 
>> not know how
>> to do it. I have the example (Testsuite/ping01/test_main.c) . This 
>> is the report
>> of terminal when I executed it:
>> ## Transferring control to RTEMS (at address 00104040) ...
>> *** LIBBSD PING 1 TEST ***
>> nexus0: <RTEMS Nexus device>
>> cgem0: <Cadence CGEM Gigabit Ethernet Interface> on nexus0
>> miibus0: <MII bus> on cgem0
>> e1000phy0: <Marvell 88E1512 Gigabit PHY> PHY 0 on miibus0
>> e1000phy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 
>> 1000baseT-FDX,
>> 1000baseT-FDX-master, auto
>> cgem0: Ethernet address: 00:0a:35:00:01:22
>> zy7_slcr0: <Zynq-7000 slcr block> on nexus0
>> [zone: udpcb] kern.ipc.maxsockets limit reached
>> notice: cgem0: link state changed to DOWN
>> add host gateway cgem0
>> add net default: gateway
>> PING ( 56 data bytes
>> ping: sendto: Host is unreachable
>> ping: sendto: Host is unreachable
>> ping: sendto: Host is unreachable
>> --- ping statistics ---
>> 3 paassertion "exit_code == EXIT_SUCCESS" failed: file
>> "../../testsuite/ping01/test_main.c", line 57, function: test_ping
>> I want to change the IP for ping to my PC. It is in the file
>> (sandbox/rtems-libbsd/build/arm-rtems4.12-xilinx_zynq_zedboard/testsuite/include/rtems/bsd/test/network-config.h).
>> But I never used Waf before. ¿Where is the makefile for the 
>> suitables examples?
>> By the way, I'm working on a zedboard and I'm trying to make 
>> Ethernet
>> connectivity work. (If someone has a little manual I would 
>> appreciate it)
> The way I configure rtems-libbsd is to use '/etc/rc.conf'. I create
> or install a
> '/etc/rc.conf' file then ask for the stack to be initialised. An
> example from a
> zynq based board using the RTEMS shell is:
> -------------------------
> [/] # cat /etc/rc.conf
> #
> # My Zynq LibBSD Configuration
> #
> hostname="XXX-YYY-ZZZ"
> ifconfig_cgem0="DHCP rxcsum txcsum"
> ifconfig_cgem0_alias0="ether 00:aa:bb:cc:00:01"
> dhcpcd_priority="200"
> dhcpcd_options="--nobackground --timeout 10"
> telnetd_enable="YES"
> -------------------------
> In my code I have:
>   r = rtems_bsd_run_etc_rc_conf(15, true);
>   if (r < 0)
>     printf("error: loading BSD /etc/rc.conf failed: %s\n", 
> strerror(errno));
> There are other variants of this call you can use. Please refer to 
> the header
> file in the source for details.
> You can find out more about 'rc.conf' from the FreeBSD man pages.
> Only a subset
> of the documented and available options for FreeBSD are available on 
> Currently the source code is best place to see what is available.
> These FreeBSD pages may help:
> Chris

More information about the users mailing list