1 | RTEMS BSD USB and TCP/IP Developers Guide |
---|
2 | ========================================= |
---|
3 | Joel Sherrill <joel.sherrill@oarcorp.com> |
---|
4 | :Author Initials: JRS |
---|
5 | :toc: |
---|
6 | :icons: |
---|
7 | :numbered: |
---|
8 | :website: http://www.rtems.org/ |
---|
9 | |
---|
10 | RTEMS uses FreeBSD as the source of its TCP/IP and USB stacks. |
---|
11 | This is a developers guide which captures information on the |
---|
12 | process of merging code from FreeBSD, building this library, |
---|
13 | RTEMS specific support files, and general guidelines on what |
---|
14 | modifications to the FreeBSD source are permitted. |
---|
15 | |
---|
16 | ************************************************************** |
---|
17 | This is a work in progress and is very likely to be incomplete. |
---|
18 | Please help by adding to it. |
---|
19 | ************************************************************** |
---|
20 | |
---|
21 | == Source Code Version Information |
---|
22 | |
---|
23 | * FreeBSD 8.2 SVN r222496 |
---|
24 | * RTEMS 4.11 |
---|
25 | - BSP must have support for all new BSD sys sections |
---|
26 | - It is preferable if the BSP uses linkcmds.base. |
---|
27 | - BSP must be from an architecture with Programmable Interrupt Controller |
---|
28 | interrupt model. |
---|
29 | |
---|
30 | == To Do |
---|
31 | * Adapt generic IRQ PIC interface code to Simple Vectored Interrupt Model |
---|
32 | so that those architectures can use new TCP/IP and USB code. |
---|
33 | * in_cksum implementations for architectures not supported by FreeBSD. |
---|
34 | This will require figuring out where to put implementations that do |
---|
35 | not originate from FreeBSD and are populated via the script. |
---|
36 | * generic in_cksum implementation is missing in_cksum_split so currently |
---|
37 | cannot be used. |
---|
38 | |
---|
39 | == FreeBSD Source |
---|
40 | |
---|
41 | You should be able to rely on FreebSD manual pages and documentation |
---|
42 | for details on the code itself. |
---|
43 | |
---|
44 | === Automatically Generated FreeBSD Files |
---|
45 | |
---|
46 | The FreeBSD source tarball includes a file named Makefile.rtems which |
---|
47 | has stanzas to automatically generate some files. |
---|
48 | |
---|
49 | http://www.freebsd.org/cgi/man.cgi?query=kobj&apropos=0&sektion=0&manpath=FreeBSD+9.0-RELEASE&arch=default&format=html |
---|
50 | |
---|
51 | === Rules for Modifying FreeBSD Source |
---|
52 | |
---|
53 | * Only add lines. Subtract code by added "ifndef __rtems__". This makes |
---|
54 | merging easier in the future. |
---|
55 | |
---|
56 | == libbsd Source |
---|
57 | |
---|
58 | === What is in git |
---|
59 | |
---|
60 | The git source is a self-contained kit with FreeBSD and RTEMS components |
---|
61 | pre-merged. The Makefile in this kit is automatically generated. |
---|
62 | |
---|
63 | Any changes to sources in the freebsd or contrib directories will need to |
---|
64 | be merged upstream into our master FreeBSD svn checkout. |
---|
65 | |
---|
66 | === Building git |
---|
67 | |
---|
68 | You need to configure RTEMS for the desired BSP and install it. Then edit |
---|
69 | the file config.inc to set RTEMS_MAKEFILE_PATH appropriately. |
---|
70 | |
---|
71 | [listing] |
---|
72 | ---- |
---|
73 | make |
---|
74 | make install |
---|
75 | make -C testsuite |
---|
76 | ---- |
---|
77 | |
---|
78 | At this point, we expect multiple linker errors. That is what we are |
---|
79 | currently working on. |
---|
80 | |
---|
81 | |
---|
82 | === Organization |
---|
83 | |
---|
84 | The top level directory contains a few directories and files. The following |
---|
85 | are important to understand: |
---|
86 | |
---|
87 | * freebsd-to-rtems.py - script to convert to and free FreeBSD and RTEMS trees |
---|
88 | * Makefile - automatically generated |
---|
89 | * contrib/ - from FreeBSD by script. |
---|
90 | * freebsd/ - from FreeBSD by script. |
---|
91 | * rtemsbsd/ - RTEMS specific implementations of FreeBSD kernel support routines. |
---|
92 | * testsuite/ - RTEMS specific tests |
---|
93 | * libbsd.txt - Documentation in Asciidoc |
---|
94 | |
---|