MicroBlaze uClinux NetworkingOne of uClinux' key strengths is its suite of networking protocols and applications. This page describes how to get TCP/IP networking up and running on the default hardware target, mbvanilla_net. Please note this is NOT an in-depth tutorial on uClinux networking! That is a deep subject - for information on setting up NFS, boa (webserver) and other networking applications, search the archives and ask around on either the MicroBlaze-uclinux or uclinux-dev mailing lists, and check out the FAQs at ucdot.org. Preparation
HardwareBuild the mbvanilla_net target. You may need to modify this project slightly to support a board other than the Insight V2MB1000. If you really must change the base address of the Xilinx EMAC peripheral, make a note of the new address, you'll need it later. KernelRun "make menuconfig" from the uClinux-dist directory, and make the following selections:
If for any reason you modified the base address of the Xilinx ethernet MAC in your system.mhs, edit the file uClinux-dist/linux-2.4.x/include/asm-MicroBlaze/xparameters.h to reflect those changes. ApplicationsStill within menuconfig, make the following selections. These are optional, depending on what applications you want to run. At a minimum, choose ping, inetd and telnetd. This will allow you to demonstrate basic tcp/ip networking functionality.
(exit and save) Finally run "make dep; make clean; make" The build should complete without errors. TestingAfter the build, your new image should be sitting in the uClinux-dist/images directory - as image.bin and image.elf. Using xmd, download and run the kernel image. When the kernel bootup completes, at the shell prompt enter the following:
/> hostname MicroBlaze1 (or whatever host
name you wish)
/> ifconfig lo 127.0.0.1 /> ifconfig eth0 xx.xx.xx.xx netmask xx.xx.xx.xx broadcast xx.xx.xx.xx Get the ip, netmask and broadcast addresses from your network administrator. Note that these commands can (should) be added to the vendors/.../rc script, so they are automatically executed on startup. Then, try to ping yourself (press ^C after a few lines):
/> ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1): 56 data bytes 64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.0 ms 64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=10.0 ms 64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=10.0 ms 64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=10.0 ms 64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=10.0 ms ^C --- 127.0.0.1 ping statistics --- 5 packets transmitted, 5 packets received, 0% packet loss round-trip min/avg/max = 0.0/8.0/10.0 ms Then, try to ping another machine on your local network (in this example I pinged my linux box, 130.102.66.250
/> ping 130.102.66.250
PING 130.102.66.250 (130.102.66.250): 56 data bytes 64 bytes from 130.102.66.250: icmp_seq=0 ttl=64 time=10.0 ms 64 bytes from 130.102.66.250: icmp_seq=1 ttl=64 time=0.0 ms 64 bytes from 130.102.66.250: icmp_seq=2 ttl=64 time=0.0 ms 64 bytes from 130.102.66.250: icmp_seq=3 ttl=64 time=0.0 ms 64 bytes from 130.102.66.250: icmp_seq=4 ttl=64 time=0.0 ms ^C --- 130.102.66.250 ping statistics --- 5 packets transmitted, 5 packets received, 0% packet loss round-trip min/avg/max = 0.0/2.0/10.0 ms Finally, from a different machine on the network, try to telnet into your MicroBlaze (using whatever IP address you assigned in the "ifconfig" command above.
[jwilliam@g435-9029 jwilliam]$ telnet
MicroBlaze1
Trying 130.102.64.34... Connected to MicroBlaze1. Escape character is '^]'. MicroBlaze1 login: root No directory, logging in with HOME=/ Welcome to ____ _ _ _ _ / ___| (_)_ __ _ _ _ _ | | | | | | | | '_ \| | | < \/ > | |_| | |___| | | | | | |_| |> < | __,_|\____|_|_|_| |_|\__,_/_/\_> |_) on MicroBlaze. http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux Sash command shell (version 1.1.1) /> |
|
