network support: libbsdport or rtems-libbsd for e1000 network chips on i386?

Ricardo Derbes rmderbes at gmail.com
Thu Nov 3 21:03:42 UTC 2016


Hello Chris.

Following your advice, I made a checkout of rtems-libbsd and built it
(using rtems 4.11 rc4, by the way)
As I think none of the source files in rtems-network-demos is intended
to be used with libbsd, I resorted to build ChrisJ dbserver
(https://ftp.rtems.org/pub/rtems/people/chrisj/dbserver/), as is, and
I succeeded.

My problem is that I cannot run it under qemu, it hangs (or at least
does nothing) after issuing rtems-bsd-initialize()
I started qemu with: qemu-system-i386 -kernel examples/net-app.exe
-vga cirrus -append "--console=/dev/com1" -net nic,vlan=1,model=e1000
-net user,vlan=1 -append "--console=/dev/com1"  -serial stdio
Running ticker.exe the same way works ok.
Is it even possible tu run dbserver under qemu?
Or, where can I find a network demo which uses rtems-libbsd, as a start point?
Thank you very much

Ricardo






2016-10-30 13:09 GMT-03:00 Chris Johns <chrisj at rtems.org>:
> On 29/10/16 1:14 pm, RMDerbes wrote:
>>
>> I need to deploy rtems on a x86 host that has 2 Intel GbE network
>> interfaces: I218 and I210.
>> I'm a bit confused with rtems networking support, because there are the
>> rtems-libbsd and the libbsdport projects
>> in rtems git repo, although libbsdport sources are much older and only
>> in Joel's repo.
>> Which one may be use?
>
> Use libbsd.
>
>> It seems to me that drivers for these interfaces (I210 and I218) are
>> implemented in rtems-libbsd/freebsd/sys/dev/e1000 folder,
>> and I have built successfully a i386 BSP (disabling network support) and
>> libbsd.
>> I'm stuck now, I do not know how to initialize network using the drivers
>> provided in libbsd, and, basically, how to use libbsd in my projects.
>> I have not found any documentation about it
>
> The following can be found in my debug server snaphots
> (https://ftp.rtems.org/pub/rtems/people/chrisj/dbserver/).
>
> I add to init.c (where I use confdefs.h):
>
>  /*
>   * Configure LibBSD.
>   */
>  #define RTEMS_BSD_CONFIG_DOMAIN_PAGE_MBUFS_SIZE (128 * 1024 * 1024)
>  #define RTEMS_BSD_CONFIG_NET_PF_UNIX
>  #define RTEMS_BSD_CONFIG_NET_IF_LAGG
>  #define RTEMS_BSD_CONFIG_NET_IF_VLAN
>  #define RTEMS_BSD_CONFIG_SERVICE_TELNETD
>  #define RTEMS_BSD_CONFIG_BSP_CONFIG
>  #define RTEMS_BSD_CONFIG_INIT
>
>  #include <machine/rtems-bsd-config.h>
>
> In main.c I have:
>
>   printf("BSD Initialisation ...\n");
>
>   rtems_bsd_initialize();
>
>   r = rtems_bsd_run_etc_rc_conf(15, false);
>   if (r < 0)
>     fprintf(stderr, "error: loading BSD /etc/rc.conf failed: %s\n",
>             strerror(errno));
>
> and finally rc.conf contains:
>
>  #
>  # System initialisation.
>  #
>  hostname="p03"
>  ifconfig_em0="inet 10.10.5.33 netmask 255.255.255.0"
>  ifconfig_cgem0="inet 10.10.5.34 netmask 255.255.255.0"
>  ifconfig_re0="inet 10.10.5.35 netmask 255.255.255.0"
>  ifconfig_em1="DHCP"
>  ifconfig_em2="DHCP"
>  ifconfig_em3="DHCP"
>  defaultrouter="10.10.5.1"
>
>  # Services
>  telnetd_enable="YES"
>
> If you are not sure what the NIC's label is boot RTEMS and initailise
> libbsd and see what it prints out when it detects the interfaces.
>
> Chris
> _______________________________________________
> users mailing list
> users at rtems.org
> http://lists.rtems.org/mailman/listinfo/users


More information about the users mailing list