1. Read the documentation provided above.
2. Create a new directory for your port under the uip-1.0/ directory (choose a name that gives a short description of the CPU architecture and/or C compiler used).
3. Copy the uip_arch.c file from the unix/ subdirectory into the new directory. Is contains a generic C implementations of the checksum algorithm as well as the 32-bit addition function.
4. Copy the uipopt.h file from the unix/ subdirectory.
5. Edit the uipopt.h file to suit your project (the file should be self-explanatory).
6. Write a device driver for your particular hardware. (This is probably the hardest part.) Look in unix/tapdev.c and uip/slipdev.c for examples of how a device driver can look.
7. Write the main control loop so that the uIP functions are called when they should be. Look in the unix/main.c for an example of how a main control loop can look. The unix/main.c main loop also shows how ARP is used.
8. Write a makefile and compile the code. Be sure to include the ../uip/uip.c file in your project (and the .c files in your subdirectory, of course). If you are using the web server application, also include the files ../apps/httpd/httpd.c ../apps/httpd/cgi.c ../apps/httpd/fs.c. For ARP support, also include the file ../uip/uip_arp.c.
9. Find and correct all bugs.
1.阅读以上提供的文档。
2.在uip-1.0/文件夹下为你的移植对象创建一个新的文件夹(选择一个能简要描述所用的CPU架构和/或C编译器的名字)。
3.从unix/子目录复制uip_arch.c文件到新文件夹里,它包含校验运算的一般C实现和32位加法函数。
4.从unix/子目录复制uipopt.h文件。
5.编辑uipopt.h以适合你的工程(文件必须足够清楚)。
6.为你的硬件写一个驱动程序。(这可能是最困难的部分)看看示例unix/tapdev.c以及uip/slipdev.c。
7.写一个主控制循环以便于uIP函数能在应用时调用。看看示例unix/main.c,它还展示了ARP的使用.
8.写一个makefile并编译代码,工程里面一定要包含../uip/uip.c文件(当然还有你子目录中的.c文件)。如果你使用WEB服务器应用,还要包含../apps/httpd/httpd.c ../apps/httpd/cgi.c ../apps/httpd/fs.c。为了支持ARP还要包含../uip/uip_arp.c。
9.查找和修正BUG。
用户377235 2013-3-24 12:15
用户577024 2012-3-29 10:16