summaryrefslogtreecommitdiff
path: root/static/netbsd/man7/src.7
blob: ba15b9c9bf34666aeee2a1970ab0e46d8ea1c485 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
.\" $NetBSD: src.7,v 1.17 2022/08/21 07:10:03 lukem Exp $
.\"
.\" Copyright (c) 2012, 2013 Mingzhe Wang and Elvira Khabirova.
.\"	All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd May 14, 2020
.Dt SRC 7
.Os
.Sh NAME
.Nm src
.Nd layout of NetBSD sources
.Sh DESCRIPTION
An outline of the
.Nx
source code hierarchy.
.Bl -tag -width "external/"
.It Pa bin/
Critical utilities for the system and users.
.It Pa sbin/
Critical utilities for the system and the superuser.
.It Pa usr.bin/
Not-so critical utilities for the system and users.
.It Pa usr.sbin/
Not-so critical utilities for the system and the superuser.
.It Pa common/
Sources shared between kernel and userland.
.Bl -tag -width "include/" -compact
.It Pa dist/
Utilities.
Every utility has its own subdirectory,
where its source and Makefile are located.
.It Pa include/
Include headers.
Every group of header files has its own
subdirectory, where it and its
Makefile are located.
.It Pa lib/
Libraries.
Every library has its own subdirectory,
where it and its Makefile are located.
.El
.It Pa compat/
A framework to (re)build the libraries
shipped with
.Nx
for different ABI than the default for
that platform.
.Bl -tag -width "compat/<arch1>/<arch2>/" -compact
.It Pa compat/<arch1>/<arch2>/
Every
.Pa compat/<arch1>/<arch2>/
directory contains a Makefile and a makefile
fragment for building an
.Pa <arch2>
compat libraries for
.Pa <arch1> .
For example,
.Pa compat/amd64/i386/
is where the 32-bit compat libraries for the
amd64 port are being built.
.It Pa compatsubdir.mk
The list of subdirectories (the libraries and
ld.elf_so) to build with this ABI.
.It Pa archdirs.mk
The list of subdirectories for each port.
.It Pa Makefile.compat
The basic framework to force the right paths for
library and ld.elf_so linkage.
.It Pa dirshack/Makefile
A hack to get objdirs created timely.
.El
.It Pa crypto/
Cryptographic source, which may have import or
export restrictions.
.Bl -tag -width "external/" -compact
.It Pa dist/
Original sources.
This is deprecated;
.Pa crypto/external/
should be used instead.
.It Pa external/
Original sources, grouped by license, and then
package per license.
.Pa crypto/external/<license>/<package>/dist/
contain original sources for given package;
other directories contain Makefiles and
given package's config files.
.El
.It Pa dist/
Unmodified sources from third parties.
This is deprecated;
.Pa external/
should be used instead.
.It Pa distrib/
Tools and data-files for making distributions.
.Bl -tag -width "distrib/notes/<arch>/" -compact
.It Pa <arch>/
Architecture-specific files, grouped by
image type.
For example,
.Pa distrib/<arch>/floppies/
contains Makefiles for making images for
various types of floppies;
.Pa <arch>/ramdisk/
contains makefiles for making ramdisks etc.
.It Pa cdrom/
Was used to create bootable CD images.
This is deprecated;
.Pa build.sh
\'s
.Pa iso-image
target should be used instead.
.It Pa common/
Common files for images generation.
.It Pa miniroot/
Files for miniroot.
.It Pa notes/<arch>
Architecture-specific parts of release notes.
.It Pa sets/
Scripts for making file sets.
.It Pa utils/
Utilities for installation ramdisk.
.El
.It Pa doc/
Development documentation files: changelogs,
build readmes etc.
.Pa doc/roadmaps/
contains roadmaps.
.It Pa etc/
Default configuration files to be put into
.Pa /etc .
.Bl -tag -width "compat/<arch1>/<arch2>/" -compact
.It Pa etc/etc.<arch>/
Architecture-specific config files.
.El
.It Pa external/
Unmodified sources from third parties,
grouped by license.
Every
.Pa external/<license>/<package>/
may contain:
.Bl -tag -width "usr.sbin/" -compact
.It Pa dist/
Unmodified third party source for a given package
.It Pa bin/
.It Pa usr.bin/
.It Pa usr.sbin/
.It etc.
Such subdirectories contain reachover Makefiles,
README's and various import helper scripts.
For example,
.Pa external/public-domain/
contains
sources licensed under Public Domain
license;
.Pa external/public-domain/sqlite/dist/
contains original sources;
.Pa external/public-domain/sqlite/bin/ ,
.Pa external/public-domain/sqlite/lib/
and
.Pa external/public-domain/sqlite/
itself contain reachover Makefiles.
.El
.It Pa games/
Sources for utilities/files in
.Pa /usr/games ;
each utility has its own subdirectory, where
its sources and Makefiles are located.
.It Pa include/
Files to be put into
.Pa /usr/include .
.It Pa lib/
Source for libraries in
.Pa /usr/lib
and some scripts for them.
Every directory contains source for given library
and Makefiles.
.It Pa libexec/
Source for utilities in
.Pa /usr/libexec .
Every directory contains source for given utility
and Makefiles.
.It Pa regress/
Various regression tests in
.Pa /usr/tests .
This is deprecated; most tests are being migrated
into
.Pa tests/
once they are migrated to the
.Xr atf 7
test framework.
.It Pa rescue/
Makefiles for copying utilities to
.Pa /rescue .
.It Pa share/
Source for utilities/files in
.Pa /usr/share .
Every utility has its own subdirectory,
where its source and Makefile are located.
.It Pa sys/
Kernel source.
.Bl -tag -width "opencrypto/" -compact
.It Pa altq/
Network packet alternate queueing.
.It Pa arch/
Files to specific hardware platforms.
.It Pa coda/
Coda file system driver.
.It Pa compat/
Support for older version
.Nx
binaries and
.Pf non- Nx
binaries.
.It Pa conf/
Misc files for building kernel.
.It Pa crypto/
Crypt algorithms used by IPsec.
.It Pa ddb/
Client code for local kernel debugger.
.It Pa dev/
Device drivers.
.It Pa dist/
Parent directory for the
.Ox
packet filter
.Xr pf 4 .
.It Pa external/
Sources from third parties, grouped by license.
.It Pa fs/
File systems storing data on physical drives.
.It Pa gdbscripts/
.Xr gdb 1
macros.
.It Pa kern/
.Nx Ap s
Kernel code, such as resource management, signal delivering, etc.
.It Pa lib/
Libraries used by the kernel.
.It Pa miscfs/
Drivers for file systems used to store layered data for kernel features.
.It Pa modules/
Kernel components, including hardware specific drivers and upper-level drivers.
.It Pa net/
Lowlevel network: protocol drivers, packet filters and access interfaces for NICs.
.It Pa net80211/
Drivers for 802.11 wireless network.
.It Pa netatalk/
Appletalk protocol stack
.Xr atalk 4 .
.It Pa netbt/
Bluetooth stack
.Xr bluetooth 4 .
.It Pa netcan/
Controller Area Network stack
.Xr can 4 .
.It Pa netinet/
IPv4 protocol stack
.Xr ip 4 .
.It Pa netinet6/
IPv6 protocol stack.
.It Pa netipsec/
IPsec protocol stack
.Xr ipsec 4 .
.It Pa netmpls/
MPLS protocol stack
.Xr mpls 4 .
.It Pa nfs/
Network file system driver.
.It Pa opencrypto/
Cryptographic hardware framework
.Xr opencrypto 9 .
.It Pa rump/
Rump kernel
.Xr rump 3 .
.It Pa secmodel/
Security model framework
.Xr secmodel 9 .
.It Pa stand/
Source for several standalone programs that aren't used by
.Nx
currently.
.It Pa sys/
Header files that get installed into
.Pa /usr/include/sys .
.It Pa ufs/
UFS file system driver.
.It Pa uvm/
Virtual memory manager.
.El
.It Pa tests/
Source for test programs in
.Pa /usr/tests .
These tests use the
.Xr atf 7
test framework.
For library routines, including system calls, the
directory structure of the tests should follow the
directory structure of the real source tree.
For instance, interfaces available via the C
library should follow:
.Pa src/lib/libc/gen -> Pa src/tests/lib/libc/gen ,
.Pa src/lib/libc/sys -> Pa src/tests/lib/libc/sys ,
etc.
Equivalently, all tests for userland utilities
should try to follow their location in the source tree.
If this can not be satisfied, the tests for
a utility should be located under the directory to which
the utility is installed.
Thus, a test for
.Xr env 1
should go to
.Pa src/tests/usr.bin/env .
Likewise, a test for
.Xr tcpdump 8
should be in
.Pa src/tests/usr.sbin/tcpdump ,
even though the source code for the program is located under
.Pa src/external .
.It Pa tools/
Reachover build structure for the host build tools.
Every utility has its own directory, where its Makefile
is located.
.It Pa x11/
Reachover build structure for X11R7; the source is in
.Pa X11SRCDIR .
The directory structure copies the system\'s;
every directory contains a Makefile.
.El
.Sh SEE ALSO
.Xr hier 7
.Sh HISTORY
This file was created as a part of Google Code-in 2012/2013.
.Sh AUTHORS
.An -nosplit
This manpage was written by
.An Elvira Khabirova Aq Mt skinder0@gmail.com ,
the
.Pa sys/
part by
.An Mingzhe Wang .