mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-14 06:35:01 +08:00
libbsd.txt: Move system control hints
Generalize hint.
This commit is contained in:
@@ -592,3 +592,10 @@ Here you see that the SYSINIT(9) entries are no longer static. The
|
||||
``*_REFERENCE()`` macros will create references to the corresponding modules
|
||||
which are later resolved by the linker. The application has to provide an
|
||||
object file with references to all required FreeBSD modules.
|
||||
|
||||
System Control Hints
|
||||
====================
|
||||
|
||||
If you get undefined references to ``_bsd_sysctl_*`` symbols, then you have to
|
||||
locate and add the associated system control node, see
|
||||
`SYSCTL(9) <http://www.freebsd.org/cgi/man.cgi?query=SYSCTL_DECL&sektion=9>`_.
|
||||
|
39
libbsd.txt
39
libbsd.txt
@@ -112,45 +112,6 @@ The devices form a tree with the Nexus device at a high-level. This Nexus
|
||||
device is architecture specific in FreeBSD. In RTEMS we have our own Nexus
|
||||
device, see `rtemsbsd/bsp/bsp-bsd-nexus-devices.c`.
|
||||
|
||||
=== SYSCTL_NODE Example
|
||||
|
||||
During development, we had an undefined reference to
|
||||
_bsd_sysctl__net_children that we had trouble tracking down. Thanks to
|
||||
Chris Johns, we located it. He explained how to read SYSCTL_NODE
|
||||
definitions. This line from freebsd/netinet/in_proto.c is attempting
|
||||
to add the "inet" node to the parent node "_net".
|
||||
|
||||
----
|
||||
SYSCTL_NODE(_net, PF_INET, inet, CTLFLAG_RW, 0,
|
||||
"Internet Family");
|
||||
----
|
||||
|
||||
Our problem was that we could not find where _bsd_sysctl__net_children
|
||||
was defined. Chris suggested that when in doubt compile with -save-temps
|
||||
and look at the preprocessed .i files. But he did not need that. He
|
||||
explained that this the symbol name _bsd_sysctl__net_children was
|
||||
automatically generated by a SYSCTL_NODE as follows:
|
||||
|
||||
* _bsd_ - added by RTEMS modifications to SYSCTL_NODE macro
|
||||
* sysctl_ - boilerplace added by SYSCTL_NODE macro
|
||||
* "" - empty string for parent node
|
||||
* net - name of SYSCTL_NODE
|
||||
* children - added by SYSCTL macros
|
||||
|
||||
This was all generated by a support macro declaring the node as this:
|
||||
|
||||
----
|
||||
struct sysctl_oid_list SYSCTL_NODE_CHILDREN(parent, name);
|
||||
----
|
||||
|
||||
Given this information, we located this SYSCTL_NODE declaration in
|
||||
kern/kern_mib.c
|
||||
|
||||
----
|
||||
SYSCTL_NODE(, CTL_KERN, kern, CTLFLAG_RW, 0,
|
||||
"High kernel, proc, limits &c");
|
||||
----
|
||||
|
||||
=== devfs (Device file system) ===
|
||||
|
||||
There is a minimal implementation based on IMFS. The mount point is fixed to
|
||||
|
Reference in New Issue
Block a user