GSOC'16 project update - RTEMS LwIP integration
Pavel Pisa
pisa at cmp.felk.cvut.cz
Sun May 22 23:44:48 UTC 2016
Hello Sai Charan Sane,
I have been busy with RTEMS on RPi till now.
But generally all materials listed in your e-mail worth
to be read. You should read for sure
Beej's Guide to Network Programming
http://beej.us/guide/bgnet/output/html/singlepage/bgnet.html
It is practical description and cookbook for users.
You should try some examples on Linux.
We have there some tasks and examples for our students prepared
in the frame of more subjects
- latency measurement on UDP communication
https://support.dce.felk.cvut.cz/psr/cviceni/ethbench/
they port that to VxWorks
- Simple webserver implementation
https://support.dce.felk.cvut.cz/psr/cviceni/semestralka/#web-server
- Simple TCP client
https://support.dce.felk.cvut.cz/pos/cv4/src/httpcl.html
- Simple TCP server with select
https://support.dce.felk.cvut.cz/pos/cv4/src/select2.html
But you can find some better documented materials on the web.
The discussed socket API is natively supported by actual RTEMS
TCP/IP stack as well as new standalone BSD stack. lwIP provides
this API as well but as separated from file system API (open,
read, write, close). So as discussed earlier, main task is to
map RTEMS file API to lower layer of lwIP API.
https://devel.rtems.org/wiki/Packages/LWIP
The result of discussion with other mentors is that for testing
i386 BSP should be used because it is the best supported
platform by QEMU.
As the first steps, please, try to build toolchain and actual
RTEMS sources with use of RSB for i386 pc target
https://devel.rtems.org/wiki/Developer/Tools/RSB
RTEMS should be configured without networking. Then start
work on lwIP support. QEMU provides e1000 as the default network
card for emulated i386 machine. It is not easiest target.
But you can find device address in emulated PCI space
by its vendor and device ID (8086:100e)
https://pci-ids.ucw.cz/read/PC/8086/100e
You can use next code from CIRUS graphic code as an example
code how to find PCI device in RTEMS. There can be better
example but I know this from my previous work.
https://git.rtems.org/rtems/tree/c/src/lib/libbsp/i386/pc386/console/fb_cirrus.c#n310
According to my search, RTEMS classic TCP/IP stack does not
have support E1000 card on i386 machines but there is support
for PowerPC/Beatnik
https://git.rtems.org/rtems/tree/c/src/lib/libbsp/powerpc/beatnik/network/if_em
This code could be combined with lwIP for i386 RTEMS under QEMU support.
The complete actual FreeBSD driver for all variants of this
card is there
https://github.com/freebsd/freebsd/tree/master/sys/dev/e1000
But that seems to me as too complex. Anyway, RTEMS lwIP final
targets should be be much smaller and simpler network interfaces.
But optimal combination of some ARM or Sparc target with reasonable
network interface for QEMU is hard to find. There is list
of NIC I have identified as supported by QEMU sources
e1000.c eepro100.c lance.c ne2000.c pcnet-pci.c pcnet.c rtl8139.c vmxnet3.c
in some documentation are mentioned
E1000 PCI - default on PC, actual record from PCI database
8086:100e Name: 82540EM Gigabit Ethernet Controller
other
ne2k_pci PCI 10Mb/s NE2000
rtl8139 PCI 10/100Mb/s Realtek Fast Ethernet
virtio
If the E1000 is too complex then other option can be tried.
Interesting is for example QEMU virtio network interface.
https://github.com/freebsd/freebsd/tree/master/sys/dev/virtio/network
The result of the discussion is that we should try to use unmodified
lwIP as submodule of the RTEMS integration project. So setup
empty repository with name "lwip-rtems-support" (for example) under your
github account and add me (GitHub ppisa and Chris) write permission
to the repository. I try to setup lwIP as submodule and extract
code which we have in our OMK repo and try to make it work with
lwIP as submodule. Then I would need help with decision
which make system should be used and its setup.
Best wishes,
Pavel
More information about the devel
mailing list