1 | RTEMS BSD Library Guide |
---|
2 | ======================= |
---|
3 | :toc: |
---|
4 | :icons: |
---|
5 | :numbered: |
---|
6 | :website: http://www.rtems.org/ |
---|
7 | |
---|
8 | RTEMS uses FreeBSD 9.2 as the source of its TCP/IP and USB stacks. |
---|
9 | This is a guide which captures information on the |
---|
10 | process of merging code from FreeBSD, building this library, |
---|
11 | RTEMS specific support files, and general guidelines on what |
---|
12 | modifications to the FreeBSD source are permitted. |
---|
13 | |
---|
14 | Goals of this effort are |
---|
15 | |
---|
16 | * update TCP/IP and provide USB in RTEMS, |
---|
17 | * ease updating to future FreeBSD versions, |
---|
18 | * ease tracking changes in FreeBSD code, |
---|
19 | * minimize manual changes in FreeBSD code, and |
---|
20 | * define stable kernel/device driver API which is implemented |
---|
21 | by both RTEMS and FreeBSD. This is the foundation of the port. |
---|
22 | |
---|
23 | We will work to push our changes upstream to the FreeBSD Project |
---|
24 | and minimize changes required at each update point. |
---|
25 | |
---|
26 | ******************************************************************************* |
---|
27 | This is a work in progress and is very likely to be incomplete. |
---|
28 | Please help by adding to it. |
---|
29 | ******************************************************************************* |
---|
30 | |
---|
31 | == Getting Started |
---|
32 | |
---|
33 | === Tool Chain === |
---|
34 | |
---|
35 | You need a tool chain for RTEMS based on at least |
---|
36 | |
---|
37 | * Binutils 2.24, and |
---|
38 | * Newlib 2.1.0. |
---|
39 | |
---|
40 | The Binutils version is required to ease the handling of linker command files. |
---|
41 | The Newlib version is required since some standard files like `<sys/types.h>` |
---|
42 | must be compatible enough for the files provided by the FreeBSD sources, e.g. |
---|
43 | `<sys/socket.h>`. |
---|
44 | |
---|
45 | === Board Support Package Requirements === |
---|
46 | |
---|
47 | The RTEMS version must be at least 4.11. The Board Support Package (BSP) |
---|
48 | should support the |
---|
49 | http://www.rtems.org/onlinedocs/doxygen/cpukit/html/group__rtems__interrupt__extension.html[Interrupt Manager Extension] |
---|
50 | to make use of generic FreeBSD based drivers. |
---|
51 | |
---|
52 | The linker command file of the BSP must contain the following sections: |
---|
53 | |
---|
54 | ------------------------------------------------------------------------------- |
---|
55 | .rtemsroset : { |
---|
56 | KEEP (*(SORT(.rtemsroset.*))) |
---|
57 | } |
---|
58 | |
---|
59 | .rtemsrwset : { |
---|
60 | KEEP (*(SORT(.rtemsrwset.*))) |
---|
61 | } |
---|
62 | ------------------------------------------------------------------------------- |
---|
63 | |
---|
64 | The first section can be placed in read-only memory. The section section must |
---|
65 | be placed in read-write memory. |
---|
66 | |
---|
67 | === Board Support Package Configuration and Build === |
---|
68 | |
---|
69 | You need to configure RTEMS for the desired BSP and install it. The BSP should |
---|
70 | be configured with a disabled network stack. The BSD library containing the |
---|
71 | new network stack is a separate package. Using a BSP installation containing |
---|
72 | the old network stack may lead to confusion and unpredictable results. |
---|
73 | |
---|
74 | The following script is used to build the `arm/realview_pbx_a9_qemu` BSP for |
---|
75 | our internal testing purposes: |
---|
76 | |
---|
77 | ------------------------------------------------------------------------------- |
---|
78 | #!/bin/sh |
---|
79 | |
---|
80 | cd ${HOME}/sandbox |
---|
81 | rm -rf b-realview_pbx_a9_qemu |
---|
82 | mkdir b-realview_pbx_a9_qemu |
---|
83 | cd b-realview_pbx_a9_qemu |
---|
84 | ${HOME}/git-rtems/configure \ |
---|
85 | --prefix=${HOME}/sandbox/install \ |
---|
86 | --target=arm-rtems4.11 \ |
---|
87 | --enable-rtemsbsp=realview_pbx_a9_qemu \ |
---|
88 | --disable-networking && \ |
---|
89 | make && \ |
---|
90 | make install |
---|
91 | ------------------------------------------------------------------------------- |
---|
92 | |
---|
93 | The `arm/realview_pbx_a9_qemu` BSP running on the Qemu simulator has some |
---|
94 | benefits for development and test of the BSD library |
---|
95 | |
---|
96 | * it offers a NULL pointer read and write protection, |
---|
97 | * Qemu is a fast simulator, |
---|
98 | * Qemu provides support for GDB watchpoints, |
---|
99 | * Qemu provides support for virtual Ethernet networks, e.g. TUN and bridge |
---|
100 | devices (you can run multiple test instances on one virtual network). |
---|
101 | |
---|
102 | === BSD Library Configuration and Build === |
---|
103 | |
---|
104 | In the BSD library source directory edit the file 'config.inc'. Continuing on |
---|
105 | the above, the 'config.inc' used to match the above is: |
---|
106 | |
---|
107 | ------------------------------------------------------------------------------- |
---|
108 | # Mandatory: Select your BSP and installation prefix |
---|
109 | TARGET = arm-rtems4.11 |
---|
110 | BSP = realview_pbx_a9_qemu |
---|
111 | PREFIX = $(HOME)/sandbox/install |
---|
112 | |
---|
113 | # Optional: Separate installation base directory |
---|
114 | INSTALL_BASE = $(PREFIX)/$(TARGET)/$(BSP) |
---|
115 | |
---|
116 | # Optional: Network test configuration |
---|
117 | TEST_RUNNER = $(BSP) |
---|
118 | NET_CFG_SELF_IP = 10.0.0.2 |
---|
119 | NET_CFG_NETMASK = 255.255.0.0 |
---|
120 | NET_CFG_PEER_IP = 10.0.0.1 |
---|
121 | NET_CFG_GATEWAY_IP = 10.0.0.1 |
---|
122 | NET_TAP_INTERFACE = tap0 |
---|
123 | ------------------------------------------------------------------------------- |
---|
124 | |
---|
125 | Now you can build the BSD library and run the tests: |
---|
126 | |
---|
127 | ------------------------------------------------------------------------------- |
---|
128 | make clean |
---|
129 | make |
---|
130 | make run_tests |
---|
131 | ------------------------------------------------------------------------------- |
---|
132 | |
---|
133 | To install the BSD library use this: |
---|
134 | |
---|
135 | ------------------------------------------------------------------------------- |
---|
136 | make install |
---|
137 | ------------------------------------------------------------------------------- |
---|
138 | |
---|
139 | === BSD Library Initialization === |
---|
140 | |
---|
141 | Use the following code to initialize the BSD library: |
---|
142 | |
---|
143 | ------------------------------------------------------------------------------- |
---|
144 | #include <assert.h> |
---|
145 | |
---|
146 | #include <rtems/bsd/bsd.h> |
---|
147 | |
---|
148 | void do_init(void) |
---|
149 | { |
---|
150 | rtems_status_code sc; |
---|
151 | |
---|
152 | sc = rtems_bsd_initialize(); |
---|
153 | assert(sc == RTEMS_SUCCESSFUL); |
---|
154 | } |
---|
155 | ------------------------------------------------------------------------------- |
---|
156 | |
---|
157 | == Network Stack Features |
---|
158 | |
---|
159 | http://roy.marples.name/projects/dhcpcd/index[DHCPCD(8)]:: DHCP client |
---|
160 | |
---|
161 | https://developer.apple.com/library/mac/documentation/Networking/Reference/DNSServiceDiscovery_CRef/Reference/reference.html[dns_sd.h]:: DNS Service Discovery |
---|
162 | |
---|
163 | http://www.opensource.apple.com/source/mDNSResponder/mDNSResponder-320.10/mDNSCore/mDNSEmbeddedAPI.h[mDNS]:: Multi-Cast DNS |
---|
164 | |
---|
165 | http://www.freebsd.org/cgi/man.cgi?query=unix&sektion=4&apropos=0&manpath=FreeBSD+9.2-RELEASE[UNIX(4)]:: UNIX-domain protocol family |
---|
166 | |
---|
167 | http://www.freebsd.org/cgi/man.cgi?query=inet&sektion=4&apropos=0&manpath=FreeBSD+9.2-RELEASE[INET(4)]:: Internet protocol family |
---|
168 | |
---|
169 | http://www.freebsd.org/cgi/man.cgi?query=inet6&apropos=0&sektion=4&manpath=FreeBSD+9.2-RELEASE&arch=default&format=html[INET6(4)]:: Internet protocol version 6 family |
---|
170 | |
---|
171 | http://www.freebsd.org/cgi/man.cgi?query=tcp&apropos=0&sektion=4&manpath=FreeBSD+9.2-RELEASE&arch=default&format=html[TCP(4)]:: Internet Transmission Control Protocol |
---|
172 | |
---|
173 | http://www.freebsd.org/cgi/man.cgi?query=udp&apropos=0&sektion=4&manpath=FreeBSD+9.2-RELEASE&arch=default&format=html[UDP(4)]:: Internet User Datagram Protocol |
---|
174 | |
---|
175 | http://www.freebsd.org/cgi/man.cgi?query=route&sektion=4&apropos=0&manpath=FreeBSD+9.2-RELEASE[ROUTE(4)]:: Kernel packet forwarding database |
---|
176 | |
---|
177 | http://www.freebsd.org/cgi/man.cgi?query=bpf&apropos=0&sektion=4&manpath=FreeBSD+9.2-RELEASE&arch=default&format=html[BPF(4)]:: Berkeley Packet Filter |
---|
178 | |
---|
179 | http://www.freebsd.org/cgi/man.cgi?query=socket&apropos=0&sektion=2&manpath=FreeBSD+9.2-RELEASE&arch=default&format=html[SOCKET(2)]:: Create an endpoint for communication |
---|
180 | |
---|
181 | http://www.freebsd.org/cgi/man.cgi?query=kqueue&apropos=0&sektion=2&manpath=FreeBSD+9.2-RELEASE&arch=default&format=html[KQUEUE(2)]:: Kernel event notification mechanism |
---|
182 | |
---|
183 | http://www.freebsd.org/cgi/man.cgi?query=select&apropos=0&sektion=2&manpath=FreeBSD+9.2-RELEASE&arch=default&format=html[SELECT(2)]:: Synchronous I/O multiplexing |
---|
184 | |
---|
185 | http://www.freebsd.org/cgi/man.cgi?query=poll&apropos=0&sektion=2&manpath=FreeBSD+9.2-RELEASE&arch=default&format=html[POLL(2)]:: Synchronous I/O multiplexing |
---|
186 | |
---|
187 | http://www.freebsd.org/cgi/man.cgi?query=route&apropos=0&sektion=8&manpath=FreeBSD+9.2-RELEASE&arch=default&format=html[ROUTE(8)]:: Manually manipulate the routing tables |
---|
188 | |
---|
189 | http://www.freebsd.org/cgi/man.cgi?query=ifconfig&apropos=0&sektion=8&manpath=FreeBSD+9.2-RELEASE&arch=default&format=html[IFCONFIG(8)]:: Configure network interface parameters |
---|
190 | |
---|
191 | http://www.freebsd.org/cgi/man.cgi?query=netstat&apropos=0&sektion=1&manpath=FreeBSD+9.2-RELEASE&arch=default&format=html[NETSTAT(1)]:: Show network status |
---|
192 | |
---|
193 | http://www.freebsd.org/cgi/man.cgi?query=ping&apropos=0&sektion=8&manpath=FreeBSD+9.2-RELEASE&arch=default&format=html[PING(8)]:: Send ICMP ECHO_REQUEST packets to network hosts |
---|
194 | |
---|
195 | http://www.freebsd.org/cgi/man.cgi?query=ping6&apropos=0&sektion=8&manpath=FreeBSD+9.2-RELEASE&arch=default&format=html[PING6(8)]:: Send ICMPv6 ECHO_REQUEST packets to network hosts |
---|
196 | |
---|
197 | http://www.freebsd.org/cgi/man.cgi?query=sysctl&sektion=3&apropos=0&manpath=FreeBSD+9.2-RELEASE[SYSCTL(3)]:: Get or set system information |
---|
198 | |
---|
199 | http://www.freebsd.org/cgi/man.cgi?query=resolver&sektion=3&apropos=0&manpath=FreeBSD+9.2-RELEASE[RESOLVER(3)]:: Resolver routines |
---|
200 | |
---|
201 | http://www.freebsd.org/cgi/man.cgi?query=gethostbyname&sektion=3&apropos=0&manpath=FreeBSD+9.2-RELEASE[GETHOSTBYNAME(3)]:: Get network host entry |
---|
202 | |
---|
203 | == Issues and TODO |
---|
204 | |
---|
205 | * Per-CPU data should be enabled once the new stack is ready for SMP. |
---|
206 | |
---|
207 | * Per-CPU NETISR(9) should be enabled onece the new stack is ready for SMP. |
---|
208 | |
---|
209 | * Multiple routing tables are not supported. Every FIB value is set to zero |
---|
210 | (= BSD_DEFAULT_FIB). |
---|
211 | |
---|
212 | * Process identifiers are not supported. Every PID value is set to zero |
---|
213 | (= BSD_DEFAULT_PID). |
---|
214 | |
---|
215 | * User credentials are not supported. The following functions allow the |
---|
216 | operation for everyone |
---|
217 | - prison_equal_ip4(), |
---|
218 | - chgsbsize(), |
---|
219 | - cr_cansee(), |
---|
220 | - cr_canseesocket() and |
---|
221 | - cr_canseeinpcb(). |
---|
222 | |
---|
223 | * A basic USB functionality test that is known to work on Qemu is desirable. |
---|
224 | |
---|
225 | * Adapt generic IRQ PIC interface code to Simple Vectored Interrupt Model |
---|
226 | so that those architectures can use new TCP/IP and USB code. |
---|
227 | |
---|
228 | * freebsd-userspace/rtems/include/sys/syslog.h is a copy from the old |
---|
229 | RTEMS TCP/IP stack. For some reason, the __printflike markers do not |
---|
230 | compile in this environment. We may want to use the FreeBSD syslog.h |
---|
231 | and get this addressed. |
---|
232 | |
---|
233 | * in_cksum implementations for architectures not supported by FreeBSD. |
---|
234 | This will require figuring out where to put implementations that do |
---|
235 | not originate from FreeBSD and are populated via the script. |
---|
236 | |
---|
237 | * MAC support functions are not thread-safe ("freebsd/lib/libc/posix1e/mac.c"). |
---|
238 | |
---|
239 | * IFCONFIG(8): IEEE80211 support is disabled. This module depends on a XML |
---|
240 | parser and mmap(). |
---|
241 | |
---|
242 | * get_cyclecount(): The implementation is a security problem. |
---|
243 | |
---|
244 | * What to do with the priority parameter present in the FreeBSD synchronization |
---|
245 | primitives and the thread creation functions? |
---|
246 | |
---|
247 | * TASKQUEUE(9): Support spin mutexes. |
---|
248 | |
---|
249 | * ZONE(9): Review allocator lock usage in rtems-bsd-chunk.c. |
---|
250 | |
---|
251 | * KQUEUE(2): Choose proper lock for global kqueue list. |
---|
252 | |
---|
253 | * TIMEOUT(9): Maybe use special task instead of timer server to call |
---|
254 | callout_tick(). |
---|
255 | |
---|
256 | * sysctl_handle_opaque(): Implement reliable snapshots. |
---|
257 | |
---|
258 | * PING6(8): What to do with SIGALARM? |
---|
259 | |
---|
260 | * <sys/param.h>: Update Newlib to use a MSIZE of 256. |
---|
261 | |
---|
262 | * BPF(4): Add support for zero-copy buffers. |
---|
263 | |
---|
264 | * UNIX(4): Fix race conditions in the area of socket object and file node |
---|
265 | destruction. Add support for file descriptor transmission via control |
---|
266 | messages. |
---|
267 | |
---|
268 | * PRINTF(9): Add support for log(), the %D format specifier is missing in the |
---|
269 | normal printf() family. |
---|
270 | |
---|
271 | * Why is the interrupt server used? The BSD interrupt handlers can block on |
---|
272 | synchronization primitives like mutexes. This is in contrast to RTEMS |
---|
273 | interrupt service routines. The BSPs using the generic interrupt support must |
---|
274 | implement the `bsp_interrupt_vector_enable()` and |
---|
275 | `bsp_interrupt_vector_disable()` routines. They normally enable/disable a |
---|
276 | particular interrupt source at the interrupt controller. This can be used to |
---|
277 | implement the interrupt server. The interrupt server is a task that wakes-up |
---|
278 | in case an associated interrupt happens. The interrupt source is disabled in |
---|
279 | a generic interrupt handler that wakes-up the interrupt server task. Once the |
---|
280 | postponed interrupt processing is performed in the interrupt server the |
---|
281 | interrupt source is enabled again. |
---|
282 | |
---|
283 | * Convert all BSP linkcmds to use a linkcmds.base so the sections are |
---|
284 | easier to insert. |
---|
285 | |
---|
286 | * NIC Device Drivers |
---|
287 | - Only common PCI NIC drivers have been included in the initial set. These |
---|
288 | do not include any system on chip or ISA drivers. |
---|
289 | - PCI configuration probe does not appear to happen to determine if a |
---|
290 | NIC is in I/O or memory space. We have worked around this by using a |
---|
291 | static hint to tell the fxp driver the correct mode. But this needs to |
---|
292 | be addressed. |
---|
293 | - The ISA drivers require more BSD infrastructure to be addressed. This was |
---|
294 | outside the scope of the initial porting effort. |
---|
295 | |
---|
296 | == FreeBSD Source |
---|
297 | |
---|
298 | You should be able to rely on FreebSD manual pages and documentation |
---|
299 | for details on the code itself. |
---|
300 | |
---|
301 | === Automatically Generated FreeBSD Files |
---|
302 | |
---|
303 | Some source and header files are automatically generated during the FreeBSD |
---|
304 | build process. The `Makefile.todo` file performs this manually. The should be |
---|
305 | included in `freebsd-to-rtems.py` script some time in the future. For details, |
---|
306 | see also |
---|
307 | http://www.freebsd.org/cgi/man.cgi?query=kobj&sektion=9&apropos=0&manpath=FreeBSD+9.2-RELEASE[KOBJ(9)]. |
---|
308 | |
---|
309 | === Rules for Modifying FreeBSD Source |
---|
310 | |
---|
311 | Only add lines. Subtract code by added `#ifndef __rtems__`. This makes |
---|
312 | merging easier in the future. For example: |
---|
313 | |
---|
314 | ------------------------------------------------------------------------------- |
---|
315 | /* Global variables for the kernel. */ |
---|
316 | |
---|
317 | #ifndef __rtems__ |
---|
318 | /* 1.1 */ |
---|
319 | extern char kernelname[MAXPATHLEN]; |
---|
320 | #endif /* __rtems__ */ |
---|
321 | |
---|
322 | extern int tick; /* usec per tick (1000000 / hz) */ |
---|
323 | ------------------------------------------------------------------------------- |
---|
324 | |
---|
325 | ------------------------------------------------------------------------------- |
---|
326 | #if defined(_KERNEL) || defined(_WANT_FILE) |
---|
327 | #ifdef __rtems__ |
---|
328 | #include <rtems/libio_.h> |
---|
329 | #include <sys/fcntl.h> |
---|
330 | #endif /* __rtems__ */ |
---|
331 | /* |
---|
332 | * Kernel descriptor table. |
---|
333 | * One entry for each open kernel vnode and socket. |
---|
334 | * |
---|
335 | * Below is the list of locks that protects members in struct file. |
---|
336 | * |
---|
337 | * (f) protected with mtx_lock(mtx_pool_find(fp)) |
---|
338 | * (d) cdevpriv_mtx |
---|
339 | * none not locked |
---|
340 | */ |
---|
341 | ------------------------------------------------------------------------------- |
---|
342 | |
---|
343 | ------------------------------------------------------------------------------- |
---|
344 | extern int profprocs; /* number of process's profiling */ |
---|
345 | #ifndef __rtems__ |
---|
346 | extern volatile int ticks; |
---|
347 | #else /* __rtems__ */ |
---|
348 | #include <rtems/score/watchdogimpl.h> |
---|
349 | #define ticks _Watchdog_Ticks_since_boot |
---|
350 | #endif /* __rtems__ */ |
---|
351 | |
---|
352 | #endif /* _KERNEL */ |
---|
353 | ------------------------------------------------------------------------------- |
---|
354 | |
---|
355 | Add nothing (even blank lines) before or after the `__rtems__` guards. Always |
---|
356 | include a `__rtems__` in the guards to make searches easy. |
---|
357 | |
---|
358 | == BSD Library Source |
---|
359 | |
---|
360 | === What is in the Git Repository |
---|
361 | |
---|
362 | There is a self-contained kit with FreeBSD and RTEMS components pre-merged. The |
---|
363 | Makefile in this kit is automatically generated. |
---|
364 | |
---|
365 | Any changes to source in the `freebsd` directories will need to be merged |
---|
366 | upstream into our master FreeBSD checkout, the `freebsd-org` submodule. |
---|
367 | |
---|
368 | The repository contains two FreeBSD source trees. In the `freebsd` directory |
---|
369 | are the so called 'managed' FreeBSD sources used to build the BSD library. The |
---|
370 | FreeBSD source in `freebsd-org` is the 'master' version. The |
---|
371 | `freebsd-to-rtems.py` script is used to transfer files between the two trees. |
---|
372 | In general terms, if you have modified managed FreeBSD sources, you will need |
---|
373 | to run the script in 'revert' or 'reverse' mode using the `-R` switch. This |
---|
374 | will copy the source back to your local copy of the master FreeBSD source so |
---|
375 | you can run `git diff` against the upstream FreeBSD source. If you want to |
---|
376 | transfer source files from the master FreeBSD source to the manged FreeBSD |
---|
377 | sources, then you must run the script in 'forward' mode (the default). |
---|
378 | |
---|
379 | === Organization |
---|
380 | |
---|
381 | The top level directory contains a few directories and files. The following |
---|
382 | are important to understand |
---|
383 | |
---|
384 | * `freebsd-to-rtems.py` - script to convert to and free FreeBSD and RTEMS trees, |
---|
385 | * `Makefile` - automatically generated, |
---|
386 | * `freebsd/` - from FreeBSD by script, |
---|
387 | * `rtemsbsd/` - RTEMS specific implementations of FreeBSD kernel support routines, |
---|
388 | * `testsuite/` - RTEMS specific tests, and |
---|
389 | * `libbsd.txt` - documentation in Asciidoc. |
---|
390 | |
---|
391 | == Moving Code Between Managed and Master FreeBSD Source |
---|
392 | |
---|
393 | The script `freebsd-to-rtems.py` is used to copy code from FreeBSD to the |
---|
394 | rtems-libbsd tree and to reverse this process. This script attempts to |
---|
395 | automate this process as much as possible and performs some transformations |
---|
396 | on the FreeBSD code. Its command line arguments are shown below: |
---|
397 | |
---|
398 | ---- |
---|
399 | freebsd-to-rtems.py [args] |
---|
400 | -?|-h|--help print this and exit |
---|
401 | -d|--dry-run run program but no modifications |
---|
402 | -D|--diff provide diff of files between trees |
---|
403 | -e|--early-exit evaluate arguments, print results, and exit |
---|
404 | -m|--makefile just generate Makefile |
---|
405 | -R|--reverse default FreeBSD -> RTEMS, reverse that |
---|
406 | -r|--rtems RTEMS directory |
---|
407 | -f|--freebsd FreeBSD directory |
---|
408 | -v|--verbose enable verbose output mode |
---|
409 | ---- |
---|
410 | |
---|
411 | In its default mode of operation, freebsd-to-rtems.py is used to copy code |
---|
412 | from FreeBSD to the rtems-libbsd tree and perform transformations. In forward |
---|
413 | mode, the script may be requested to just generate the Makefile. |
---|
414 | |
---|
415 | In "reverse mode", this script undoes those transformations and copies |
---|
416 | the source code back to the FreeBSD SVN tree. This allows us to do |
---|
417 | 'svn diff', evaluate changes made by the RTEMS Project, and report changes |
---|
418 | back to FreeBSD upstream. |
---|
419 | |
---|
420 | In either mode, the script may be asked to perform a dry-run or be verbose. |
---|
421 | Also, in either mode, the script is also smart enough to avoid copying over |
---|
422 | files which have not changed. This means that the timestamps of files are |
---|
423 | not changed unless the contents change. The script will also report the |
---|
424 | number of files which changed. In verbose mode, the script will print |
---|
425 | the name of the files which are changed. |
---|
426 | |
---|
427 | The following is an example forward run with no changes. |
---|
428 | |
---|
429 | ---- |
---|
430 | $ ~/newbsd/git/libbsd-8.2/freebsd-to-rtems.py \ |
---|
431 | -r /home/joel/newbsd/git/libbsd-8.2 \ |
---|
432 | -f /home/joel/newbsd/libbsd/freebsd-8.2 -v |
---|
433 | Verbose: yes |
---|
434 | Dry Run: no |
---|
435 | Only Generate Makefile: no |
---|
436 | RTEMS Directory: /home/joel/newbsd/git/libbsd-8.2 |
---|
437 | FreeBSD Directory: /home/joel/newbsd/libbsd/freebsd-8.2 |
---|
438 | Direction: forward |
---|
439 | Generating into /home/joel/newbsd/git/libbsd-8.2 |
---|
440 | 0 files were changed. |
---|
441 | ---- |
---|
442 | |
---|
443 | The script may also be used to generate a diff in either forward or reverse |
---|
444 | direction. |
---|
445 | |
---|
446 | == Initialization of the BSD Library |
---|
447 | |
---|
448 | The initialization of the BSD library is based on the FreeBSD SYSINIT(9) |
---|
449 | infrastructure. The key to initializing a system is to ensure that the desired |
---|
450 | device drivers are explicitly pulled into the linked application. This plus |
---|
451 | linking against the BSD library (`libbsd.a`) will pull in the necessary FreeBSD |
---|
452 | infrastructure. |
---|
453 | |
---|
454 | The FreeBSD kernel is not a library like the RTEMS kernel. It is a bunch of |
---|
455 | object files linked together. If we have a library, then creating the |
---|
456 | executable is simple. We begin with a start symbol and recursively resolve all |
---|
457 | references. With a bunch of object files linked together we need a different |
---|
458 | mechanism. Most object files don't know each other. Lets say we have a driver |
---|
459 | module. The rest of the system has no references to this driver module. The |
---|
460 | driver module needs a way to tell the rest of the system: Hey, kernel I am |
---|
461 | here, please use my services! |
---|
462 | |
---|
463 | This registration of independent components is performed by SYSINIT(9) and |
---|
464 | specializations: |
---|
465 | |
---|
466 | http://www.freebsd.org/cgi/man.cgi?query=SYSINIT |
---|
467 | |
---|
468 | The SYSINIT(9) uses some global data structures that are placed in a certain |
---|
469 | section. In the linker command file we need this: |
---|
470 | |
---|
471 | ------------------------------------------------------------------------------- |
---|
472 | .rtemsroset : { |
---|
473 | KEEP (*(SORT(.rtemsroset.*))) |
---|
474 | } |
---|
475 | |
---|
476 | .rtemsrwset : { |
---|
477 | KEEP (*(SORT(.rtemsrwset.*))) |
---|
478 | } |
---|
479 | ------------------------------------------------------------------------------- |
---|
480 | |
---|
481 | This results for example in this executable layout: |
---|
482 | |
---|
483 | ------------------------------------------------------------------------------- |
---|
484 | [...] |
---|
485 | *(SORT(.rtemsroset.*)) |
---|
486 | .rtemsroset.bsd.modmetadata_set.begin |
---|
487 | 0x000000000025fe00 0x0 libbsd.a(rtems-bsd-init.o) |
---|
488 | 0x000000000025fe00 _bsd__start_set_modmetadata_set |
---|
489 | .rtemsroset.bsd.modmetadata_set.content |
---|
490 | 0x000000000025fe00 0x8 libbsd.a(rtems-bsd-nexus.o) |
---|
491 | .rtemsroset.bsd.modmetadata_set.content |
---|
492 | 0x000000000025fe08 0x4 libbsd.a(kern_module.o) |
---|
493 | [...] |
---|
494 | .rtemsroset.bsd.modmetadata_set.content |
---|
495 | 0x000000000025fe68 0x4 libbsd.a(mii.o) |
---|
496 | .rtemsroset.bsd.modmetadata_set.content |
---|
497 | 0x000000000025fe6c 0x4 libbsd.a(mii_bitbang.o) |
---|
498 | .rtemsroset.bsd.modmetadata_set.end |
---|
499 | 0x000000000025fe70 0x0 libbsd.a(rtems-bsd-init.o) |
---|
500 | 0x000000000025fe70 _bsd__stop_set_modmetadata_set |
---|
501 | [...] |
---|
502 | .rtemsrwset 0x000000000030bad0 0x290 |
---|
503 | *(SORT(.rtemsrwset.*)) |
---|
504 | .rtemsrwset.bsd.sysinit_set.begin |
---|
505 | 0x000000000030bad0 0x0 libbsd.a(rtems-bsd-init.o) |
---|
506 | 0x000000000030bad0 _bsd__start_set_sysinit_set |
---|
507 | .rtemsrwset.bsd.sysinit_set.content |
---|
508 | 0x000000000030bad0 0x4 libbsd.a(rtems-bsd-nexus.o) |
---|
509 | .rtemsrwset.bsd.sysinit_set.content |
---|
510 | 0x000000000030bad4 0x8 libbsd.a(rtems-bsd-thread.o) |
---|
511 | .rtemsrwset.bsd.sysinit_set.content |
---|
512 | 0x000000000030badc 0x4 libbsd.a(init_main.o) |
---|
513 | [...] |
---|
514 | .rtemsrwset.bsd.sysinit_set.content |
---|
515 | 0x000000000030bd54 0x4 libbsd.a(frag6.o) |
---|
516 | .rtemsrwset.bsd.sysinit_set.content |
---|
517 | 0x000000000030bd58 0x8 libbsd.a(uipc_accf.o) |
---|
518 | .rtemsrwset.bsd.sysinit_set.end |
---|
519 | 0x000000000030bd60 0x0 libbsd.a(rtems-bsd-init.o) |
---|
520 | 0x000000000030bd60 _bsd__stop_set_sysinit_set |
---|
521 | [...] |
---|
522 | ------------------------------------------------------------------------------- |
---|
523 | |
---|
524 | Here you can see, that some global data structures are collected into |
---|
525 | continuous memory areas. This memory area can be identified by start and stop |
---|
526 | symbols. This constructs a table of uniform items. |
---|
527 | |
---|
528 | The low level FreeBSD code calls at some time during the initialization the |
---|
529 | mi_startup() function (machine independent startup). This function will sort |
---|
530 | the SYSINIT(9) set and call handler functions which perform further |
---|
531 | initialization. The last step is the scheduler invocation. |
---|
532 | |
---|
533 | The SYSINIT(9) routines are run in mi_startup() which is called by |
---|
534 | rtems_bsd_initialize(). |
---|
535 | |
---|
536 | This is also explained in "The Design and Implementation of the FreeBSD |
---|
537 | Operating System" section 14.3 "Kernel Initialization". |
---|
538 | |
---|
539 | In RTEMS we have a library and not a bunch of object files. Thus we need a way |
---|
540 | to pull-in the desired services out of the libbsd. Here the |
---|
541 | `rtems-bsd-sysinit.h` comes into play. The SYSINIT(9) macros have been |
---|
542 | modified and extended for RTEMS in `<sys/kernel.h>`: |
---|
543 | |
---|
544 | ------------------------------------------------------------------------------- |
---|
545 | #ifndef __rtems__ |
---|
546 | #define C_SYSINIT(uniquifier, subsystem, order, func, ident) \ |
---|
547 | static struct sysinit uniquifier ## _sys_init = { \ |
---|
548 | subsystem, \ |
---|
549 | order, \ |
---|
550 | func, \ |
---|
551 | (ident) \ |
---|
552 | }; \ |
---|
553 | DATA_SET(sysinit_set,uniquifier ## _sys_init) |
---|
554 | #else /* __rtems__ */ |
---|
555 | #define SYSINIT_ENTRY_NAME(uniquifier) \ |
---|
556 | _bsd_ ## uniquifier ## _sys_init |
---|
557 | #define SYSINIT_REFERENCE_NAME(uniquifier) \ |
---|
558 | _bsd_ ## uniquifier ## _sys_init_ref |
---|
559 | #define C_SYSINIT(uniquifier, subsystem, order, func, ident) \ |
---|
560 | struct sysinit SYSINIT_ENTRY_NAME(uniquifier) = { \ |
---|
561 | subsystem, \ |
---|
562 | order, \ |
---|
563 | func, \ |
---|
564 | (ident) \ |
---|
565 | }; \ |
---|
566 | RWDATA_SET(sysinit_set,SYSINIT_ENTRY_NAME(uniquifier)) |
---|
567 | #define SYSINIT_REFERENCE(uniquifier) \ |
---|
568 | extern struct sysinit SYSINIT_ENTRY_NAME(uniquifier); \ |
---|
569 | static struct sysinit const * const \ |
---|
570 | SYSINIT_REFERENCE_NAME(uniquifier) __used \ |
---|
571 | = &SYSINIT_ENTRY_NAME(uniquifier) |
---|
572 | #define SYSINIT_MODULE_REFERENCE(mod) \ |
---|
573 | SYSINIT_REFERENCE(mod ## module) |
---|
574 | #define SYSINIT_DRIVER_REFERENCE(driver, bus) \ |
---|
575 | SYSINIT_MODULE_REFERENCE(driver ## _ ## bus) |
---|
576 | #define SYSINIT_DOMAIN_REFERENCE(dom) \ |
---|
577 | SYSINIT_REFERENCE(domain_add_ ## dom) |
---|
578 | #endif /* __rtems__ */ |
---|
579 | ------------------------------------------------------------------------------- |
---|
580 | |
---|
581 | Here you see that the SYSINIT(9) entries are no longer static. The |
---|
582 | \*_REFERENCE() macros will create references to the corresponding modules which |
---|
583 | are later resolved by the linker. The application has to provide an object |
---|
584 | file with references to all required FreeBSD modules. |
---|
585 | |
---|
586 | The FreeBSD device model is quite elaborated (with follow-ups): |
---|
587 | |
---|
588 | http://www.freebsd.org/cgi/man.cgi?query=driver |
---|
589 | |
---|
590 | The devices form a tree with the Nexus device at a high-level. This Nexus |
---|
591 | device is architecture specific in FreeBSD. In RTEMS we have our own Nexus |
---|
592 | device, see `rtemsbsd/bsp/bsp-bsd-nexus-devices.c`. |
---|
593 | |
---|
594 | === SYSCTL_NODE Example |
---|
595 | |
---|
596 | During development, we had an undefined reference to |
---|
597 | _bsd_sysctl__net_children that we had trouble tracking down. Thanks to |
---|
598 | Chris Johns, we located it. He explained how to read SYSCTL_NODE |
---|
599 | definitions. This line from freebsd/netinet/in_proto.c is attempting |
---|
600 | to add the "inet" node to the parent node "_net". |
---|
601 | |
---|
602 | ---- |
---|
603 | SYSCTL_NODE(_net, PF_INET, inet, CTLFLAG_RW, 0, |
---|
604 | "Internet Family"); |
---|
605 | ---- |
---|
606 | |
---|
607 | Our problem was that we could not find where _bsd_sysctl__net_children |
---|
608 | was defined. Chris suggested that when in doubt compile with -save-temps |
---|
609 | and look at the preprocessed .i files. But he did not need that. He |
---|
610 | explained that this the symbol name _bsd_sysctl__net_children was |
---|
611 | automatically generated by a SYSCTL_NODE as follows: |
---|
612 | |
---|
613 | * _bsd_ - added by RTEMS modifications to SYSCTL_NODE macro |
---|
614 | * sysctl_ - boilerplace added by SYSCTL_NODE macro |
---|
615 | * "" - empty string for parent node |
---|
616 | * net - name of SYSCTL_NODE |
---|
617 | * children - added by SYSCTL macros |
---|
618 | |
---|
619 | This was all generated by a support macro declaring the node as this: |
---|
620 | |
---|
621 | ---- |
---|
622 | struct sysctl_oid_list SYSCTL_NODE_CHILDREN(parent, name); |
---|
623 | ---- |
---|
624 | |
---|
625 | Given this information, we located this SYSCTL_NODE declaration in |
---|
626 | kern/kern_mib.c |
---|
627 | |
---|
628 | ---- |
---|
629 | SYSCTL_NODE(, CTL_KERN, kern, CTLFLAG_RW, 0, |
---|
630 | "High kernel, proc, limits &c"); |
---|
631 | ---- |
---|
632 | |
---|
633 | == Core FreeBSD APIs and RTEMS Replacements == |
---|
634 | |
---|
635 | === SX(9) (Shared/exclusive locks) === |
---|
636 | |
---|
637 | http://www.freebsd.org/cgi/man.cgi?query=sx |
---|
638 | |
---|
639 | Binary semaphores (this neglects the ability to allow shared access). |
---|
640 | |
---|
641 | === MUTEX(9) (Mutual exclusion) === |
---|
642 | |
---|
643 | http://www.freebsd.org/cgi/man.cgi?query=mutex |
---|
644 | |
---|
645 | Binary semaphores (not recursive mutexes are not supported this way). |
---|
646 | |
---|
647 | === RWLOCK(9) (Reader/writer lock) === |
---|
648 | |
---|
649 | http://www.freebsd.org/cgi/man.cgi?query=rwlock |
---|
650 | |
---|
651 | POSIX r/w lock. |
---|
652 | |
---|
653 | === RMLOCK(9) (Reader/writer lock optimized for mostly read access patterns) === |
---|
654 | |
---|
655 | Note: This object was implemented as a wrapper for RWLOCK in the rm_lock header file. |
---|
656 | |
---|
657 | http://www.freebsd.org/cgi/man.cgi?query=rmlock |
---|
658 | |
---|
659 | POSIX r/w lock. |
---|
660 | |
---|
661 | === CONDVAR(9) (Condition variables) === |
---|
662 | |
---|
663 | http://www.freebsd.org/cgi/man.cgi?query=condvar |
---|
664 | |
---|
665 | POSIX condition variables with modifications (hack). |
---|
666 | |
---|
667 | === CALLOUT(9) (Timer functions) === |
---|
668 | |
---|
669 | http://www.freebsd.org/cgi/man.cgi?query=callout |
---|
670 | |
---|
671 | Timer server. |
---|
672 | |
---|
673 | === TASKQUEUE(9) (Asynchronous task execution) === |
---|
674 | |
---|
675 | http://www.freebsd.org/cgi/man.cgi?query=taskqueue |
---|
676 | |
---|
677 | TBD. |
---|
678 | |
---|
679 | === KTHREAD(9), KPROC(9) (Tasks) === |
---|
680 | |
---|
681 | http://www.freebsd.org/cgi/man.cgi?query=kthread |
---|
682 | |
---|
683 | http://www.freebsd.org/cgi/man.cgi?query=kproc |
---|
684 | |
---|
685 | Tasks. |
---|
686 | |
---|
687 | === ZONE(9) (Zone allocator) === |
---|
688 | |
---|
689 | http://www.freebsd.org/cgi/man.cgi?query=zone |
---|
690 | |
---|
691 | TBD. |
---|
692 | |
---|
693 | === devfs (Device file system) === |
---|
694 | |
---|
695 | Dummy, IMFS or new implementation (currently dummy). |
---|
696 | |
---|
697 | === psignal (Signals) === |
---|
698 | |
---|
699 | TBD. Seems to be not needed. |
---|
700 | |
---|
701 | === poll, select === |
---|
702 | |
---|
703 | TBD. Seems to be not needed. |
---|
704 | |
---|
705 | === RMAN(9) (Resource management) === |
---|
706 | |
---|
707 | http://www.freebsd.org/cgi/man.cgi?query=rman |
---|
708 | |
---|
709 | TBD. Seems to be not needed. |
---|
710 | |
---|
711 | === DEVCLASS(9), DEVICE(9), DRIVER(9), MAKE_DEV(9) (Device management) === |
---|
712 | |
---|
713 | http://www.freebsd.org/cgi/man.cgi?query=devclass |
---|
714 | |
---|
715 | http://www.freebsd.org/cgi/man.cgi?query=device |
---|
716 | |
---|
717 | http://www.freebsd.org/cgi/man.cgi?query=driver |
---|
718 | |
---|
719 | http://www.freebsd.org/cgi/man.cgi?query=make_dev |
---|
720 | |
---|
721 | Use FreeBSD implementation as far as possible. FreeBSD has a nice API for |
---|
722 | dynamic device handling. It may be interesting for RTEMS to use this API |
---|
723 | internally in the future. |
---|
724 | |
---|
725 | === BUS_SPACE(9), BUS_DMA(9) (Bus and DMA access) === |
---|
726 | |
---|
727 | http://www.freebsd.org/cgi/man.cgi?query=bus_space |
---|
728 | |
---|
729 | http://www.freebsd.org/cgi/man.cgi?query=bus_dma |
---|
730 | |
---|
731 | Likely BSP dependent. A default implementation for memory mapped linear access |
---|
732 | is easy to provide. The current heap implementation supports all properties |
---|
733 | demanded by bus_dma (including the boundary constraint). |
---|
734 | |
---|
735 | == RTEMS Replacements by File Description == |
---|
736 | |
---|
737 | Note: Files with a status of USB are used by the USB test and have at least |
---|
738 | been partially tested. If they contain both USB and Nic, then they are used |
---|
739 | by both and MAY contain methods that have not been tested yet. Files that |
---|
740 | are only used by the Nic test are the most suspect. |
---|
741 | |
---|
742 | ---- |
---|
743 | rtems-libbsd File: rtems-bsd-assert.c |
---|
744 | FreeBSD File: rtems-bsd-config.h redefines BSD_ASSERT. |
---|
745 | Description: This file contains the support method rtems_bsd_assert_func(). |
---|
746 | Status: USB, Nic |
---|
747 | |
---|
748 | rtems-libbsd File: rtems-bsd-autoconf.c |
---|
749 | FreeBSD File: FreeBSD has BSP specific autoconf.c |
---|
750 | Description: This file contains configuration methods that are used to setup the system. |
---|
751 | Status: USB |
---|
752 | |
---|
753 | rtems-libbsd File: rtems-bsd-bus-dma.c |
---|
754 | FreeBSD File: FreeBSD has BSP specific busdma_machdep.c |
---|
755 | Description: |
---|
756 | Status: USB, Nic |
---|
757 | |
---|
758 | rtems-libbsd File: rtems-bsd-bus-dma-mbuf.c |
---|
759 | FreeBSD File: FreeBSD has BSP specific busdma_machdep.c |
---|
760 | Description: |
---|
761 | Status: Nic |
---|
762 | |
---|
763 | rtems-libbsd File: rtems-bsd-callout.c |
---|
764 | FreeBSD File: kern/kern_timeout.c |
---|
765 | Description: |
---|
766 | Status: USB, Nic |
---|
767 | |
---|
768 | rtems-libbsd File: rtems-bsd-cam.c |
---|
769 | FreeBSD File: cam/cam_sim.c |
---|
770 | Description: |
---|
771 | Status: USB |
---|
772 | |
---|
773 | rtems-libbsd File: rtems-bsd-condvar.c |
---|
774 | FreeBSD File: kern/kern_condvar.c |
---|
775 | Description: |
---|
776 | Status: USB |
---|
777 | |
---|
778 | rtems-libbsd File: rtems-bsd-copyinout.c |
---|
779 | FreeBSD File: bsp specific copyinout.c ) |
---|
780 | Description: Note: The FreeBSD file is split with some methods being in rtems-bsd-support |
---|
781 | Status: Nic |
---|
782 | |
---|
783 | rtems-libbsd File: rtems-bsd-delay.c |
---|
784 | FreeBSD File: bsp specific file with multiple names |
---|
785 | Description: |
---|
786 | Status: USB, Nic |
---|
787 | |
---|
788 | rtems-libbsd File: rtems-bsd-descrip.c |
---|
789 | FreeBSD File: kern/kern_descrip.c |
---|
790 | Description: |
---|
791 | Status: Nic |
---|
792 | |
---|
793 | rtems-libbsd File: rtems-bsd-generic.c |
---|
794 | FreeBSD File: kern/sys_generic.c |
---|
795 | Description: |
---|
796 | Status: Nic |
---|
797 | |
---|
798 | rtems-libbsd File: rtems-bsd-init.c |
---|
799 | FreeBSD File: N/A |
---|
800 | Description: |
---|
801 | Status: USB, Nic |
---|
802 | |
---|
803 | rtems-libbsd File: rtems-bsd-init-with-irq.c |
---|
804 | FreeBSD File: N/A |
---|
805 | Description: |
---|
806 | Status: USB, Nic |
---|
807 | |
---|
808 | rtems-libbsd File: rtems-bsd-jail.c |
---|
809 | FreeBSD File: kern/kern_jail.c |
---|
810 | Description: |
---|
811 | Status: USB, Nic |
---|
812 | |
---|
813 | rtems-libbsd File: rtems-bsd-lock.c |
---|
814 | FreeBSD File: kern/subr_lock.c |
---|
815 | Description: |
---|
816 | Status: USB, Nic |
---|
817 | |
---|
818 | rtems-libbsd File: rtems-bsd-log.c |
---|
819 | FreeBSD File: kern/subr_prf.c |
---|
820 | Description: |
---|
821 | Status: Nic |
---|
822 | |
---|
823 | rtems-libbsd File: rtems-bsd-malloc.c |
---|
824 | FreeBSD File: kern/kern_malloc.c |
---|
825 | Description: |
---|
826 | Status: USB, Nic |
---|
827 | |
---|
828 | rtems-libbsd File: rtems-bsd-mutex.c |
---|
829 | FreeBSD File: kern/kern_mutex.c |
---|
830 | Description: |
---|
831 | Status: USB, Nic |
---|
832 | |
---|
833 | rtems-libbsd File: rtems-bsd-newproc.c |
---|
834 | FreeBSD File: N/A |
---|
835 | Description: |
---|
836 | Status: Nic |
---|
837 | |
---|
838 | rtems-libbsd File: rtems-bsd-nexus.c |
---|
839 | FreeBSD File: bsp specific nexus.c |
---|
840 | Description: |
---|
841 | Status: USB |
---|
842 | |
---|
843 | rtems-libbsd File: rtems-bsd-panic.c |
---|
844 | FreeBSD File: boot/common/panic.c |
---|
845 | Description: |
---|
846 | Status: USB, Nic |
---|
847 | |
---|
848 | rtems-libbsd File: rtems-bsd-rwlock.c |
---|
849 | FreeBSD File: kern_rwlock.c |
---|
850 | Description: |
---|
851 | Status: USB, Nic |
---|
852 | |
---|
853 | rtems-libbsd File: rtems-bsd-shell.c |
---|
854 | FreeBSD File: N/A |
---|
855 | Description: |
---|
856 | Status: USB |
---|
857 | |
---|
858 | rtems-libbsd File: rtems-bsd-signal.c |
---|
859 | FreeBSD File: kern/kern_sig.c |
---|
860 | Description: |
---|
861 | Status: Nic |
---|
862 | |
---|
863 | rtems-libbsd File: rtems-bsd-smp.c |
---|
864 | FreeBSD File: N/A |
---|
865 | Description: |
---|
866 | Status: Nic |
---|
867 | |
---|
868 | rtems-libbsd File: rtems-bsd-support.c |
---|
869 | FreeBSD File: bsp specific copyinout.c |
---|
870 | Description: Note: the FreeBSD file is split with some methods being in rtems-bsd-copyinout. |
---|
871 | Status: USB, Nic |
---|
872 | |
---|
873 | rtems-libbsd File: rtems-bsd-sx.c |
---|
874 | FreeBSD File: kern/kern_sx.c |
---|
875 | Description: Status: USB, Nic |
---|
876 | |
---|
877 | rtems-libbsd File: rtems-bsd-synch.c |
---|
878 | FreeBSD File: kern/kern_synch.c |
---|
879 | Description: |
---|
880 | Status: USB, Nic |
---|
881 | |
---|
882 | rtems-libbsd File: rtems-bsd-syscalls.c |
---|
883 | FreeBSD File: User API for kern/uipc_syscalls.c |
---|
884 | Description: |
---|
885 | Status: Nic |
---|
886 | |
---|
887 | rtems-libbsd File: rtems-bsd-sysctlbyname.c |
---|
888 | FreeBSD File: User API for sysctlbyname(3) |
---|
889 | Description: |
---|
890 | Status: |
---|
891 | |
---|
892 | rtems-libbsd File: rtems-bsd-sysctl.c |
---|
893 | FreeBSD File: User API for sysctl(8) |
---|
894 | Description: |
---|
895 | Status: |
---|
896 | |
---|
897 | rtems-libbsd File: rtems-bsd-sysctlnametomib.c |
---|
898 | FreeBSD File: User API for sysctlnametomib |
---|
899 | Description: |
---|
900 | Status: |
---|
901 | |
---|
902 | rtems-libbsd File: rtems-bsd-taskqueue.c |
---|
903 | FreeBSD File: kern/subr_taskqueue.c |
---|
904 | Description: |
---|
905 | Status: Nic |
---|
906 | |
---|
907 | rtems-libbsd File: rtems-bsd-thread.c |
---|
908 | FreeBSD File: kern/kern_kthread.c |
---|
909 | Description: |
---|
910 | Status: USB, Nic |
---|
911 | |
---|
912 | rtems-libbsd File: rtems-bsd-timeout.c |
---|
913 | FreeBSD File: kern/kern_timeout.c |
---|
914 | Description: |
---|
915 | Status: Nic |
---|
916 | |
---|
917 | rtems-libbsd File: rtems-bsd-timesupport.c |
---|
918 | FreeBSD File: kern/kern_clock.c |
---|
919 | Description: |
---|
920 | Status: Nic |
---|
921 | |
---|
922 | rtems-libbsd File: rtems-bsd-vm_glue.c |
---|
923 | FreeBSD File: vm/vm_glue.c |
---|
924 | Description: |
---|
925 | Status: USB, Nic |
---|
926 | ---- |
---|
927 | |
---|
928 | == Notes by File == |
---|
929 | |
---|
930 | altq_subr.c - Arbitrary choices were made in this file that RTEMS would |
---|
931 | not support tsc frequency change. Additionally, the clock frequency |
---|
932 | for machclk_freq is always measured for RTEMS. |
---|
933 | |
---|
934 | conf.h - In order to add make_dev and destroy_dev, variables in the cdev |
---|
935 | structure that were not being used were conditionally compiled out. The |
---|
936 | capability of supporting children did not appear to be needed and was |
---|
937 | not implemented in the rtems version of these routines. |
---|
938 | |
---|
939 | == NICs Status == |
---|
940 | |
---|
941 | ---- |
---|
942 | Driver Symbol Status |
---|
943 | ====== ====== ====== |
---|
944 | RealTek _bsd_re_pcimodule_sys_init Links |
---|
945 | EtherExpress _bsd_fxp_pcimodule_sys_init Links |
---|
946 | DEC tulip _bsd_dc_pcimodule_sys_init Links |
---|
947 | Broadcom BCM57xxx _bsd_bce_pcimodule_sys_init Links |
---|
948 | Broadcom BCM4401 _bsd_bfe_pcimodule_sys_init Links |
---|
949 | Broadcom BCM570x _bsd_bge_pcimodule_sys_init Needs Symbols (A) |
---|
950 | E1000 IGB _bsd_igb_pcimodule_sys_init Links |
---|
951 | E1000 EM _bsd_em_pcimodule_sys_init Links |
---|
952 | ---- |
---|
953 | |
---|
954 | |
---|
955 | Symbols (A) |
---|
956 | pci_get_vpd_ident |
---|
957 | |
---|
958 | == Problems to report to FreeBSD == |
---|
959 | |
---|
960 | The MMAP_NOT_AVAILABLE define is inverted on its usage. When it is |
---|
961 | defined the mmap method is called. Additionally, it is not used |
---|
962 | thoroughly. It is not used in the unmap portion of the source. |
---|
963 | The file rec_open.c uses the define MMAP_NOT_AVAILABLE to wrap |
---|
964 | the call to mmap and file rec_close.c uses the munmap method. |
---|
965 | |
---|
966 | |
---|
967 | |
---|